Skip to content

feat(sdk): attach rate-limit metadata on object-shaped tool results - #106

Merged
HugoRCD merged 2 commits into
mainfrom
evl-343
Aug 26, 2026
Merged

feat(sdk): attach rate-limit metadata on object-shaped tool results#106
HugoRCD merged 2 commits into
mainfrom
evl-343

Conversation

@HugoRCD

@HugoRCD HugoRCD commented Aug 26, 2026

Copy link
Copy Markdown
Member

Summary

  • Object-shaped GitHub tool results now include rateLimit (remaining, limit, reset, resource, optional retryAfter) from the last response.
  • The field is on the execute result (hooks, channels, chat UI) and is stripped by toModelOutput so it does not reach the model. Array-shaped list tools are unchanged.
  • 403/429 error text includes remaining/reset/resource. Chat tool rows show a remaining/limit chip.

Test plan

  • SDK tests: pnpm --filter @github-tools/sdk test
  • pnpm build && pnpm lint && pnpm typecheck
  • Confirm an object-shaped tool (searchCode, getRepository) exposes rateLimit on the execute result
  • Confirm toModelOutput / model-facing payload does not include rateLimit
  • Confirm a 403/429 includes remaining/reset in the error message
  • Confirm the chat tool row shows a remaining/limit chip when invocation.output.rateLimit is present

Capture x-ratelimit headers on the Octokit client so hooks and the chat UI can read remaining quota, while toModelOutput strips the field from the model.
@vercel

vercel Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
github-tools-docs Ready Ready Preview, v0 Aug 26, 2026 9:17am
github-tools-test-agent Ready Ready Preview, v0 Aug 26, 2026 9:17am

@github-actions

Copy link
Copy Markdown
Contributor

Thank you for following the naming conventions! 🙏

Comment thread packages/github-tools/src/core/rate-limit.ts Outdated
Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant