Make every large result both bounded and recoverable
Use when: an MCP search, document, log, or background-agent task can return enough text to crowd out instructions, trigger compaction, or exceed a request-size limit. Apply this only where the complete result can be fetched again from a stable resource or artifact; exact, non-idempotent outputs need preservation before projection.
2.1.252
or
later
and
Codex
0.152.0
or
later.
For
each
noisy,
replayable
Codex
MCP
tool,
add
this
to
~/.codex/config.toml:
[mcp_servers.docs.tools.search] output_token_limit = 8000Use the real server and tool names. Make the MCP result place a
resource_link
or
artifact
URI,
original
byte
count,
and
digest
before
verbose
text.
Background
workers
should
write
full
stdout/stderr
to
an
artifact
and
return
only
status,
path,
digest,
and
a
bounded
diagnostic
tail.
Do
not
lower
the
cap
for
tools
lacking
paging,
range
reads,
resource
links,
or
another
lossless
replay
path.
Acceptance
check:
have
a
fixture
produce
150
KB
containing
BEGIN,
MIDDLE,
and
END
sentinels
plus
an
artifact
URI
and
digest.
In
Codex,
capture
the
model-visible
result,
resume
the
thread,
and
inspect
it
again:
both
copies
must
be
identical,
contain
an
explicit
truncation
marker,
and
retain
the
URI;
fetching
the
artifact
must
recover
all
three
sentinels
and
match
the
digest.
In
Claude,
finish
a
background
task
with
the
same
oversized
failure
output;
the
next
prompt
must
succeed
without
an
API-request-size
error,
while
the
artifact
still
validates.
0.152.0
is
a
stable
release
published
two
minutes
before
this
scan.
Merged
PR
#41421
adds
positive
per-tool
limits,
keeps
approval
policy
separate,
applies
the
stricter
plugin/user
limit,
and
tests
under-limit,
over-limit,
hook-feedback,
and
resume
paths.
Claude
Code
2.1.252
independently
fixes
oversized
background
failure
notifications
that
could
overflow
the
next
request.
Caveat:
Codex
truncation
remains
a
lossy
model-facing
preview;
it
does
not
auto-spill
omitted
bytes.
Open
issues
#14206
and
#14466
document
broken
structured
results
and
upstream
129
KB
payloads
arriving
complete
while
Codex
displayed
truncation.
The
configured
budget
also
receives
a
20%
serialization
allowance,
and
8,000
tokens
is
only
a
starting
point.
Claude
publishes
no
regression
output
for
its
fix.
Recalibrate
with
your
own
payload
distribution
and
never
treat
a
truncation
marker
as
successful
evidence
retrieval.