Issue: <subagent_notification> duplicates finished wait_agent result

Open 💬 3 comments Opened May 23, 2026 by janbam
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

Issues:

  1. Duplication
  2. Codex is confused about the <subagent_notification> appearing in the message channel, wondering if it's a user message

<img width="1009" height="1061" alt="Image" src="https://github.com/user-attachments/assets/f5ca0184-4868-4045-b2e0-d9e6ee951fc4" />

View original on GitHub ↗

3 Comments

github-actions[bot] contributor · 3 months ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #23821
  • #23174

Powered by Codex Action

janbam · 3 months ago

not a duplicate of those two issues. they resulted in app errors and corrupted the session; mine did not.
and i did not have the multi_agent_v2 feature enabled

mading0817 · 2 months ago

I can reproduce this in thread 019edce6-71ad-71a1-91f3-54c49a576d6b.

This was reproduced with the built-in explorer agent, not a custom project agent.

Repro shape:

  1. Spawn a built-in explorer with fork_context=false.
  2. Ask it to perform a real read-only code investigation and include a unique marker in its final answer.
  3. Call wait_agent.
  4. Observe the later <subagent_notification>.
  5. Call close_agent.

Observed:
The exact same final message appeared in all three parent-visible channels:

  • wait_agent returned status.completed
  • <subagent_notification> later delivered the same status.completed
  • close_agent returned the same payload in previous_status.completed

Impact:
A subagent final answer that should occupy one unit of parent context can occupy roughly three copies plus wrapper overhead. This is especially costly when the child result is an explorer summary, verification summary, or asset evidence report.

Expected:
Completion payload should have single-consumption semantics, or close_agent should support return_status=false, or wait_agent should be able to consume/suppress the later duplicate notification. At minimum, docs should recommend returning only a tiny result handle/ack from subagents and storing larger results externally.