Skip to content

Analytics drops late subagent activity after parent turn has already terminated #43221

Open

Description

@PracticalSwan

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

  1. Parent thread has turn A running with a subagent.
  2. Turn A terminates (in this reproduction because of a usage-limit error).
  3. Parent thread starts turn B.
  4. The child finishes and sends FINAL_ANSWER back to the parent path.
  5. Codex logs receipt of InterAgentCommunication from the child during turn B.
  6. The analytics reducer immediately warns that it is dropping the sub-agent activity tool-count update because turn A's state is missing.
  7. 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

  1. added
    bugSomething isn't working
    appIssues related to the Codex desktop app
    subagentIssues involving subagents or multi-agent features
    on Sep 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    appIssues related to the Codex desktop appbugSomething isn't workingsubagentIssues involving subagents or multi-agent features

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions