openai / openai/codex

MCP tool results lose content when structuredContent is present (Codex App 26.803.81509)

Open
#38,287 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

app bug mcp tool-calls
Dominant language
Rust
Stars
125k
Forks
19.5k
PR merge metrics
PR metrics pending

Description

What version of the Codex App are you using (From “About Codex” dialog)?

26.803.81509 (build 6415) Also reproduced on 26.803.61601 (build 6396). After downgrading to 26.803.41515 (build 6321), the issue no longer reproduces.

What subscription do you have?

plus

What platform is your computer?

Darwin 24.6.0 arm64 arm

What issue are you seeing?

MCP tool call results lose their visible text (the content array) whenever the
result also contains structuredContent. The transcription layer that converts
MCP tool results into the assistant-visible function call output keeps only
structuredContent and drops content entirely.

Example: the built-in node_repl/js MCP server returns
content: [{"type":"text","text":"REINSTALL_TEST 1786582832541"}]
structuredContent: {"execution_duration_ms":0}
but the conversation only receives {"execution_duration_ms":0}. The text block
is never visible to the assistant. Code still executes and side effects still
happen, so this is purely an output-transcription bug.

Session evidence (rollout logs in ~/.codex/sessions/2026/08/12/, same call_id):

  • mcp_tool_call_end (raw JSON-RPC result received from the MCP server):
    {"Ok": {"content": [{"type": "text", "text": "REINSTALL_TEST 1786582832541"}],
    "structuredContent": {"execution_duration_ms": 0}, "isError": false}}
  • function_call_output (what is actually sent to the model):
    Output: {"execution_duration_ms":0}
    So content is complete on the server side and lost in the app-side transcription.
What steps can reproduce the bug?
  1. In any Codex session, call the built-in node_repl/js MCP tool with:
    nodeRepl.write("x");
  2. The tool executes fine, but the conversation only sees
    {"execution_duration_ms":0} instead of "x".
  3. In the same session, node_repl/js_reset returns normally (it has no
    structuredContent field), which shows the bug only triggers when
    structuredContent is present.
  4. Connecting directly to the node_repl binary over stdio
    (initialize -> notifications/initialized -> tools/call) returns the full
    content, confirming the MCP server itself is healthy.
What is the expected behavior?

content (the primary output per the MCP spec) should be preserved when
transcribing MCP tool results. structuredContent is an optional extra field
and should be merged with, or ignored in favor of, content.

Additional information
  • The regression appeared between build 6321 (26.803.41515, Aug 7) and build
    6396 (26.803.61601, Aug 10): the newer node_repl starts attaching
    structuredContent to js responses, which triggers the bug. Downgrading to
    26.803.41515 makes it disappear.
  • Affects every tool routed through this MCP server, including the
    computer-use/@oai/sky underlying channel.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the transcription path from mcp_tool_call_end to the function_call_output shown in the rollout logs, then reproduce the issue with the built-in node_repl/js tool using nodeRepl.write("x"). Done means the assistant-visible output preserves the content text when structuredContent is also present; verify that node_repl/js_reset remains unaffected and add or run a regression test if the relevant test location is found.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.