magi-code 0.96.1

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

Bounded child runs with separate cwd/session/activity state and bounded results.

## Where to look

| Change | Owner |
| --- | --- |
| Dispatch/task/result shape and limits | `../subagents.rs`, `dto.rs` |
| Inheritance and canonical child cwd | `config.rs`, `cwd.rs` |
| Identity profile discovery | `profiles.rs` |
| Scheduling/waiting | `scheduler.rs` |
| Child runner/setup/results/compaction/schema | `worker.rs`, `worker/{child_agent,setup,results,compaction,schema}.rs` |
| Selected-child steering/cancellation/recall | `control.rs`, `worker.rs`, `../agent/steering.rs` |
| Activity tree and structured serialization | `activity.rs`, `output_schema.rs` |

## Local contracts

- `dto.rs` caps batches at 10 tasks and concurrency at 4; depth defaults to 2, configurable maximum 4. Check depth before scheduling and nested tool advertisement.
- Canonicalize child cwd before inherited absolute-path policy. Inherit settings/hooks/tool restrictions; identity filtering must affect provider schemas too.
- `SubagentTask.identity` selects profile; `agent` is label/persona, never inferred identity. Profiles come from `$MC_HOME/subagents/*.md`; validate IDs and reject symlinked profile files before reads.
- `mode: inspect` is independent of identity/label. Persist fixed task/tool ceiling before execution through `../sessions/task_scope.rs` and `../tools/ceiling.rs`. Summaries/steering cannot upgrade it; require a separately authorized task.
- Keep stable `gN` IDs and parent batch/task tree despite out-of-order completion. Bounded/truncated output, session references and child failures remain explicit in results.
- Controls use full activity identity including ancestry. The 64-entry registry refuses new controls instead of evicting unacknowledged input; completed controls with pending input remain recallable. Child cancellation cannot cancel parent/siblings.
- Steering uses agent continuation and durable append/acknowledgement. Pending steering precedes automatic `continue` after compaction; failed preparation releases unpersisted input for recall.
- Never widen inherited cwd/tool/time/output/task/depth bounds to make child succeed.