CD-1293: cap vault_search tool results at the context boundary#29
Merged
Conversation
Search results returned the API's full chunk text verbatim — a limit:50 search produced ~46K chars of tool result, the last uncapped context-ingestion vector after the CD-1284 read/bash caps (observed in the Jul 13 production verification; same accumulation mechanic that burned the Lindenberg session). Both vault_search tools now trim result text fields to 500-char snippets, drop trailing results if the serialized payload still exceeds 20K chars (with an explicit omission marker), and carry a steering note: for full passages, vault_read_text + grep -n. The server API is unchanged — SDK consumers keep full chunks; only what enters billed model context is bounded. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
dantedanelian
approved these changes
Jul 13, 2026
Merged
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.
Why
The CD-1284 caps (linc #27) bound the file-tool paths, verified firing in prod. But the vault tools return
JSON.stringify(apiResponse)directly, bypassing the shared truncation layer — in the Jul 13 production verification, threevault_search limit:50calls returned ~46K chars each. Same accumulation mechanic as the Lindenberg incident, one tool over.Changes
Both
vault_search/casedev_vault_searchresults now:omittedResultsmarker ("narrow the query or lower limit")vault_read_text+grep -nServer API unchanged — SDK consumers keep full chunks; only what enters billed model context is bounded (library vs. photocopies, same rule as #27).
Tests
Two new tests (oversized payload trimmed/dropped/steered; small payload intact) + full coding-agent suite green.
Linear: CD-1293. Ships as 0.79.7 via the usual release-PR dance; casedotdev-mono pin bump follows.
🤖 Generated with Claude Code