magi-code 0.80.0

Repository-aware CLI coding agent for terminal work
Documentation
# Session display agent guide

## Where to look

| Task | Location |
| --- | --- |
| Module facade | `mod.rs` |
| Picker rows, preview reads, command workflows | `commands.rs` |
| Listing/pruning worker and result application | `../controller/app/session_maintenance.rs` |
| Recorded events to display state | `history.rs` |

## Local contracts

- `commands.rs` may read session files and call owning command/session APIs. `history.rs` only hydrates display state; do not execute commands or write session data there.
- Listing/pruning use the controller's session-maintenance worker. Keep `execute_prune_sessions_command` independent of UI state; the controller applies reports and rows.
- Picker rows reverse manager ordering and filter metadata summaries to the resolved cwd scope. Ownership hints have a separate read cap; `unknown` hints must not prevent switching.
- Preserve forward/recent preview scan, event, and message limits. Missing files yield empty previews; failures become compact error states. Mark partial scans as partial.
- `preserve_critical_tui_events` retains at most one 1024-event snapshot, excluding previews. The controller drains it before live events; never requeue it into the same channel.
- Hydration preserves recorded timestamps and automatic-prompt provenance, groups reasoning, and restores final assistant text without duplicating streamed chunks.
- Keep subagent replay JSON size and hydration depth bounded; sanitize/redact projected history and preview text.
- Switch results go through controller request/session validation. Picker previews must never replace active session state directly.