codex - 💡(How to fix) Fix Multi-agent subagent notifications leak into the main chat as raw JSON assistant messages [2 comments, 3 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openai/codex#17523Fetched 2026-04-12 13:27:07
View on GitHub
Comments
2
Participants
3
Timeline
5
Reactions
0
Author
Timeline (top)
labeled ×3commented ×2
RAW_BUFFERClick to expand / collapse

What version of Codex CLI is running?

codex-cli 0.120.0

What subscription do you have?

Pro

Which model were you using?

gpt-5.4

What platform is your computer?

Darwin 24.6.0 arm64 arm

What terminal emulator and version are you using (if applicable)?

Ghostty

What issue are you seeing?

Subagent completion/mailbox traffic is leaking into the main chat transcript as raw JSON assistant messages. This message leak also causes agent turn to end and wait for user input.

Example of what shows up in the main chat:

{"author":"/root/task1_spec_review_rerun","recipient":"/root","other_recipients":[],"content":<subagent_notification>\n{"agent_path":"/root/task1_spec_review_rerun","status":{"completed":"SPEC_PASS ..."}}\n</subagent_notification>","trigger_turn":false}

What steps can reproduce the bug?

This appears when using subagents, but not always. Latest release made it much more frequent.

Here is a session where this behaviour appeared multiple times: thread ID 019d8094-a19c-7372-8e3c-a61a44ad4571

What is the expected behavior?

Multi-agent workflows should continue to work, but internal subagent notifications / mailbox messages should not be rendered into the main user-facing chat as raw JSON.

Additional information

This looks like a regression.

There appear to be two relevant changes:

  1. 773fbf56a4 on 2026-03-24, feat: communication pattern v2 (#15647)
    • This appears to be the bug-enabling change.
    • Subagent completion notices that were previously hidden user-fragment notifications started being sent on the MultiAgentV2 path as InterAgentCommunication assistant envelopes.
  2. e4f1b3a65 on 2026-04-03, Preempt mailbox mail after reasoning/commentary items (#16725)
    • This appears to be the recent change that made the problem much more visible/frequent.
    • It preempts for pending mailbox mail after reasoning/commentary items, which seems to surface these assistant envelopes much more often.

extent analysis

TL;DR

Reverting or modifying the changes introduced in commits 773fbf56a4 and e4f1b3a65 may resolve the issue of subagent completion/mailbox traffic leaking into the main chat transcript.

Guidance

  • Review the changes made in commit 773fbf56a4, specifically the implementation of communication pattern v2, to ensure that subagent completion notices are properly handled and not sent as InterAgentCommunication assistant envelopes.
  • Investigate the effects of commit e4f1b3a65, which preempts mailbox mail after reasoning/commentary items, and consider modifying or reverting this change to prevent the surfacing of unwanted assistant envelopes.
  • Verify that the issue is resolved by testing multi-agent workflows and checking that internal subagent notifications are not rendered into the main user-facing chat as raw JSON.
  • Consider adding logging or debugging statements to track the flow of subagent completion notices and mailbox messages to better understand the issue and identify potential fixes.

Notes

The provided information suggests that the issue is a regression caused by recent changes, but without more context or code, it is difficult to provide a definitive solution. Further investigation and testing are necessary to determine the root cause and develop a reliable fix.

Recommendation

Apply workaround: Revert or modify the changes introduced in commits 773fbf56a4 and e4f1b3a65, as these appear to be the primary causes of the issue. This should help prevent subagent completion/mailbox traffic from leaking into the main chat transcript.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

codex - 💡(How to fix) Fix Multi-agent subagent notifications leak into the main chat as raw JSON assistant messages [2 comments, 3 participants]