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
fix(github): devops gh rate-limit reads only the free /rate_limit endpoint #1441
scope/githubGitHub Projects v2, Views, Milestones, Labels, and PR automationsource/agentFiled by an agenttype/bugType bug: the code does not do what it must
devops gh rate-limit (commands/gh.py:1394-1395, also the hidden rate_limit and the MCP tool gh_rate_limit at ai/mcp/server.py:2512) reads GET /rate_limit (:1407). _enrich_rate_limit_resources (:1320-1345, called at :1374) then overwrites its core and graphql entries with:
GET /user -i (:1261): one core request, read by a third copy of an x-ratelimit-* header parser (:1259-1281, beside github/rate_limiter.py:583-641);
a GraphQL rateLimit query (:1283-1317): at least one point.
The docstring (:1321) calls /rate_limit deprecated. GitHub's documentation says the endpoint "does not count against your REST API rate limit", that its resources include graphql, and that only the top-level rate object is closing down. So every budget check spends from both budgets, including the GraphQL one the roadmap Service runs short of (#1400).
Proposed remedy
Show the resources that /rate_limit returns as they are. Delete _enrich_rate_limit_resources, _extract_rest_rate_limit_headers and _extract_graphql_rate_limit.
Acceptance criteria
With a fake gh at the process edge, devops gh rate-limit and devops gh rate-limit --format json each start exactly one gh child, api rate_limit, and print every resource it returned.
rg -n "_enrich_rate_limit_resources|_extract_rest_rate_limit_headers|_extract_graphql_rate_limit" src prints nothing.
Every new test runs in under 1 s; uv run devops ci passes.
Opened as a borrow (#1153, budget/borrowed): the agent filing quota is spent for this cycle, and this is a defect or security finding of the owner-requested 2026-10-08 client-library audit.
Intake placed this item to the backlog: at intake only a critical fix goes into a release; a release start pulls Ready items in, P0 features first.
Priority: P2-Medium. It wastes a user's rate-limit budget on every invocation and contributes to the GraphQL shortfall noted in #1400, but it is a diagnostic utility rather than a core workflow.
Value: Medium. Every call to the command silently burns one core request and one GraphQL point, which matters for users already near their limits.
Effort: Low. The fix is to delete three helper functions and let the command print the /rate_limit response as-is, with a small test update.
Finding: v0.2.29 Service gap assessment (2026-10-09)
spend_between treats any resetAt difference as an hourly reset and then reports last.used. GitHub returns two GraphQL counters whose resetAt differs by about 1 s, so 3 of 21 spend lines in the v0.2.29 pod said "since the hourly reset" when none happened, under-reporting the round. Proposed: count a reset only when last.reset_at is later than first.reset_at by more than the clock-skew bound, and report a drop in used within one window as unreadable instead of as a spend.
scope/githubGitHub Projects v2, Views, Milestones, Labels, and PR automationsource/agentFiled by an agenttype/bugType bug: the code does not do what it must
Activity
dan-petty-bot commentedon Oct 8, 2026
Intake placed this item to the backlog: at intake only a critical fix goes into a release; a release start pulls Ready items in, P0 features first.
It wastes a user's rate-limit budget on every invocation and contributes to the GraphQL shortfall noted in #1400, but it is a diagnostic utility rather than a core workflow.Every call to the command silently burns one core request and one GraphQL point, which matters for users already near their limits.The fix is to delete three helper functions and let the command print the /rate_limit response as-is, with a small test update.dan-petty commentedon Oct 9, 2026
Finding: v0.2.29 Service gap assessment (2026-10-09)
spend_betweentreats anyresetAtdifference as an hourly reset and then reportslast.used. GitHub returns two GraphQL counters whoseresetAtdiffers by about 1 s, so 3 of 21 spend lines in the v0.2.29 pod said "since the hourly reset" when none happened, under-reporting the round. Proposed: count a reset only whenlast.reset_atis later thanfirst.reset_atby more than the clock-skew bound, and report a drop inusedwithin one window as unreadable instead of as a spend.chore(main): release 0.6.3 (#2294)