# Session display agent guide
## Where to look
| Module facade | `mod.rs` |
| Picker rows, preview reads, command workflows | `commands.rs` |
| Owned picker-list/prune work and result application | `../controller/app/session_maintenance.rs` |
| Recorded events to display state | `history.rs` |
## Local conventions
- `commands.rs` may read session files and invoke owning command/session APIs. `history.rs` only hydrates display state; do not execute commands or write session data there.
- Picker listing and pruning run through the controller's session-maintenance worker. Keep `execute_prune_sessions_command` independent of UI state; the controller applies returned reports and rows.
- Picker rows use metadata summaries filtered to the resolved cwd scope and reverse manager ordering. Metadata and preview text are not durable session truth.
- Preserve preview scan limits in both directions, event caps, and message caps. Missing files yield empty previews; failures become compact error states.
- Partial previews must remain marked partial rather than implying that a bounded scan found the entire history.
- `preserve_critical_tui_events` retains one bounded controller-owned snapshot, discarding preview traffic. Drain retained events before the live receiver; never requeue them into the controller's own channel.
- History hydration preserves recorded timestamps and automatic-prompt provenance; it groups reasoning and restores terminal assistant text without duplicating streamed chunks.
- Keep subagent replay JSON size and hydration depth bounded. Sanitize/redact projected history and preview text before display.
## Boundary
Route switch results through the controller's request/session validation. A picker preview must never replace active session state directly.