Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(orchestration): settle subagent statuses and activation timers #12974

Mergedjuliusmarmingemerged 2 commits intot3code/codex-turn-mapping fromrefs/pull/12974/headmerged by juliusmarminge View on GitHub

juliusmarmingecommented

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.ts fails 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.

Before: idle child keeps parent waitingAfter: idle child is settled
Before: false background wait for an idle childAfter: false background wait is removed
Before: settled rows display task ageAfter: unknown durations are hidden, known duration remains 20s
Before: settled agents show their age as elapsed workAfter: settled agents only show known elapsed work

Recording of the timer correction

Model: GPT-6-Astra. Harness: Codex.

    1. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted

    2. github-actions[bot](GitHub profile, opens in a new tab)commented

      Thread transfer impact

      ✅ Thread transfer remains within every enforced ceiling.

      ℹ️ No successful main baseline artifact is available yet. This run establishes the initial measurement.

      ProviderMetricMain baselineThis PRImpactPR ceiling
      CodexTotal thread wire—4.9 KiB—6.8 KiB✅
      CodexThread snapshot wire—3.7 KiB—4.9 KiB✅
      CodexLive turn WebSocket wire—1.2 KiB—2.0 KiB✅
      CodexLive turn WebSocket decoded—20.4 KiB—29.3 KiB✅
      CodexLive turn messages—2—8✅
      ClaudeTotal thread wire—4.9 KiB—6.8 KiB✅
      ClaudeThread snapshot wire—3.7 KiB—4.9 KiB✅
      ClaudeLive turn WebSocket wire—1.2 KiB—2.0 KiB✅
      ClaudeLive turn WebSocket decoded—20.8 KiB—29.3 KiB✅
      ClaudeLive turn messages—2—8✅

      Baseline: unavailable · PR result: 4965173 · Source CI: failure

      Scenario and decoded snapshot size

      10 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.

      • Codex decoded thread snapshot: 106.1 KiB
      • Claude decoded thread snapshot: 106.4 KiB

      Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

    3. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: 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](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    4. juliusmarminge merged this2341c5a

    5. juliusmarminge closed this

Sign in to join this conversation.