Repository navigation
fix(rate-limiter): exclude prompts from per-server tool quotas - #203
Merged
Merged
Conversation
Signed-off-by: Vishu Bhatnagar <vishu.bhatnagar@ibm.com>
vishu-bh
requested review from
gandhipratik203,
lucarlig and
msureshkumar88
as code owners
October 13, 2026 16:31
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.
Enabling
by_user_per_servercurrently rejects ordinary prompt fetches withoutserver_idwithRATE_LIMIT_CONTEXT_MISSING(503). This change confines catalog-server quotas to tool invocations and restores ordinary prompt retrieval.Prompt evaluation uses a Rust engine configuration view with
by_user_per_serverdisabled, sharing the existing backend and clock with tool evaluation. User, tenant, and tool/prompt-name counters remain shared across hooks. Tool identity validation, counter keys, algorithms, failure policies, and Python entry points are unchanged.Adds memory and live Redis regression coverage for prompt quota exclusion and shared counters, updates hook-specific documentation, and bumps the package to
0.1.12with matching Cargo lockfile and manifest versions.Closes #202.
Validation
make plugins-validate: passed (41 repository tests).make ci test-all test-integration: passed; 92 Rust tests and 134 Python hook tests, including live Redis and TLS, with no skips. Formatting, Clippy with-D warnings, release-wheel build/install, and benchmark compilation passed.server_idsucceeds; prompt and tool calls still share the global user quota.git diff --check: passed.Local validation used nextest 0.9.133. The existing TLS fixture generates a certificate missing an Authority Key Identifier, which Python 3.13 rejects before calling the plugin. The final run used the fixture's supported
RATE_LIMITER_TLS_REDIS_URLoverride with an isolated Redis endpoint and a valid temporary certificate; fixture code and certificate verification were unchanged. One existing one-second Redis TTL test failed once and passed on the full rerun.Gateway REST GET/POST and MCP
prompts/getacceptance tests remain pending in the gateway repository. This PR does not publish a release or update gateway dependencies.