Repository navigation
fix(artifact-delivery): keep healthy runs inside their limits - #484
Merged
Merged
Conversation
A run polls its Resolution once a second, so one slow build spent the whole guest allowance of 60 requests a minute and failed with RATE_LIMITED. Polls now draw from their own allowance (ADR-0012). GitHub answers a secondary rate limit with 403 or 429 and Retry-After. A 403 failed the run as SOURCE_ACCESS_DENIED, and a 429 threw into the queue retry ladder. Both now fail as RATE_LIMITED with the named wait, and a rate-limited tarball no longer falls back to one read per blob. Every retryable failure now names retryAfterSeconds. The first queue retry waits 5 seconds instead of 60, inside the CLI's 60 second window.
The hourly registry sync spends GITHUB_TOKEN to zero before each GitHub reset. On 2026-10-06, 13 runs failed RATE_LIMITED in those minutes. GitHub counts a personal token's quota per account, so builds now read with ARTIFACT_GITHUB_TOKEN when it is set, and with GITHUB_TOKEN until then.
Contributor
🤖 MERGED
GitHub merged this pull request. No material findings were recorded. The pull request closed. |
This was referenced Oct 6, 2026
harlan-zw
added this pull request to stack #492
October 6, 2026 15:04
1 of 6 tasks
# Conflicts: # layers/artifact-delivery/server/utils/github-source.ts
1 of 6 tasks
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.
🔗 Linked issue
Related to #481
❓ Type of change
📚 Description
skilld runfailed for healthy users at four limits on the Resolution path.GITHUB_TOKEN. The sync spends it to zero before each hourly GitHub reset. On 2026-10-06, 13 runs failedRATE_LIMITEDin those minutes, among themericzakariasson/skills/game-builder. GitHub counts a personal token's quota per account. Builds now read GitHub withARTIFACT_GITHUB_TOKENwhen it is set, and withGITHUB_TOKENuntil then.Retry-After. A 403 failed the run asSOURCE_ACCESS_DENIED, which nobody retries. A 429 threw, so the build sat in the queue retry ladder and spent quota on every attempt. Both now fail asRATE_LIMITEDwith the wait GitHub named. A rate-limited tarball now stops the build. It used to fall back to one blob read per file, which spent the most quota exactly when none was left. The classification now matchesupdate-plans.ts.GET /api/v1/resolutions/{id}every 1000 ms, at the rate the server names. A one minute build costs about 60 polls, which is the whole guest allowance of 60 requests a minute. Polls now draw from their own binding,API_RESOLUTION_POLL_RATE_LIMIT, at 600 a minute under the same key. ThePOSTthat starts a Resolution stays in the shared allowance. ADR-0012 amends ADR-0008.retryAfterSeconds, with 60 seconds as the default when the cause named no wait.📝 Migration
To give runs their own GitHub quota, create a fine-grained token with public repository read access on a GitHub account other than the one behind
GITHUB_TOKEN. Then runwrangler secret put ARTIFACT_GITHUB_TOKEN --config wrangler.jsonc. Without the secret, builds keep usingGITHUB_TOKEN.