4.1 KiB
Child Lifecycle
Read before multi-round coordination, cancellation, or capacity diagnosis. Names below describe control intent; use only the tools and states the host actually exposes.
| Situation | Action | Evidence needed |
|---|---|---|
| Independent authorized slice ready | Spawn with explicit ownership and supported route | Real child ID; requested settings |
| Child running, facts changed | Send a small incremental message | Tool acknowledgement; later child result |
| Child idle, more scoped work needed | Follow up with the same child | Reactivation/result; keep prior evidence |
| Parent has independent work | Continue it | No unnecessary polling |
| Parent depends on child | Bounded wait | New output/state; timeout means only no update |
| Cancelled, superseded, overlapping writes | Interrupt affected children, including descendants if needed | Query resulting states; inspect partial writes |
| Child returned output | Review evidence, diff and relevant checks | Acceptance separate from runtime completion |
| Capacity exhausted | Inspect actual active/open states and reuse eligible children | Host-specific capacity semantics |
| Final delivery | Audit tree and assigned files | No unneeded running writer; accepted or explicit gaps |
A minimal ledger records child ID, P/C classification, file/semantic ownership, dependency, requested route, last observed state and acceptance. Do not invent timestamps, identities or close events.
Steering and pending tools
On a correction, update the affected contract and preserve unaffected evidence. Sending an incremental message does not establish that a running child or tool has adopted it. If its writes now conflict, interrupt through available controls, verify the state and inspect partial changes before transferring ownership. Review late results against the current contract and baseline; do not integrate them merely because they completed successfully.
Keep required async tool jobs in the same dependency view as children, using their actual job/session/call IDs. While waiting, advance independent work; before dependent acceptance, collect the real result. Steering and child interruption need not cancel external jobs. Cancel obsolete jobs through the host when supported, otherwise track/report the remaining state. Never resubmit a potentially mutating call solely because its receipt is delayed.
After context compaction, recover objective, permissions, owners, pending IDs and accepted evidence before dispatching more work. Detailed API-versus-host limits are in GPT-6 adaptation.
For rolling execution, use fleet scheduling: refill ready work after useful handbacks and dependency changes, rather than waiting for every sibling. Check integration backlog before starting more implementation. Task readiness, output acceptance and actual slot availability remain separate facts.
Cancellation and handback
Interrupting does not undo files or guarantee descendant cancellation. First preserve useful returned evidence, stop affected writers, inspect partial changes, then assign the remaining work to one owner. Never reset shared files wholesale.
A budget/deadline in a contract is not a runtime timeout. Use host-supported nonblocking waits and control calls; check deadlines at checkpoints. A wait returning no update does not prove failure, completion or a stuck process.
For missing data, permissions or same-class failures twice, stop the affected slice and report the smallest gap. Resume with a delta when resolved rather than spawning a duplicate investigation.
Completion versus closure
Output returned, runtime completed, parent accepted, thread closed and slot released are separate facts. The host may combine some of them, but never assume that it does.
If close exists, use it according to host semantics when no longer needed. If it does not, completed/idle is a valid terminal handback; do not require a fictional close to finish. If capacity remains unavailable, reuse a supported idle child or proceed locally.
Final review must also check descendants and pending writes. If any ongoing work is intentionally retained, report its owner and reason.