GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add CI watch script, API budget rules and /code-review note for agents by mikolalysenko · Pull Request #1164 · SocketDev/socket-patch

Conversation

@mikolalysenko

@mikolalysenko Mikola Lysenko (mikolalysenko) commented Oct 8, 2026 •
edited by cursor Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Collaborator

What

  • scripts/ci-watch.sh: a quiet event stream of a PR's CI, for Claude Code's Monitor tool (it also works in a terminal). It prints a start summary, fail: <check> for each failed check, progress: counts, queue: position changes, and a final DONE ... line. Exit status is 0 for pass/merged and 1 for fail/closed/dequeued. --merge follows the PR through the merge queue.
    • Cheap to run: each poll (every 2 minutes) is one small GraphQL query for the PR's rollup state. The full check list, several pages for a PR here, is fetched only when that state changes or every 5th poll. A rate-limited poll pauses 10 minutes.
  • AGENTS.md:
    • Wait on CI by running the script under Monitor, not with sleep + gh pr checks loops or /loop.
    • Run /code-review high (and --fix) before a PR leaves draft or enters the merge queue. Use --comment when reviewing someone else's PR.
    • New section, Share the GitHub API budget: check x-ratelimit-remaining before bulk reads, cap pagination and parallelism, stop on rate-limit errors, and keep at most one re-check reminder per PR.

Why

Every agent and routine calls GitHub as one account and shares one 5,000/hour budget. On 2026-10-08 a bulk Actions fetch by the new CI profiler, plus ~18 concurrent agent sessions, ran that budget to zero twice in one evening, and every agent stalled. The cloud routines' prompts got the same budget rules separately; this PR puts them where every agent reading this repo will see them.

Testing

  • shellcheck clean.
  • First version run against live PRs: Fix npm wrapper running the glibc binary on musl (#974) #976 (merged) and Remove apply.lock when a lock-holding run is interrupted (#808) #1030 (merged during the test) each printed a summary and DONE merged. Fix Poetry/PDM vendored re-vendor to superseding patch (#1136) #1137 (in the queue, --merge) printed queue: entered at 1 awaiting_checks, then stayed silent.
  • The rollup-gated polling and the rate-limit pause were added after that and have not been run live. Neither have the pending-check and fail: paths: no PR had pending checks during testing.

🤖 Generated with Claude Code


Note

Low Risk
Documentation and a local gh helper script only; no changes to application runtime, auth, or data paths.

Overview
Adds scripts/ci-watch.sh, a quiet CI/merge-queue event stream for Monitor (or a terminal): rollup-gated GraphQL polls, full gh pr checks only when status changes or every 5th poll, fail:/progress:/queue: lines, 10-minute pause on rate limits, and exit codes for pass/fail/merged/dequeued.

AGENTS.md now tells agents to use that script instead of sleep/gh pr checks loops, run /code-review high (and --fix / --comment) before leaving draft or entering the merge queue, and follow shared GitHub API budget rules (check x-ratelimit-remaining, cap pagination/parallelism, stop on 403/429, one re-check reminder per PR).

Reviewed by Cursor Bugbot for commit fd1987d. Configure here.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Mikola Lysenko (mikolalysenko) and others added 2 commits October 8, 2026 16:16
@mikolalysenko @claude
Add scripts/ci-watch.sh and agent notes for CI monitors and /code-review
48fa9e5
scripts/ci-watch.sh turns a PR's CI into a quiet event stream meant for
Claude Code's Monitor tool: a start summary, one line per failed check,
progress counts, merge-queue position, and a final DONE line with an exit
status (0 pass/merged, 1 fail/closed/dequeued). It reads checks through
`gh pr checks`, which pages past the ~400-550 checks a PR here runs, and
reports passes as counts so a monitor isn't flooded.

AGENTS.md now tells agents to wait on CI with that script under Monitor
rather than sleep/gh polling loops, and to run /code-review high (with
--fix) before a PR leaves draft or enters the merge queue.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@mikolalysenko @claude
Poll CI cheaply and add a shared API budget rule
fd1987d
ci-watch.sh now reads only the PR's rollup state each poll (one small
GraphQL query, every 2 minutes) and fetches the full check list, which
is several pages for a PR here, only when that state changes or every
5th poll. A rate-limited poll pauses 10 minutes instead of retrying.

