Skip to content

CD-1293: cap vault_search tool results at the context boundary#29

Merged
teddy-paris merged 1 commit into
mainfrom
agent/CD-1293-cap-search-results
Jul 13, 2026
Merged

CD-1293: cap vault_search tool results at the context boundary#29
teddy-paris merged 1 commit into
mainfrom
agent/CD-1293-cap-search-results

Conversation

@teddy-paris

Copy link
Copy Markdown
Contributor

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, three vault_search limit:50 calls returned ~46K chars each. Same accumulation mechanic as the Lindenberg incident, one tool over.

Changes

Both vault_search/casedev_vault_search results now:

  • trim every text field to a 500-char snippet
  • drop trailing results if the payload still exceeds 20K chars, with an explicit omittedResults marker ("narrow the query or lower limit")
  • carry the steering note: for full passages, use vault_read_text + grep -n

Server 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

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>
@vercel

vercel Bot commented Jul 13, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
linc-docs Ready Ready Preview, Comment Jul 13, 2026 9:41pm

@teddy-paris teddy-paris merged commit 82a554e into main Jul 13, 2026
6 checks passed
@teddy-paris teddy-paris mentioned this pull request Jul 13, 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.

2 participants