Skip to content

perf: raise default chunking threshold to 64k and scale chunk size#181

Merged
rockfordlhotka merged 1 commit intomainfrom
perf/raise-chunking-threshold
Mar 20, 2026
Merged

perf: raise default chunking threshold to 64k and scale chunk size#181
rockfordlhotka merged 1 commit intomainfrom
perf/raise-chunking-threshold

Conversation

@rockfordlhotka
Copy link
Member

Summary

  • Raise ToolResultChunkingThreshold default 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 chunking
  • Derive chunk max size from the threshold (max(threshold, 20k)) instead of hardcoding 20k — when chunking occurs, each chunk is as large as possible to minimize working-memory round-trips
  • Update docs to reflect new defaults

Test plan

  • dotnet build RockBot.slnx — 0 errors
  • dotnet test RockBot.slnx — all tests pass
  • Manual: invoke MCP tool returning ~30k chars → verify result goes inline (no chunking log)
  • Manual: invoke MCP tool returning >64k chars → verify chunked into 1-2 chunks, not 4+

🤖 Generated with Claude Code

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>
@rockfordlhotka rockfordlhotka merged commit ad35bcb into main Mar 20, 2026
2 checks passed
@rockfordlhotka rockfordlhotka deleted the perf/raise-chunking-threshold branch March 20, 2026 18:04
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.

1 participant