fix: raise docCache per-entry cap to 5 MB with size warnings#29
Open
mattpodwysocki wants to merge 3 commits intomainfrom
Open
fix: raise docCache per-entry cap to 5 MB with size warnings#29mattpodwysocki wants to merge 3 commits intomainfrom
mattpodwysocki wants to merge 3 commits intomainfrom
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
llms-full.txt files (GL JS 1.6MB, iOS Nav 696KB, Style Spec 466KB) previously fell under or near the 2MB hard cap. Raising to 5MB lets all current full-content files cache cleanly. Add warnings so operators can see large entries in logs: - entries 1MB–5MB: warn and cache - entries >5MB: warn and reject (instead of silently dropping) Update BatchGetDocumentsTool test to use 6MB as the "too large" value. Co-Authored-By: Claude Sonnet 4.6 <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.
Summary
llms-full.txtfiles now exist for every product on docs.mapbox.com and can be fetched viaget_document_tool. The previous 2 MB per-entry cache limit would have silently dropped GL JS full content (1.6 MB) on cache attempts — it fit under the limit, but just barely, and any growth would break it with no operator visibility.Changes:
llms-full.txtfiles cache cleanly (GL JS 1.6 MB, iOS Nav 696 KB, Style Spec 466 KB)console.warn("[docCache] Caching large entry (X.X MB): <url>")so operators can see large cache entries in server logs[docCache] Entry too large to cacheinstead of being silently droppedThe total 50 MB cache cap is unchanged.
Test plan
npm test— 60 tests passconsole.warnfires for entries >1 MB (cached) and >5 MB (rejected)🤖 Generated with Claude Code