magi-code 0.97.6

Repository-aware CLI coding agent for terminal work
Documentation
# Select a local-agent model

Model discovery and selection are separate from sending a prompt. The backend supplies available choices and permitted reasoning levels; the client must not infer them from model names.

## Read and select

1. Negotiate `model.catalog` and `selection.set`, plus the session and status operations you use.
2. Read every catalog page. Keep its revision separate from selection and history revisions.
3. Attach the exact session and read its current selection from `status`.
4. Submit the chosen provider/model and both revision guards through `selection.set`.
5. Use the returned selection and durable acknowledgement. Only an explicit `turn.start` submits a prompt.

For effort, `keep` preserves the requested level, `default` removes an explicit override, and `set` chooses a listed level. Unknown or unsupported controls do not authorize guessed values.

## Recover deliberately

- Stale catalog: read a new catalog and status.
- Stale selection or session: reconcile the current attachment and status.
- Persistence failure: reopen the exact session to inspect the durable result. Do not retry an uncertain mutation automatically.
- Missing remote models: explicitly negotiate and call `model.refresh`; reading a catalog alone never refreshes it.

Selection belongs to the session, not global settings. Busy or rejected changes do not queue a later mutation. After changing settings outside the child, restart it.

See [catalog and selection contracts](local-agent-protocol.md#providermodel-catalog-and-deliberate-selection), [refresh extensions](local-agent-extensions.md), and [archived selection observations](../archive/local-agent-selection-handoff.md).