Skip to content

Spill, don't truncate: oversized tool outputs go to a session artifact, cap note cites the path #409

Description

@justrach

From the prime-agent analysis (PrimeIntellect-ai/prime-agent, 2026-08-06). Their model keeps every large result addressable (a Python object in the kernel namespace) and only caps what reaches the transcript (64KB/cell). The transferable idea needs no kernel: never destroy data at the cap point.

Today: capOversizedToolOutputs (#196) caps an oversized tool output per-output when over the context budget. The elided content is gone; the model re-runs the tool if it guessed the wrong slice.

Proposal: before capping, write the full output to a session artifact (e.g. .graff/sessions/<id>/artifacts/tool-<call>.txt) and make the elision marker actionable: [truncated: full output (N bytes) at <path>]. The model can then read/grep exactly the slice it needs.

Notes:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions