Repository navigation
fix(agents): preserve spill-file pointers through elision and spill truncated web_fetch output - #100135
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed July 4, 2026, 10:14 PM ET / 02:14 UTC. Summary PR surface: Source +220, Tests +332. Total +552 across 10 files. Reproducibility: yes. for the blocking patch defect: source inspection shows web_fetch writes a host tmpdir spill and advertises it in tool text, while sandboxed read tools are rooted through the sandbox filesystem bridge. I did not run a live sandboxed web_fetch scenario in this read-only review. Review metrics: 1 noteworthy metric.
Stored data model Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Keep the spill recovery goal, but make web_fetch recovery capability-aware and prove a live sandboxed and non-sandboxed recovery path before merge. Do we have a high-confidence way to reproduce the issue? Yes for the blocking patch defect: source inspection shows web_fetch writes a host tmpdir spill and advertises it in tool text, while sandboxed read tools are rooted through the sandbox filesystem bridge. I did not run a live sandboxed web_fetch scenario in this read-only review. Is this the best way to solve the issue? No. The aggregate-elision preservation is plausible, but the web_fetch spill path is not the best fix until it either writes to a path the active read tool can read or suppresses the footer in sandboxed/no-read contexts. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 7d3cfa85dca1. Label changesLabel justifications:
Evidence reviewedPR surface: Source +220, Tests +332. Total +552 across 10 files. View PR surface stats
Security concerns:
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
Review history (1 earlier review cycle)
|
8a8e647 to
f66cb58
Compare
ef79db6 to
58109e8
Compare
Keep aggregate elision recoverable by preserving existing spill pointers only when the original model-visible footer already disclosed the path. This commit also keeps partial-spill markers honest, handles JSON-escaped footers, and resolves full-clear markers from the original tool-result message after partial aggregate shrinking.
Write truncated web_fetch extracted content to owner-only private temp files using the shared Full output footer contract. Spills use the wrapped untrusted-content form, cap recoverable content at 2,000,000 chars, and label capped or source-truncated spills as partial instead of full output.
Preserve fullOutputPath plus partial-spill metadata when oversized tool-result details are summarized for persistence. This keeps aggregate elision from relabeling capped or source-truncated web_fetch spill files as complete after reload.
58109e8 to
da3942b
Compare
What Problem This Solves
Fixes #100112.
This is a follow-up to #100077/#100042. Truncation could destroy recoverable output: history elision discarded live exec spill-file pointers, and
web_fetchdiscarded overflow at fetch time.Why This Change Was Made
This reuses the shipped spill seam. Elision markers preserve
details.fullOutputPathwhen the file still exists, but only when the sameFull output: <path>footer was already present in model-visible tool text.That footer-visibility guard is enforced, not assumed: details-only paths are not surfaced, and JSON-escaped visible footers are detected so Windows-style paths stay recoverable without creating a new disclosure. Partial-spill honesty is preserved too: capped or source-truncated spills are labeled partial and are never claimed as full output.
web_fetchnow spills truncated extracted content through owner-only private temp files, using the wrapped untrusted-content form rather than raw page text. Spills are capped at 2,000,000 chars, byte-capped/source-capped responses are marked partial, and the returned footer shares the exec footer contract throughformatFullOutputFooter. Marker rendering degrades full -> compact -> plain rerun text, with a compact-pointer floor for valid spill pointers so recovery paths are not budget-starved.The E2E scratch test initially caught that budget-starvation flaw: real temp paths were long enough that both aggregate clearing and recovery suffix truncation could drop the pointer. This revision treats the pointer as recovery-critical metadata while keeping pointerless results on the existing budget-sliced plain-marker behavior.
User Impact
Models can recover full command output and fetched web content after truncation/elision instead of re-running expensive commands or losing vanished web content.
No config surface was added. Existing exec footers remain byte-identical.
Evidence
Post-rebase onto current
origin/main:pnpm tsgoExit 0.
pnpm check:test-typesExit 0.
node scripts/run-vitest.mjs src/agents/embedded-agent-runner/tool-result-truncation.test.ts src/agents/tools/web-tools.fetch.test.ts src/agents/session-tool-result-guard.tool-result-persist-hook.test.tsExit 0. Test Files: 3 passed. Tests: 104 passed.
Temporary production-path scratch E2E:
node scripts/run-vitest.mjs src/agents/spill-recovery.scratch.test.ts --reporter=verboseExit 0. Test Files: 1 passed. Tests: 1 passed. It exercised real bash capture, real
web_fetchthrough a local HTTP proxy/server, aggregate elision, spill-file recovery, deleted-spill fallback, and details-without-visible-footer non-disclosure. The scratch file was deleted and was not committed.Autoreview:
.agents/skills/autoreview/scripts/autoreview --mode branch --base origin/mainFinal actionable finding was fixed with an abort recheck after web_fetch spill writes; rerun exited 0 with no accepted/actionable findings before the final no-conflict rebase. The required verification above was rerun after that final rebase.