From bf171362a650bc0bfe36e809aea15747227bb284 Mon Sep 17 00:00:00 2001 From: Hugo Richard Date: Wed, 26 Aug 2026 09:54:12 +0100 Subject: [PATCH 1/2] feat(sdk): attach rate-limit metadata on object-shaped tool results 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. --- .changeset/rate-limit-on-results.md | 5 + apps/chat/app/components/tool/Github.vue | 34 +++++ .../docs/2.frameworks/1.eve-extension.md | 2 + apps/docs/content/docs/5.api/2.reference.md | 12 ++ apps/docs/skills/github-tools-agents/SKILL.md | 2 +- .../references/eve-extension.md | 2 +- packages/github-tools-eve-extension/README.md | 2 +- .../extension/tools/github.ts | 5 +- packages/github-tools/README.md | 12 ++ packages/github-tools/src/client.test.ts | 62 +++++++++ packages/github-tools/src/client.ts | 29 ++++ packages/github-tools/src/core/bundles.ts | 17 +-- packages/github-tools/src/core/checks.ts | 8 +- packages/github-tools/src/core/commits.ts | 14 +- packages/github-tools/src/core/discussions.ts | 11 +- packages/github-tools/src/core/gists.ts | 23 ++-- packages/github-tools/src/core/issues.ts | 53 +++++--- .../github-tools/src/core/notifications.ts | 8 +- .../github-tools/src/core/pull-requests.ts | 38 ++++-- .../github-tools/src/core/rate-limit.test.ts | 97 ++++++++++++++ packages/github-tools/src/core/rate-limit.ts | 126 ++++++++++++++++++ packages/github-tools/src/core/reactions.ts | 14 +- packages/github-tools/src/core/releases.ts | 20 ++- packages/github-tools/src/core/repository.ts | 26 ++-- packages/github-tools/src/core/search.ts | 11 +- packages/github-tools/src/core/workflows.ts | 23 ++-- packages/github-tools/src/eve-runtime.ts | 1 + packages/github-tools/src/eve/build.test.ts | 30 +++++ packages/github-tools/src/eve/build.ts | 4 +- packages/github-tools/src/eve/registry.ts | 8 +- packages/github-tools/src/index.ts | 22 ++- 31 files changed, 614 insertions(+), 107 deletions(-) create mode 100644 .changeset/rate-limit-on-results.md create mode 100644 packages/github-tools/src/core/rate-limit.test.ts create mode 100644 packages/github-tools/src/core/rate-limit.ts diff --git a/.changeset/rate-limit-on-results.md b/.changeset/rate-limit-on-results.md new file mode 100644 index 0000000..2d57f66 --- /dev/null +++ b/.changeset/rate-limit-on-results.md @@ -0,0 +1,5 @@ +--- +'@github-tools/sdk': minor +--- + +Object-shaped tool results now include `rateLimit` (`remaining`, `limit`, `reset`, `resource`) from the last GitHub response. The field is stripped before the model sees the output. Array-shaped list tools are unchanged. 403/429 errors include remaining/reset in the message. diff --git a/apps/chat/app/components/tool/Github.vue b/apps/chat/app/components/tool/Github.vue index 04f1912..e3e5af6 100644 --- a/apps/chat/app/components/tool/Github.vue +++ b/apps/chat/app/components/tool/Github.vue @@ -1,4 +1,5 @@