perf: raise default chunking threshold to 64k and scale chunk size#181
Merged
rockfordlhotka merged 1 commit intomainfrom Mar 20, 2026
Merged
perf: raise default chunking threshold to 64k and scale chunk size#181rockfordlhotka merged 1 commit intomainfrom
rockfordlhotka merged 1 commit intomainfrom
Conversation
Raise ToolResultChunkingThreshold default from 16,000 to 64,000 chars (~16k tokens) since even Low-tier models have 120k+ context windows. MCP service details responses (typically 20-40k chars) now flow inline without chunking, eliminating extra get_from_working_memory round-trips. Chunk max size is now derived from the threshold (min 20k) instead of hardcoded at 20k, so when chunking does occur each chunk is as large as possible — a 130k result becomes 2 chunks instead of 7. Co-Authored-By: Claude Opus 4.6 (1M context) <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
ToolResultChunkingThresholddefault from 16k to 64k chars — even Low-tier models have 120k+ context windows, so MCP service details (typically 20-40k chars) should flow inline without chunkingmax(threshold, 20k)) instead of hardcoding 20k — when chunking occurs, each chunk is as large as possible to minimize working-memory round-tripsTest plan
dotnet build RockBot.slnx— 0 errorsdotnet test RockBot.slnx— all tests pass🤖 Generated with Claude Code