magi-code 0.77.1

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

This subsystem schedules child runs with separate cwd/session/activity state and bounded results.

## Where to look

| Change | Files |
| --- | --- |
| Dispatch, task/result shape, limits | `mod.rs`, `dto.rs` |
| Inheritance and child paths | `config.rs`, `cwd.rs` |
| Identity profiles | `profiles.rs` |
| Worker scheduling and waiting | `scheduler.rs` |
| Child runner and result truncation | `worker.rs` |
| Activity tree and structured output | `activity.rs`, `output_schema.rs` |
| Regressions | `tests/`, plus profile-local tests |

## Local contracts

- `dto.rs` caps tasks at 10 and concurrent workers at 4. Default depth is 2; maximum configurable depth is 4. Check depth before scheduling, including nested tool availability.
- Resolve child cwd through `resolve_child_cwd`, canonicalizing before applying the inherited absolute-path policy.
- `SubagentTask.identity` selects a profile; `agent` is only a label/persona. Do not infer identity from that label.
- Profiles come from `$MC_HOME/subagents/*.md`; validate identity ids and reject symlinked profile files before prompt reads.
- Preserve inherited settings, hooks, tool restrictions, and cancellation. Identity-selected tool filtering must also affect the child provider schema.
- Keep stable `gN` result ids and the parent batch/task activity tree even when workers finish out of order.
- Preserve bounded output, truncation markers, session references, and structured-output serialization. A child's failure must remain visible in the batch summary.
- Do not widen inherited cwd, tool, time, output, task, or depth limits to make a child succeed.