Repository navigation
Conversation
…ers (#320) taskMaxRetainedPerPrincipal treated every caller without an identity as one owner (undefined === undefined in MemoryTaskStore, the single mcp:tasks:anonymous index in RedisTaskStore), so on a deployment without authorization any client could evict or lock out everyone else's tasks. Anonymous tasks (no subject and no issuer) are no longer subject to the per-principal cap. They are bounded together by a new store-wide anonymous cap, taskMaxRetainedAnonymous (default 1000, matching the memory store's total capacity), with the same eviction rules. RedisTaskStore enforces it atomically in the existing create script against the anonymous index, so it holds across instances. Identified principals keep their own quota. Fixes #320 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LmhsFjk8W96X2PvmShmDm9
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.
Problem
taskMaxRetainedPerPrincipal(default 100) counted every caller without an identity as a single owner:MemoryTaskStorematchedundefined === undefined, andRedisTaskStoreput every anonymous task in the fleet into one index,mcp:tasks:anonymous. On a deployment without authorization, any client could therefore evict another client's finished task before that client collected it, or block all new anonymous tasks by keeping 100 running.Fix
isAnonymousOwner()helper) are no longer held to the per-principal cap. A per-principal quota for callers who can't be told apart is one allowance that any of them can use up for everyone else.taskMaxRetainedAnonymous(default 1000, the same as the memory store's total capacity). Eviction works as before: at the cap, the oldest finished anonymous task is evicted (orphaned leases are failed first). If every task is still running, the call fails with-32029"Task limit reached".maxTasks(1000) still applies on top.CREATE_SCRIPTruns againstmcp:tasks:anonymouswith the anonymous cap as its limit. The cap therefore holds across instances with no new keys and no extra round trips.taskMaxRetainedPerPrincipal/taskMaxRetainedAnonymousare updated. The old advice to raise the per-principal quota for anonymous workloads now points totaskMaxRetainedAnonymous.Tests
tools/call/tasks/get, plus validation oftaskMaxRetainedAnonymous. The two existing anonymous over-the-wire quota tests now usetaskMaxRetainedAnonymous.npm run lint,npm run typecheckandnpm run testpass (775/775).Fixes #320
🤖 Generated with Claude Code
https://claude.ai/code/session_01LmhsFjk8W96X2PvmShmDm9