Repository navigation
docs(github): continue through GraphQL, raw, or git when REST is rate limited - #971
Draft
aivong-openhands wants to merge 1 commit into
Draft
aivong-openhands wants to merge 1 commit into
aivong-openhands wants to merge 1 commit into
Conversation
When a GitHub call fails with a rate-limit error, tell the agent to check `gh api rate_limit` (no quota cost), wait only for secondary limits or a reset under 5 minutes, and otherwise continue at once through paths that do not use REST quota: GraphQL, raw.githubusercontent.com, or git over HTTPS. Warn that another token of the same user shares the same quota. Regenerate skills/index.js and add a PowerShell note for curl.exe. Co-authored-by: openhands <openhands@all-hands.dev>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
HUMAN:
AGENT:
This PR was created by an AI agent (OpenHands) on behalf of @aivong-openhands.
Why
An agent ran
gh api repos/<owner>/<repo>/contents/<dir>and gotHTTP 403: API rate limit exceeded. After some trial and error it found that a sparsegit cloneworked, because git over HTTPS does not use REST quota. Thegithubskill had nothing about rate limits, so the agent had to work that out itself. This PR writes the order of steps into the skill so the agent reaches a working path straight away.Waiting alone does not solve it. With a primary limit,
x-ratelimit-resetcan be up to an hour away (about 25 minutes in this case), and GitHub sends noretry-after. A second token of the same user does not help either, because the limit is per user.Summary
skills/github/SKILL.md: new## Rate limitssection. The agent checksgh api rate_limitfirst (it uses no quota). It waits only for a secondary limit or a reset less than 5 minutes away. Otherwise it continues at once with GraphQL (separate quota), raw.githubusercontent.com, or git over HTTPS. It also says whichghsubcommands still work and that another token of the same user does not help.skills/github/README.mdandreferences/windows.md: document the section, and add acurl.exenote for PowerShell 5.1.skills/index.js: regenerated bynode scripts/build-skills-catalog.mjs.Issue Number
None.
How to Test
The REST
corequota for the account was at 0 (reset 20:12:26 UTC). I ran every bash block of the new section exactly as written, replacing only the placeholders (OWNER=OpenHands,REPO=extensions,path/to/dir=skills/github,NUMBER=967). The script that did this (/tmp/run_skill_section.py) pulls the blocks fromSKILL.mdwith a regex, so it tests the text an agent will see. The token is redacted.I also checked the claim about which
ghsubcommands still work, with the quota still at 0:The failing REST call returned
403withX-Ratelimit-Remaining: 0andX-Ratelimit-Reset, and noRetry-After. That matches step 3 of the new section.Repository checks:
uv run --group test pytest -q: 1654 passed, 33 skipped.python scripts/sync_extensions.py --check: no errors. It shows two non-blocking coverage warnings for plugins that were already there.Video/Screenshots
Not applicable (documentation change). The terminal logs above are the evidence.
Notes
github-resilienceskill. That skill's only answer to a primary limit was to sleep until the reset.