Result of the wait_agent same as the subagent_notification user message

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

What version of Codex CLI is running?

v0.115.0-alpha.22

What subscription do you have?

free

Which model were you using?

gpt-5.2

What platform is your computer?

_No response_

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

_No response_

What issue are you seeing?

Why is the result of the wait_agent tool in multi-agent the same as the subagent_notification user message? Is this duplication, or is it designed this way by intention?

[{
		"type": "function_call",
		"name": "wait_agent",
		"arguments": "{\"ids\":[\"019cea74-0bfe-7ac1-95a5-ea8bdd40be68\"],\"timeout_ms\":180000}",
		"call_id": "call_vtF4B9BTVGkLPLUtOefxS2X2"
	}, {
		"type": "function_call_output",
		"call_id": "call_vtF4B9BTVGkLPLUtOefxS2X2",
		"output": "{\"status\":{\"019cea74-0bfe-7ac1-95a5-ea8bdd40be68\":{\"completed\":\"xxxxx\"}},\"timed_out\":false}"
	}, {
		"type": "message",
		"role": "user",
		"content": [{
			"type": "input_text",
			"text": "<subagent_notification>\n{\"agent_id\":\"019cea74-0bfe-7ac1-95a5-ea8bdd40be68\",\"status\":{\"completed\":\"xxxxx\"}}\n</subagent_notification>"
		}]

What steps can reproduce the bug?

let ai run explore subagent

What is the expected behavior?

_No response_

Additional information

_No response_

View original on GitHub ↗

3 Comments

github-actions[bot] contributor · 5 months ago

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

  • #13947
  • #12921
  • #14318

Powered by Codex Action

cipher982 · 4 months ago

I can confirm this duplication is confusing in real debugging.

In my session:

  • wait_agent returned the completed child payload
  • the parent thread also received the same payload as a <subagent_notification> user message later

that made it harder to distinguish:

  • “child actually finished”
  • “parent consumed the result”
  • “notification merely landed in history”

In my case, the duplicate notification itself was not the root bug, but it made the parent/child lifecycle much harder to reason about while debugging multi-agent runs.

caozhiyuan · 4 months ago

@cipher982 @etraut-openai This would lead to wasted context windows, as each subagent's result exists in duplicate within the input.