fix(orchestration): settle subagent statuses and activation timers - #12974
Conversation
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: unavailable · PR result: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This PR changes production orchestration lifecycle semantics across three provider adapters, server event routing, background-work settlement, and web/mobile timers. Because it alters when work is considered settled and when subscriptions or parent runs stop waiting, the cross-component runtime impact requires human review. You can add or adjust custom eligibility rules. Learn more. |
2341c5a
into
t3code/codex-turn-mapping
Subagents could remain running or keep their parent waiting after their work settled. Late Codex snapshots could reopen completed agents, resumes kept old start times, and settled client rows without completion timestamps displayed their age as work duration.
Use one active-work predicate for pending, running, and waiting across ingestion, delegated progress, background-work lists, and client timers. Normalize every Codex native status, accept known-child completion after the parent finishes, and require a native child turn to reopen a settled agent. Resumes reset activation timing and route the roster to the current parent run. Claude and Cursor preserve the first completion timestamp. Cursor settles task rows with missing completion events when the SDK interaction ends, using idle for an unknown successful-run outcome.
Targets the orchestrator branch behind #2829.
Validation: 380 focused tests plus 76 settlement and orchestrator replay checks pass across the three changed adapters, run ingestion, delegated progress, background-work derivation, timing, and the client roster. Server, web, and mobile typechecks pass. Scoped lint passes with existing unused-variable warnings. React Doctor found no errors in the changed timer components. Web verification used synthetic worktree state; native mobile was typechecked but not exercised.
CI blocker:
SelectionRestart.integration.test.tsfails with “selection restart did not complete” on both this branch and the unchanged base (7ed0d882c23), reproduced in an isolated base checkout. The subagent-related CI failures are fixed. All other executed CI checks pass. Macroscope correctness passes with no unresolved findings; its approvability check requires human review because this change spans provider lifecycle, server settlement, and client timers.Client evidence
Matching synthetic data and 1280 × 800 viewport. The status pair runs the base and head. The timer pair uses the actual base and head timer component in the same client state.
Recording of the timer correction
Model: GPT-6-Astra. Harness: Codex.