You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Codex subagent terminal statuses fall through to running in orchestrator v2 #11164
While reviewing issue #8499, I found that PR #2829 already fixes the reported registration problem. The completed spawnAgent event exposes the child thread ID through receiverThreadIds, the PR registers it, and the adapter also handles the newer subAgentActivity path while buffering child turns that arrive before registration.
I verified those paths against Codex CLI rust-v0.150.1, the version reported in #8499, and the latest openai/codex main branch.
During that review, I found a separate bug in updateSubagentStates. It checks for failed, cancelled, and closed, but Codex never sends those values. Several real Codex statuses therefore fall through to running:
Codex status
Current T3 status
pendingInit
running
running
running
interrupted
running
completed
completed
errored
failed
shutdown
running
notFound
running
The effects are:
An interrupted child continues to appear active.
A shut-down child remains running, with no completion timestamp.
A missing child remains active even though Codex can no longer find it.
A child that is still initializing appears to be executing.
This is not a later Codex protocol change. T3’s generated Codex schema already contained these statuses when the mapper was introduced in cc5967e2.
Impact
Major degradation or frequent failure
Version or commit
PR #2829 at 89459e384ad7ffa3b9dda613e9cfebf32a8979e1
Environment
Tested Codex CLI rust-v0.150.1 and openai/codex main at 28f43b0417ab19632f7e53d17806b98151d6b9a0
Confirmed. This is a real mapper bug on orchestrator v2, not a protocol change and not a duplicate of #8499.
updateSubagentStates in apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.ts (PR #2829 @ 89459e38) compares Codex agentsStates.status against T3-internal values (failed, cancelled, closed) that Codex never sends. The generated CollabAgent union has been pendingInit | running | interrupted | completed | errored | shutdown | notFound since the mapper was added in cc5967e2, matching Codex AgentStatus.
Current fall-through:
Codex
T3 today
Should be
pendingInit
running
pending
running
running
running
interrupted
running
interrupted
completed
completed
completed
errored
failed
failed
shutdown
running
cancelled
notFound
running
failed
Effects match the report: initializing children look like they are executing; interrupted / shut-down / missing children stay running and never get completedAt (emitSubagentTaskUpdate only stamps terminal statuses).
The subAgentActivitykind === "interrupted" path is already correct. The broken path is collabAgentToolCall → updateSubagentStates. There is no agentsStates coverage in CodexAdapterV2.test.ts.
#8499 is the registration/visibility issue. #2829 already registers receiverThreadIds; that does not fix this status map. Keep both open.
Next step: land an exhaustive CollabAgent-status switch plus per-status tests on #2829 before relying on Codex subagent lifecycle in v2.
Fixed by merged PR #12974 (supersedes open #11996), which normalizes every Codex native subagent status in the orchestrator v2 adapter. Closing as completed.
Before submitting
Area
apps/server
Steps to reproduce
notFound.This can also be reproduced directly by passing each Codex collaboration status through
updateSubagentStates.Expected behavior
T3 should translate each Codex status into the corresponding internal status:
pendingInitpendingrunningrunninginterruptedinterruptedcompletedcompletederroredfailedshutdowncancellednotFoundfailedThese are the statuses in Codex’s current
AgentStatusdefinition.Actual behavior
While reviewing issue #8499, I found that PR #2829 already fixes the reported registration problem. The completed
spawnAgentevent exposes the child thread ID throughreceiverThreadIds, the PR registers it, and the adapter also handles the newersubAgentActivitypath while buffering child turns that arrive before registration.I verified those paths against Codex CLI
rust-v0.150.1, the version reported in #8499, and the latestopenai/codexmain branch.During that review, I found a separate bug in
updateSubagentStates. It checks forfailed,cancelled, andclosed, but Codex never sends those values. Several real Codex statuses therefore fall through torunning:pendingInitrunningrunningrunninginterruptedrunningcompletedcompletederroredfailedshutdownrunningnotFoundrunningThe effects are:
running, with no completion timestamp.This is not a later Codex protocol change. T3’s generated Codex schema already contained these statuses when the mapper was introduced in
cc5967e2.Impact
Major degradation or frequent failure
Version or commit
PR #2829 at
89459e384ad7ffa3b9dda613e9cfebf32a8979e1Environment
Tested Codex CLI
rust-v0.150.1andopenai/codexmain at28f43b0417ab19632f7e53d17806b98151d6b9a0Created using GPT-5.6-Sol