MCP tool responses truncated after 10 KiB/256 lines (regression in v0.56+)
What version of Codex is running?
0.56+
What subscription do you have?
Pro
Which model were you using?
gpt-5-codex on high
What platform is your computer?
MacOs
What issue are you seeing?
Summary
Since Codex v0.56 (commit 1c8507b32a1b880283d89546db6b510a03a0d935 /
PR #5979), every tool call’s text payload—built-in or MCP—is capped
to ~10 KiB or 256 lines before the model sees it. This is on top
of the earlier stdout/stderr head+tail truncation introduced in
957d44918d334e89473b9abad14df96f843a19aa. As a result, long MCP
responses (Linear issues, Context7 research briefs, etc.) are silently
chopped in the middle, breaking agent flows.
## Impact
- Retrieval tools (Context7, custom MCP research agents) drop the bulk
of their summaries; Codex only ingests snippets.
- Linear MCP issues/PRDs can’t be read end-to-end, so agents miss
requirements and plans.
- Build/test logs or migration scripts streamed via tool calls lose
their middle sections, forcing repeated paging.
Pinning to ≤ 0.49 restores full-context tool usage.
Expected Behavior
Codex should pass large tool responses to the model until the actual
token budget is at risk (e.g., 20–25k tokens). Tool outputs should not
be truncated just because they exceed an arbitrary line count.
## Actual Behavior
Tool payloads are truncated once ~10 KiB/256-line budget is exceeded,
regardless of token usage or importance of the omitted section.
## Requested Fix
- Replace line/byte caps with a configurable token-based limits similar to other
context-management logic (e.g., 25k tokens per tool call).
- Apply the same policy consistently across stdout/stderr summaries and
structured tool payloads.
- Until token-aware truncation exists, provide a configuration flag to
disable or raise the cap for users who accept the trade-off.
## References
- Original truncation introduction: https://github.com/openai/codex/
commit/957d44918d334e89473b9abad14df96f843a19aa
- Extension to MCP/tool payloads: https://github.com/openai/codex/
commit/1c8507b32a1b880283d89546db6b510a03a0d935 and https://
github.com/openai/codex/pull/5979
- Related umbrella issue requesting token-based limits: https://
github.com/openai/codex/issues/6426
What steps can reproduce the bug?
## Steps to Reproduce
- Run Codex v0.56 or v0.57.
- Trigger any MCP tool that returns >10 KiB (e.g., fetch a long Linear
issue or Context7 brief).
- Inspect the assistant turn after the tool call: the conversation
history only contains the first/last slices and an [omitted …]
marker.
- The missing middle content cannot be recovered without manually
chunking the tool output.
What is the expected behavior?
No truncation of MCP / Tool calls
Additional information
_No response_
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