Skip to content

fix(agent): name spilled outputs by id and content, not id alone - #501

Merged
mrnasil merged 2 commits into
mainfrom
fix/spill-id-collision
Nov 25, 2026
Merged

mrnasil merged 2 commits into
mainfrom
fix/spill-id-collision

Conversation

@mrnasil

@mrnasil mrnasil commented Nov 25, 2026

Copy link
Copy Markdown
Member

An old tool output spilled to disk was saved as .whycodes/scratch/artifacts/<tool_call_id>.txt, and an existing file with that name was kept as it was. Tool call ids repeat:

  • Gemini numbers its calls from gcall_1 in every stream;
  • fallback ids restart;
  • every session in the project shares the directory.

A later result's pointer could therefore send read to an earlier call's output, which is quietly wrong context for the model.

The file name now carries a stable FNV-1a hash of the body (<id>-<hash>.txt). A reused id with a new body gets its own file, and the same body still maps to the same file.

Tests: a reused id with two different bodies gives two files, each holding its own output. The spill and lifecycle tests now look artifacts up by the new names. All 176 session tests pass.

🤖 Generated with Claude Code

store_artifact named the file `<tool_call_id>.txt` and kept an existing
file. Ids repeat: Gemini numbers calls from `gcall_1` in every stream,
fallback ids restart, and every session in the project shares the
directory. A later result's pointer then led `read` to an earlier
call's output. The name now carries a stable FNV-1a hash of the body;
the same body still reuses its file.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@mrnasil
mrnasil enabled auto-merge (squash) November 25, 2026 16:08
@mrnasil
mrnasil merged commit aaea172 into main Nov 25, 2026
7 checks passed
@mrnasil
mrnasil deleted the fix/spill-id-collision branch November 25, 2026 23:45
@mrnasil mrnasil mentioned this pull request Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant