Repository navigation
Description
Sage task T65
Parent tracking issue: #88.
A native spawn rejected at the agent capacity limit can leave its Sage reservation occupied. The existing authenticated failure reader accepts only unknown-model preflight rejection and requires a model argument. This excludes the native capacity rejection even when no child started.
Outcome
Recognize the exact supported native preflight result collab spawn failed: agent thread limit reached through the existing dispatch-failure reader. Reconcile only the rejected reservation, preserve existing children and history, and permit eligible later work. Do not broaden recovery to arbitrary error strings or ambiguous execution failures.
Acceptance
- Preserve session, owner epoch, issuer, transcript, turn, call and argument-hash verification.
- A matching child-start, spawn-result, binding, conflicting result or ambiguous record must prevent this recovery path.
- Support a capacity rejection when the spawn request inherits its model and has no explicit model argument.
- Repeated reconciliation changes nothing after the first exact failure receipt. Late binding cannot revive the failed assignment.
- Keep the existing unknown-model behavior and its tests.
- Add deterministic identity, changed/forged/duplicate result, history and capacity controls. Prove the new behavior fails on detached main.
- Use an actual supported native CLI with cap one and Sage cap two. Hold the first child; reject the second; reconcile only its reservation; finish the first; then complete a fresh eligible retry. Label simulated model responses and verify cleanup.
Source and ownership
The pinned CLI0.160.0 source checks capacity before child creation:
- https://github.com/openai/codex/blob/rust-v0.160.0/codex-rs/core/src/agent/control/execution.rs
- https://github.com/openai/codex/blob/rust-v0.160.0/codex-rs/core/src/agent/control/spawn.rs
- https://github.com/openai/codex/blob/rust-v0.160.0/codex-rs/core/src/tools/handlers/multi_agents_common.rs
Verify these boundaries and the archived native result before implementation. Codex owns this unit. Do not edit Claude PR #140 active bodies. Use the existing consumed failure route; no new orchestration API is required. Required-hook failure handling, active-child restart, cross-session transfer, and installed automatic Sage remain separate work.
Run build/check/full suite with fake process commands first on PATH. Require two clean independent code/security/QA cycles and exact-head CI before merge.
Activity