Skip to content

feat: surface rate-limit headers on ApiError#15

Open
armandokun wants to merge 1 commit into
feat/usage-commandfrom
feat/surface-ratelimit-headers
Open

feat: surface rate-limit headers on ApiError#15
armandokun wants to merge 1 commit into
feat/usage-commandfrom
feat/surface-ratelimit-headers

Conversation

@armandokun

Copy link
Copy Markdown
Collaborator

Stacked on #14 (base: feat/usage-command). Review/merge that first.

Summary

  • Parse X-RateLimit-* and Retry-After into a rateLimit field on ApiError.
  • 429s print a "retry after Ns" hint so CLI/bridge users see quota state.

Test plan

  • npm run build
  • npm test (9 passed, incl. new lib/__tests__/http.test.ts)

Made with Cursor

Parse X-RateLimit-Limit/Remaining/Reset and Retry-After from API
responses into a `rateLimit` field on ApiError, and add a "retry after
Ns" hint when a 429 is printed. Lets CLI/bridge users see quota state
instead of guessing.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant