Repository navigation
feat(compaction): L1 tool-result overflow-to-disk as a cascade stage … - #26
Merged
Merged
Conversation
…(M4.1 / v4) Layer 1 of the v4 pipeline: decouple the inline preview size from the spill threshold and keep a head+tail SMART preview instead of a pure prefix slice, so both the start (what the output is) and the end (the final line / error / summary) of a large tool output survive — a pure prefix throws the tail away. Full output is still spilled to an artifact and restorable via Read (zero loss). - smartPreview(content, maxChars): head ~70% + omitted-count marker + tail ~30%. - ToolContext.toolResultPreviewChars (default 2048), decoupled from the spill threshold (toolResultBudgetChars); budgetToolResult uses it at execution time. - createSpillStage: a request-time cascade stage (the cheapest layer) that spills any oversized, not-yet-spilled tool_result before the deeper layers run, preserving artifactPath; prepended to runCompactionPipeline's stages. Its threshold defaults to the execution budget, so it is dormant when no budget is set (the eval harness -> 120K) and active in the CLI (8192) — the eval fingerprint is unchanged, real usage gets active L1. - tests: smartPreview (head+tail + passthrough); createSpillStage (spills + restorable, leaves small/already-spilled untouched); the existing budget test hardened to assert the head+tail marker. - docs: CLAUDE.md artifact-spill + cascade-stages note (also dedup'd a stray duplicated paragraph in query-loop step 7); v4 roadmap M4.1 marked delivered. 230 tests pass (+4); all 10 eval tasks green, fingerprint unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…(M4.1 / v4)
Layer 1 of the v4 pipeline: decouple the inline preview size from the spill threshold and keep a head+tail SMART preview instead of a pure prefix slice, so both the start (what the output is) and the end (the final line / error / summary) of a large tool output survive — a pure prefix throws the tail away. Full output is still spilled to an artifact and restorable via Read (zero loss).
230 tests pass (+4); all 10 eval tasks green, fingerprint unchanged.