gabriel / musehub public
fix BREAKING rest task/rest-309 #1 / 1
AI Agent gabriel · 1 day ago · Nov 15, 2026 · Diff

fix(rest): one honest rate-limit contract (#309); the pagination Link header uses the public base (#276 follow-up)

#309: the 300/min app-wide default existed only in comments (slowapi applies default_limits through SlowAPIMiddleware, never installed) — removed; routes are limited by their own decorators and the edge handles site-wide abuse. 429 is {"detail": "rate limit exceeded: …"} like every other error, and Retry-After is the time left in the caller's bucket (limiter.get_window_stats), not a constant 60. No X-RateLimit-* headers (slowapi would need a response parameter on every route). #276: build_cursor_link_header builds on public_url_for, never request.url; pagination.py leaves the PUB_30 allow-list. Docs: rate-limit and pagination sections state the real behaviour; #309 and #276 leave the known issues.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

sha256:f01bf034eb409e79373775083966fb6d1ecaefb4ac3b2e7e6d8beaeb555259df sha
+6 ~24 −8 symbols
sha256:a0465240f230a40b2a686169abf8e574a1034a0e82b1a825d9c9e1e6f7c5950d snapshot
+6
symbols added
~24
symbols modified
−8
symbols removed
0
dead code introduced
Semantic Changes 38 symbols
~ musehub/main.py .py 1 symbol removed, 1 symbol modified
− _rate_limit_exceeded_handler import import _rate_limit_exceeded_handler L24–24
~ musehub/rate_limits.py .py 1 symbol removed, 1 symbol modified
− GLOBAL_LIMIT variable variable GLOBAL_LIMIT L30–30
~ tests/test_load_readiness.py .py 2 symbols added, 2 symbols removed, 2 symbols modified
− test_global_rate_limit_allows_100_users method method test_global_rate_limit_allows_100_users L85–91
− test_rate_limit_handler_calls_slowapi_handler method method test_rate_limit_handler_calls_slowapi_handler L161–168
+ test_browsing_is_never_rate_limited_by_the_app method method test_browsing_is_never_rate_limited_by_the_app L85–88
+ test_rate_limit_handler_answers_429_itself method method test_rate_limit_handler_answers_429_itself L158–163
~ tests/test_public_urls.py .py 1 symbol modified
~ tests/test_rate_limiting.py .py 3 symbols added, 3 symbols removed, 4 symbols modified
− test_429_response_has_error_key method async_method test_429_response_has_error_key L217–227
− test_global_rate_limit_configured function function test_global_rate_limit_configured L648–657
− test_retry_after_added_to_429 function function test_retry_after_added_to_429 L727–756
+ test_429_response_has_detail_key method async_method test_429_response_has_detail_key L217–227
+ test_no_app_wide_default_limit_is_claimed function function test_no_app_wide_default_limit_is_claimed L648–654
+ test_retry_after_is_the_time_left_in_the_bucket function function test_retry_after_is_the_time_left_in_the_bucket L724–741
← Older Oldest on task/rest-309
All commits
Newer → Latest on task/rest-309

0 comments

No comments yet. Be the first to start the discussion.

To add a comment, use the Muse CLI: muse hub commit comment sha256:f01bf034eb409e79373775083966fb6d1ecaefb4ac3b2e7e6d8beaeb555259df --body "your comment"