Repository navigation
feat(deliver): wait for CI without spending the REST quota - #100
Closed
jtomaszewski wants to merge 2 commits into
Closed
jtomaszewski wants to merge 2 commits into
jtomaszewski wants to merge 2 commits into
Conversation
Persistent top-level Paseo agents wait for PR checks with subscribe_change_request, with one fallback wake for cancelled or stuck checks, then verify the current head. Everyone else, and any wait after a re-run, blocks on `gh pr checks --watch --interval 60` (GraphQL). Merge and deploy runs cost one bounded request a minute. `gh run watch` is banned, and only the failing job's log is downloaded. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A preview bot comments while checks are still running, so ending the subscription on any first wake sent agents straight back to polling. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
Closing without merging: this has happened once so far. We'll look at it again if the quota runs out like this 2-3 times. The branch is kept. |
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.
🎯 CI waits drain the REST quota every agent shares
All agents on a machine share one
ghlogin's 5,000 REST requests an hour. When that runs out, everything that needs REST fails, including posting a review.In gh 2.90.0, each
gh run watchrefresh makes at least three REST requests (run, workflow, jobs), plus one annotations request per job still running. A new watch also fetches every job's annotations again. In one 37-minute window that ended with the quota used up, agents spent 57 minutes in total ingh run watch, on a project whose CI runs typically have 39 jobs. That is an estimated 500–1,500 requests. It was not the only cause: two bulk reads used more.deliver recommended
gh run watchfor merge and deploy runs. Its "PR notifications are not the wait" rule also steered agents away fromsubscribe_change_request.🔧 Three ways to wait, chosen by who waits for what
subscribe_change_request, end the turn, verify the current head on wakinggh pr checks --watch --interval 60(GraphQL)actions/runs/<id>request a minute, for at most 45 minutesgh run watchis banned. A rate-limit error stops the wait, isn't retried, and is never read as a CI result.actions/jobs/<id>/logsrequest. The watch brief now returns job ids instead of run ids. Unlikegh run view --log-failed, this doesn't need the whole run to have finished.still running. A later run of the procedure waits for that run and doesn't dispatch the level again.🧩 How this fits the existing rules
neutraland sends no message, and neither does a stuck run. The agent sets one fallback wake (create_heartbeat,maxRuns: 1) about 45 minutes out. If it can't, it uses the watch.$WTand ends with the Next moves block. On waking, the procedure runs again from step 1, and the owner's click still stands.🧪 Testing
gh, 4 cases each. It stops when the run completes, stops after one call on a rate limit, recovers from a 502, and gives up after 9 calls..github/scripts/semver_cmp.py;git diff --checkis clean.📌 Not in this PR
upstream-prstill runsgh pr checks --watchat its default interval. That uses GraphQL, not REST.🤖 Generated with Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.