Getting responses in JSON

Resolved 💬 3 comments Opened Apr 13, 2026 by budivoogt Closed Apr 13, 2026
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

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 25.1.0 arm64 arm

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

Ghostty in Cmux

What issue are you seeing?

Model responds to me in JSON, as if it forgot to sanitize the response.

What steps can reproduce the bug?

Uploaded thread: 019d8528-7284-7531-a593-bc77b03938f2

What is the expected behavior?

_No response_

Additional information

_No response_

View original on GitHub ↗

3 Comments

github-actions[bot] contributor · 4 months ago

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

  • #17523
  • #16565

Powered by Codex Action

etraut-openai contributor · 4 months ago

@jif-oai, here's some details provided by codex:

Thanks for the bug report. I inspected the uploaded parent rollout plus the related subagent rollouts. This looks like a MultiAgentV2/inter-agent notification leak rather than a user instruction or JSON-mode issue.

The parent thread spawned multiple subagents. The subagents’ own rollouts completed normally with regular prose final answers. However, the parent rollout later recorded assistant-role messages whose text was a serialized inter-agent envelope with fields like:

  • author
  • recipient
  • other_recipients
  • content
  • trigger_turn

The content field wrapped a <subagent_notification> payload containing the subagent completion. One of these serialized envelopes then became the parent thread’s visible final_answer.

Concretely, the failure pattern is:

  1. A subagent completes normally in its own thread.
  2. The parent receives/records an internal subagent completion notification.
  3. That notification is represented as an assistant message containing serialized JSON.
  4. The parent’s user-visible final answer becomes that serialized inter-agent notification instead of a synthesized response.

I did not see evidence that this was caused by final_output_json_schema, response_format, or user/developer instructions asking the model to emit JSON. The JSON shape matches the inter-agent communication envelope, not arbitrary model output.

This appears to be in the same family as the earlier reports about raw subagent notifications leaking into chat. The likely handoff area is the MultiAgentV2/inter-agent mailbox path: internal InterAgentCommunication / subagent notification payloads are reaching assistant-visible or user-visible transcript paths, where they can be rendered directly or contaminate the next model turn.

jif-oai contributor · 4 months ago

Multi-agent v2 is not meant to be used right now. Models are not trained yet to use it
Are you enabling the feature @budivoogt ? Can you /feedback and give me the session ID please?