Repository navigation
feat: add caller-scoped data spillover for large tool results - #92
Open
jpsiddharth2008 wants to merge 3 commits into
Open
jpsiddharth2008 wants to merge 3 commits into
jpsiddharth2008 wants to merge 3 commits into
Conversation
Collaborator
|
Hi @jpsiddharth2008, Could you rebase this PR branch with the develop branch and remove the additional commit dependencies? |
Collaborator
|
Rebase to drop the 32 commits inherited from Remove the internal "branch/stash preserved" note from Spillover behaviour is not tested independently; its 39 tests pass though. ~sent from claude-code |
jpsiddharth2008
force-pushed
the
feature/issue-67-data-spillover
branch
from
October 30, 2026 12:09
3ea98a7 to
e591a4e
Compare
AadarshM07
requested changes
Nov 1, 2026
AadarshM07
left a comment
Collaborator
There was a problem hiding this comment.
Hi @jpsiddharth2008, the core implementation looks good to me. I tested it locally, and both the tests and CI pass as well.
Before merging, I think pr92-verification.md and the other docs are not something we maintain. So, I suggest:
- Deleting the
docs/folder. - Removing the README.md references to
docs/spillover-line-by-line.mdanddocs/pr92-verification.md.
This branch has not been deployed
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.
Closes #67.
Large tool results can consume a significant portion of the model’s context.
This PR adds an opt-in interceptor that stores oversized results separately
and returns a bounded preview, a resource URI, and the original payload size.
The caller can retrieve the complete result through MCP
resources/read.Results at or below the configured threshold are returned unchanged.
Changes
SpilloverStoreprotocol with save, retrieve, delete, and expirycleanup operations.
MemorySpilloverStorewith TTL expiry, byte limits, and LRU eviction.FileSpilloverStorewith persistent ownership and expiry metadata,atomic writes, capacity limits, and path traversal and symlink checks.
DataSpilloverInterceptor, supporting a configurable byte threshold,storage backend, and resource URI prefix.
@use_interceptors(...)to accept configured interceptor instanceswhile preserving existing class-based dependency injection.
total counts, and truncated text within a 2 KiB preview budget.
the verified caller or, for anonymous callers, the originating MCP session.
Missing, expired, and unauthorized results return resource-not-found.
that allow either the original result or a spillover envelope.
The default spill threshold is 64 KiB, with a 10 MiB per-payload limit,
100 MiB store capacity, and five-minute TTL. File-store roots are intended
for use by one store instance in one process.
Testing
Feature tests
38 passed, 1 skipped, covering:
prefixes, background tasks, OAuth identity, and widget-transformer bypass.
The real filesystem symlink test was skipped because this Windows account
cannot create symlinks. A separate simulated symlink-rejection test passed.
Large-payload checks
24 additional checks passed across memory and file storage, including:
For each spilled result, checks verified byte-for-byte retrieval, the preview
size limit, and denial of access to another caller. These checks exercised
registered MCP handlers in-process rather than a network client.
Full SDK suite
The full suite with coverage reported 868 passed, 1 failed, 1 skipped
and 85.8% coverage.
Full-suite runs encountered Windows localhost connection-aborted errors
in OAuth discovery tests. The entire OAuth test module passed separately,
and an unchanged main-branch baseline also passed its full suite. The cause
of the combined-run failures remains unresolved.
git diff --checkpassed.