# Mission Control agent guide
Mission Control connects terminal input, worker events, and display projections. Non-interactive clients use `../service/`.
## Where to look
| Entry, event variants, send helpers | `mod.rs` |
| Output sink and delivery classification | `events/mod.rs`, `events/delivery.rs` |
| Terminal restoration and graphics | `terminal.rs`, `terminal/` |
| Loop, input capture, pacing, worker reconciliation | `controller/`, `worker.rs` |
| Semantic input, display state, drawing | `input/`, `state/`, `render/` |
| Session picker and hydration | `sessions/` |
| Transcript storage, cards, selection projection | `transcript.rs`, `transcript_cards/`, `transcript_projection.rs` |
| Diff page and refresh/save worker | `diff.rs`, `diff/render.rs`, `diff/worker.rs` |
| Settings drafts and shared geometry | `settings_editor.rs`, `settings_editor/render.rs` |
| Usage recording and quota | `session_usage.rs`, `usage.rs`, `controller/app/codex_quota.rs` |
| Side conversation and shared modal | `controller/app/side.rs`, `render/transcript_modal.rs` |
| Child prompt editing and runtime controls | `controller/app/subagent_prompt.rs`, `../subagents/control.rs` |
| Image previews | `images.rs`, `terminal/graphics.rs` |
| Prompt editing, completion, selection | `prompt_editor.rs`, `single_line_field.rs`, `autocomplete.rs`, `selection.rs` |
| Initial agent screen | `screens/primary_agent_startup.rs` |
| First-launch release notes and paging | `release_notes.rs`, `render/transcript/welcome.rs`, `../../docs/features/release-notes.md` |
## Local contracts
- The main event channel holds 1024 events. Best-effort previews reserve 64 slots when capacity permits; critical sends use bounded waits and report failure. Keep synchronous delivery and worker-outcome reconciliation when final delivery fails.
- Record usage starts and snapshots before event delivery; reconcile worker usage before folding completed runs. Totals outlive transcript/activity retention.
- `/settings` retains scoped drafts, saves changed paths, and requires restart. Model availability belongs in Settings → Models; `/models` is retired. `/model` uses cache only, even when stale or missing; explicit refresh retains completion outside the wake queue.
- `/side` has its own session, worker, events, steering, and MCP connections but shares prompt execution and the primary renderer. Hiding does not cancel. Reset reconciles and joins old work before replacement and closes old MCP connections off-thread. Side history stays outside primary selection; only `/reset` is accepted inside the modal.
- Diff replaces the body but retains Prompt and the rail. Git reads and comment saves belong in `diff/worker.rs`; worktree comment storage belongs in `../diff_review/`.
- `TranscriptEntries` owns row ids, timestamps, activity links, and revisions. Move the whole store during hydration and decode historical tool text at ingestion. History indexes are lazy and width-specific; streaming cache reuse must preserve final Markdown and width/theme/focus invalidation.
- Image references are untrusted. The bounded preview worker reuses `tools.view_image` path policy with separate decode limits. Drawing records visible rows; the controller requests them. Kitty writes/cleanup belong to the terminal owner, never transcript or copy text; unsupported terminals and multiplexers remain text-only.
- Child drafts stay separate from the primary prompt. The viewer uses skill-only completion, rejects slash commands, and treats `!` literally. Steering/cancellation use runtime controls. Completed children are read-only except pending-input recall; pending child steering blocks a new primary run.
- `perf.rs` measures scroll apply-to-successful-draw time, not input queue wait or physical display latency.
- Terminal restoration must cover errors and panics. Use the owning module's existing tests and inherited verification commands.