AGENTS.md gains a "Share the GitHub API budget" section. Every agent and
routine calls GitHub as one account, and on 2026-10-08 a bulk Actions
fetch plus ~18 concurrent sessions ran the shared 5,000/hour quota to
zero twice in one evening.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@mikolalysenko Mikola Lysenko (mikolalysenko) changed the title Add CI watch script and agent notes for Monitor and /code-review Add CI watch script, API budget rules and /code-review note for agents Oct 8, 2026
@mikolalysenko
Mikola Lysenko (mikolalysenko) marked this pull request as ready for review October 10, 2026 13:13
cursor[bot]
cursor Bot reviewed Oct 10, 2026
View reviewed changes

@cursor cursor Bot left a comment •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.

Fix All in Cursor

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: Watch script can exit too early
    • Added check for terminal statusCheckRollup.state (SUCCESS/FAILURE/ERROR) before exiting to prevent premature exit when checks are expected but not yet created or when draft jobs are skipped.

Create PR

Or push these changes by commenting:

@cursor push cd1fb43bf9
Preview (cd1fb43bf9)
diff --git a/scripts/ci-watch.sh b/scripts/ci-watch.sh
--- a/scripts/ci-watch.sh
+++ b/scripts/ci-watch.sh
@@ -101,8 +101,12 @@
 
   if [ "$merge" = 0 ]; then
     if [ "$total" -gt 0 ] && [ "$pending" = 0 ]; then
-      if [ "$fail" = 0 ]; then echo "DONE checks pass ($total checks)"; exit 0; fi
-      echo "DONE checks fail ($fail of $total failed)"; exit 1
+      case "$rollup" in
+        SUCCESS|FAILURE|ERROR)
+          if [ "$fail" = 0 ]; then echo "DONE checks pass ($total checks)"; exit 0; fi
+          echo "DONE checks fail ($fail of $total failed)"; exit 1
+          ;;
+      esac
     fi
   fi
   sleep "$interval"

You can send follow-ups to the cloud agent here.

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit fd1987d. Configure here.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread scripts/ci-watch.sh Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread scripts/ci-watch.sh Resolved

Uh oh!

There was an error while loading. Please reload this page.

@mikolalysenko
Mikola Lysenko (mikolalysenko) enabled auto-merge October 10, 2026 13:34
@mikolalysenko @claude
ci-watch: wait for a terminal rollup and back off on checks rate limits
7308f20
Only report DONE when the statusCheckRollup is SUCCESS/FAILURE/ERROR as
well as the gh pr checks list having no pending entries, so expected or
not-yet-created checks keep the watch running. A failed gh pr checks
call now keeps the previous counts, retries on the next poll, and pauses
10 minutes when its stderr shows a rate limit.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@mikolalysenko Mikola Lysenko (mikolalysenko) added the Ready for review Agent-verified: mergeable, CI green, Bugbot clean — awaiting human review label Oct 10, 2026
Tanmay182003
Tanmay Singla (Tanmay182003) approved these changes Oct 10, 2026
View reviewed changes
@mikolalysenko
Mikola Lysenko (mikolalysenko) added this pull request to the merge queue Oct 10, 2026
Merged via the queue into main with commit 5d6efbc Oct 10, 2026
53 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@mikolalysenko
Mikola Lysenko (mikolalysenko) deleted the agents/ci-monitor-code-review branch October 10, 2026 17:41
@mikolalysenko Mikola Lysenko (mikolalysenko) mentioned this pull request Oct 11, 2026
CI perf (settings): merge queue builds 5 entries at a time — a 13-PR burst took 100 min to drain on a 21-min CI run (~21 min per PR past the 5th) #1248
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@cursor cursor[bot] cursor[bot] left review comments
@Tanmay182003 Tanmay Singla (Tanmay182003) Tanmay182003 approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

Ready for review Agent-verified: mergeable, CI green, Bugbot clean — awaiting human review

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@mikolalysenko @Tanmay182003
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.