You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Issue #42 : [decorators] @cache never evicts; @rate_limit is process-global and raises bare ValueError - #47
The solution adds an LRU‑bounded cache with a default size of 1024 and a cache_clear() hook, plus a typed RateLimitExceededError that includes retry hints and supports per‑key counters. All decorator tests passed (30 total).
Install the entire nitrostack-py package from output-schema-keep-null branch, either locally or in /tmp/<name_of_dir>/
then import that package
and test it against #42
#42
If the tests pass, add the test report as comments. here.
Verification of the proposed fix (feat/cache-eviction-rate-limit, bfe29e8)
Changes: Improved caching with size limits and a cache-clearing option, along with better rate limiting and per-key limits.
Installation and test environment
Cloned the branch into a temporary directory, created a fresh virtual environment, and installed the package using pip install <repo>.
The checks were run against the installed package from outside the repository, and the import resolved to venv\Lib\site-packages\nitrostack, confirming that the installed package was being tested rather than the source checkout.
Results:
30 tests passed against the installed package, covering decorator limits, caching, and MCP extensions.
822 tests passed in the source checkout.
End-to-end verification results:
-- Installed branch: 9/9 checks passed, covering LRU eviction, cache size limits, expiration, cache_clear(), and rate-limit behavior.
-- Upstream main (a06624c): 0/9 checks passed, as the tested features are not supported.
Conclusion: The results support the proposed changes to caching and rate limiting, with all reported tests passing in their respective environments.
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
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.
This PR enhances the decorator utilities in
nitrostack/core/additional_decorators.pyto make caching and rate limiting safer and more predictable.Changes
@cachemax_sizeparameter (default 1024,Nonedisables cap).cache_clear()for tests.@rate_limitRateLimitExceededError(subclass ofValueError) carryingretry_after_seconds.key=callable for per-user or per-resource counters.RateLimitExceededErrortonitrostack/core/errors.pyand exported in__init__.py.tests/test_decorators_limits.pycovers eviction, expiry, unbounded mode, cache_clear, typed error, retry_after_seconds, per-key limits, and shared default behavior.Verification
httpxdependency).Impact