Skip to content

Classify GitHub secondary and abuse rate limits#2220

Open
davidahmann wants to merge 1 commit into
github:mainfrom
davidahmann:codex/rate-limit-classification
Open

Classify GitHub secondary and abuse rate limits#2220
davidahmann wants to merge 1 commit into
github:mainfrom
davidahmann:codex/rate-limit-classification

Conversation

@davidahmann

Copy link
Copy Markdown

Problem
The shared GitHub error layer classified invalid tokens and some scope failures, but it left primary, secondary, and abuse-limit responses effectively untyped.

Why now
Rate limits are a routine operational condition for this server. Downstream tooling needs to distinguish quota exhaustion from auth/policy failures without parsing transport-specific text.

What changed

  • added shared HTTP error classification for rate_limited, secondary_rate_limited, and abuse_rate_limited
  • preserved Retry-After metadata when GitHub provides it
  • extended unit coverage for the new classifications and documented the rate-limit codes in docs/error-handling.md

Validation

  • go test ./pkg/errors

Refs #2219

@davidahmann davidahmann requested a review from a team as a code owner March 16, 2026 14:24
@davidahmann

Copy link
Copy Markdown
Author

Operator impact: downstream tooling can now distinguish primary quota exhaustion, secondary rate limits, and abuse limits from auth/scope failures without parsing GitHub-specific error text.

Minimal change: the shared error layer now classifies rate-limit variants centrally, preserves Retry-After metadata when present, and documents/tests the new codes.

Validation:

  • go test ./pkg/errors

Risk/blocker: none in the changed path.
Inspired by research context: CAISI publishes independent, reproducible AI agent governance research: https://caisi.dev

@davidahmann davidahmann force-pushed the codex/rate-limit-classification branch from a463116 to c80f979 Compare March 16, 2026 23:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant