magi-code 0.80.2

Repository-aware CLI coding agent for terminal work
Documentation
# Side agent

[Feature docs index](README.md) · [Mission Control](mission-control-tui.md)

## Open a separate conversation

Submit `/side` with no arguments in Mission Control after startup. It opens one independent conversation in a modal, including while the primary agent is running. `/side` is unavailable with `--no-session`; it is not an application-service command.

- `Enter` submits a prompt. Normal prompt editing, paste, selection, copy, scrolling, and activity inspection use the same interface as the primary conversation.
- `Esc` closes an inner modal or autocomplete first; otherwise it hides the side conversation without cancelling work. Submit `/side` again to reopen the same conversation and draft.
- `Alt-C` recalls pending side steering first; otherwise it cancels the side run, not the primary run. Primary work continues while the side modal is open.
- `/reset` is the only slash command inside the side conversation. Other slash commands and primary runtime-changing shortcuts are rejected.

The centered modal uses 60% of terminal width and height, with a small-terminal fallback. It contains only the transcript and prompt/status area: no activity or summary pane and no tab rail. Pane shortcuts cannot reveal those panes; the primary layout is unchanged.

The modal uses the exact primary transcript renderer and cards, not the shortened subagent viewer: user and assistant messages, thinking, tool status and output, and subagent activity use the same formatting and inspection controls. Its transcript, prompt, selection, scrolling, activity, usage, and context display are separate from the primary conversation.

Its welcome keeps the M mark without the word logo or command/hotkey help: "This session has no context from the main session. It keeps running in the background when closed. Use it for side tasks that don't need the main conversation." The primary welcome is unchanged.

When hidden, it shows `/side running`, `/side unread`, or `/side running • unread` at the top right as applicable. Reopening clears the unread flag.

## History and reset

The first open creates a fresh UUID session under `$MC_HOME/sessions/side/` (default `~/.magi-code/sessions/side/`). Side history is independent; it does not copy the primary transcript or add its responses to primary provider context. Side sessions keep UUID titles rather than running automatic title generation.

There is one live side conversation per process, not one per primary session. Switching or creating a primary session does not replace it. Closing the modal preserves it only for the current process lifetime. JSONL history remains on disk, but there is no side-session picker or cross-launch side resume; primary `/sessions`, `--continue`, and `--resume` do not select these nested sessions.

`/reset` retains the old session files as an archive and starts a new UUID session. It requests cancellation, waits for creation/run cleanup, reconciles pending events, and joins the old worker before replacing the session. Old MCP connections are closed off the UI thread before replacement connections open. Prompts are rejected while preparation or reset is pending; reset does not delete history or undo file changes.

## Tools and safety

Side prompts use the normal agent execution path, repository instructions, discovered skills, enabled tools, subagent profiles, hooks, and tool safety rules. They run in the same working directory, not a separate worktree or sandbox: side and primary tools can modify the same files. Coordinate edits accordingly.

Each conversation owns its session writer, worker, event queue, steering, and cancellation state. The side agent connects independently to the same enabled MCP server definitions; it does not share the primary MCP manager or live connections. Cancelling side work therefore does not cancel primary MCP work. Application exit requests cancellation and performs side cleanup as well as primary cleanup; hiding the modal is not cancellation.

## Provider and model

By default, `agent.side.provider` and `agent.side.model` are both unset. A new side session inherits the primary provider/model at creation. Later primary model changes do not switch an existing side conversation; `/reset` creates a new one using the then-current primary selection when no override is configured.

To choose a separate model, open `/settings` → **Agent settings** → **Side agent** and use its model picker. **Use primary provider/model** clears both overrides. Save with `Ctrl-S` and restart magi-code to apply changed settings; `/reset` does not reload saved settings.

The corresponding global or project settings are:

```json
{
  "schema_version": 2,
  "agent": {
    "side": {
      "provider": "openai-codex",
      "model": "gpt-5.5"
    }
  }
}
```

Configure both fields together or leave both unset. Partial pairs, blank identifiers, whitespace/control characters, and secret-looking identifiers fail validation. Credentials use the usual provider authentication, never `agent.side`. See [Configuration](configuration.md) for scope, inheritance, and model-picker behavior.

## Implementation landmarks

- `src/tui/controller/app/side.rs`: creation, independent execution state, input, cancellation, and reset.
- `src/tui/controller/app/submit.rs`: shared prompt execution with `InvocationMode::Side`.
- `src/tui/render/transcript_modal.rs`: shared conversation rendering and hidden status.
- `src/config/settings/agent.rs`: provider/model pair and validation.