Skip to content

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

Merged
juliusmarminge merged 2 commits into
t3code/codex-turn-mappingfrom
fix-subagent-lifecycle-status
Sep 22, 2026
Merged

juliusmarminge merged 2 commits into
t3code/codex-turn-mappingfrom
fix-subagent-lifecycle-status

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Sep 22, 2026

Copy link
Copy Markdown
Member

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 waiting After: idle child is settled
Before: false background wait for an idle child After: false background wait is removed
Before: settled rows display task age After: unknown durations are hidden, known duration remains 20s
Before: settled agents show their age as elapsed work After: settled agents only show known elapsed work

Recording of the timer correction

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

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Sep 22, 2026
Comment thread apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.ts
@github-actions

github-actions Bot commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

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

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire 4.9 KiB 6.8 KiB
Codex Thread snapshot wire 3.7 KiB 4.9 KiB
Codex Live turn WebSocket wire 1.2 KiB 2.0 KiB
Codex Live turn WebSocket decoded 20.4 KiB 29.3 KiB
Codex Live turn messages 2 8
Claude Total thread wire 4.9 KiB 6.8 KiB
Claude Thread snapshot wire 3.7 KiB 4.9 KiB
Claude Live turn WebSocket wire 1.2 KiB 2.0 KiB
Claude Live turn WebSocket decoded 20.8 KiB 29.3 KiB
Claude Live 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.

@macroscopeapp

macroscopeapp Bot commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

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.

@juliusmarminge
juliusmarminge merged commit 2341c5a into t3code/codex-turn-mapping Sep 22, 2026
25 of 26 checks passed
@juliusmarminge
juliusmarminge deleted the fix-subagent-lifecycle-status branch September 22, 2026 02:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant