Rate-limit taxonomy for GitHub API failures #2221
davidahmann
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Problem observed
The shared GitHub error layer differentiated invalid credentials and some scope failures, but it did not assign distinct classifications to primary quota exhaustion, secondary rate limits, or abuse-detection responses.
Why it matters operationally
This server sits directly on GitHub API policy boundaries. Rate limits are routine for real deployments, especially remote servers and automated inventory/search usage. When those responses appear as generic 403s, downstream automation cannot tell whether it should reduce query volume, wait for reset, or ask for different credentials. That makes operational receipts much less useful than they should be.
Minimal repro
Retry-Afterwas present.Fix approach
I extended the central HTTP classifier to recognize
rate_limited,secondary_rate_limited, andabuse_rate_limited, and to preserveRetry-Afteras explicit metadata when GitHub provides it. The change stays in the shared error package so the classification propagates consistently across all tool handlers that already rely on that layer.Validation evidence
go test ./pkg/errorsMaintainer question: would you want the preserved retry metadata exposed only through middleware inspection, or also surfaced directly in a future machine-readable tool error envelope?
Inspired by research context: CAISI publishes independent, reproducible AI agent governance research: https://caisi.dev
Beta Was this translation helpful? Give feedback.
All reactions