Title: improvement(search): return a longer live read window when an MCP client asks for more chunks by waleedlatif1 · Pull Request #9823 · simstudioai/sim · GitHub
Open Graph Title: improvement(search): return a longer live read window when an MCP client asks for more chunks by waleedlatif1 · Pull Request #9823 · simstudioai/sim
X Title: improvement(search): return a longer live read window when an MCP client asks for more chunks by waleedlatif1 · Pull Request #9823 · simstudioai/sim
Description: Summary A live document is one chunk, so read_document returned the same 8,000-character window whatever limit a client asked for, and clients that asked for more chunks then spent extra calls continuing with startOffset For Search MCP reads, a limit above the default (3) now returns a proportionally longer window: limit: 8 returns up to 21,333 characters, and next.startOffset continues from where it ended The documents of one call share a 40,000-character budget, measured on the window as the result JSON-encodes it (escaped quotes, backslashes and line breaks count), and each still gets at least the standard 8,000: limit: 8 reads 21,333 for one document, 20,000 each for two, 13,333 for three, 10,000 for four, and 8,000 (today's window) for five or more. A call's result then stays under the 50,000-character size at which MCP clients such as Claude Code save a tool result to a file instead of showing it, and no call returns more per document than it does today once five or more documents are read At or below the default, and for every other caller (the Assistant's reads are unchanged), the window stays 8,000 characters No tool schema or description changes, so tools/list is byte-identical Type of Change Improvement Testing MCP client bench (Sonnet 5.5, 83 cases, 4 attempts per case per side, paired against this branch's base): continuation reads 25 → 12 (−52%), read calls −10%, no case flipped from mostly right to never right; correct −1.2pp [−5.4, +2.7], completeness −0.9pp, sourceRecall −0.7pp, citedGold 0.0 (every CI spans 0, and all are inside the spread between two runs of the same code: correct −3.6pp); input tokens +2.5k [−5.7, +15.2], also inside the same-code spread (+3.0k to +3.3k); test split flat The bench ran the per-document window before the call budget was added; the budget only changes reads of two or more documents at a raised limit (4% of bench reads), moving them toward the base, and the final commit is being re-benched before merge New tests in lib/sim-search/live/application.test.ts (a scaling caller above the default limit gets the longer window and continues from its end; one call's documents share the budget at 2, 3 and 4 documents; at or below the default, at five or ten documents, and for a caller that does not scale, the window stays 8,000; a document made entirely of quotes stays within its encoded share and never below 8,000) and lib/knowledge/mcp/server.protocol.test.ts (the MCP adapter opts in with the call's document count, for a single and a batch read); each was seen failing without the change, and each guard (budget, encoded size, 8,000 floor, document count) was reverted and seen failing bunx vitest run lib/sim-search/live lib/knowledge/mcp (515 passed), biome on changed files; type-check and audits in CI Checklist Code follows project style guidelines Self-reviewed my changes Tests added/updated and passing (new tests pass the test-audit authoring gate) No new warnings introduced I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA) 🤖 Generated with Claude Code
Open Graph Description: Summary A live document is one chunk, so read_document returned the same 8,000-character window whatever limit a client asked for, and clients that asked for more chunks then spent extra calls con...
X Description: Summary A live document is one chunk, so read_document returned the same 8,000-character window whatever limit a client asked for, and clients that asked for more chunks then spent extra calls con...
Opengraph URL: https://github.com/simstudioai/sim/pull/9823
X: @github
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:4b690f3e-16ce-eb5c-c7c1-6ef946f16cad |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | EDDE:18732E:FBC3BC:158B291:6AFB6405 |
| html-safe-nonce | 294d70df3207bb0d6e90b8bfcc937f644c4e73e4fcfb0cf5d460a3978e8ad37e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFRERFOjE4NzMyRTpGQkMzQkM6MTU4QjI5MTo2QUZCNjQwNSIsInZpc2l0b3JfaWQiOiI1MTg4Njc0NzQ0MjY1NDM0MTE3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 9829ccae8f75e12f28f6e6dd260f70f61561d2f995c3bc27e6e3fd7710ebb73f |
| hovercard-subject-tag | pull_request:5232918780 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/simstudioai/sim/pull/9823/files |
| twitter:image | https://avatars.githubusercontent.com/u/40672544?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/40672544?s=400&v=4 |
| og:image:alt | Summary A live document is one chunk, so read_document returned the same 8,000-character window whatever limit a client asked for, and clients that asked for more chunks then spent extra calls con... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | ea33d13c96d0ff66bd8fa906b193d2213536b78cb06b0c50a4632c58b1418f94 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/simstudioai/sim git https://github.com/simstudioai/sim.git |
| octolytics-dimension-user_id | 199344406 |
| octolytics-dimension-user_login | simstudioai |
| octolytics-dimension-repository_id | 912559512 |
| octolytics-dimension-repository_nwo | simstudioai/sim |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 912559512 |
| octolytics-dimension-repository_network_root_nwo | simstudioai/sim |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 59ef97164c52cf59bd10558ddec9c4f482763988 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width