Repository navigation
Analytics drops late subagent activity after parent turn has already terminated #43221
Description
Affected version
Windows Codex Desktop OpenAI.Codex 26.901.5280.0, bundled codex-cli 0.153.4.
Summary
In a completed multi-agent session, a child subagent finished after the parent turn that spawned/waited on it had already terminated on a usage limit. The child's FINAL_ANSWER was delivered while the parent thread had started a new turn.
Codex accepted the inter-agent communication and continued normally, but codex_analytics::reducer emitted:
dropping sub-agent activity tool count update: missing turn state
with the old terminated parent turn id.
This appears to lose the collaboration/subagent tool-count analytics for a valid late child completion.
Observed ordering
- Parent thread has turn A running with a subagent.
- Turn A terminates (in this reproduction because of a usage-limit error).
- Parent thread starts turn B.
- The child finishes and sends
FINAL_ANSWERback to the parent path. - Codex logs receipt of
InterAgentCommunicationfrom the child during turn B. - The analytics reducer immediately warns that it is dropping the sub-agent activity tool-count update because turn A's state is missing.
- Turn B continues and completes normally.
The warning in this reproduction referenced turn A, not the currently running turn B.
Impact
I did not observe an execution failure from this warning. The impact appears limited to analytics correctness: a legitimate late subagent activity/tool-count update is discarded after the originating parent turn has already been evicted from reducer state.
Current source
The current default branch still contains this explicit warning-and-return path in codex-rs/analytics/src/reducer.rs:
tracing::warn!(
thread_id = %notification.thread_id,
turn_id = %notification.turn_id,
"dropping sub-agent activity tool count update: missing turn state"
);
return;So this does not appear specific to the installed 0.153.4 binary.
Expected behavior
Late subagent activity that is still valid and delivered to the parent thread should either:
- retain enough terminal turn metadata to attribute the collaboration tool count to its originating turn, or
- be attributed through a defined late-event path without silently losing the count.
At minimum, the reducer should have regression coverage for a subagent activity notification arriving after the originating parent turn has completed/failed but while the parent thread remains active.
Additional notes
- The child result itself was delivered successfully; this report is specifically about analytics reduction.
- I searched for the exact warning text in open/closed issues and found no matching report.
- No private prompt, repository content, credentials, or user data is included here.
Activity