ci: the hosted light rescue lists in-flight PR runs once per status
The owned-pool sweeper's minute hosted-light pass listed each declared workflow's in-flight pull request runs on its own: 12 workflow files (.github/runners.json on feat-cmux-next, with callers) times 2 statuses, so 24 listings a pass (48 before #35099). They all spend the repository's GITHUB_TOKEN pool, 1,000 requests an hour shared by every workflow; the NEXT nightly's notarization preflight failed on it on 2026-11-04 (run 41790985234).
This lists the repository's queued and in_progress pull request runs once per status (GET /actions/runs?status=…&event=pull_request&created=…) and keeps the runs whose path is a declared workflow file. The same runs are found: the per-workflow endpoint filters on the same workflow file, and a reusable declaration's runs carry their caller's path, which with_callers() already declares. The overflow page rule from #35099 is unchanged (read only when the newest page is full), now per status instead of per workflow and status. Job reads, recovery, the reserve gate and every mutation are unchanged.
Leo's coordinator asked to cut the repository token's calls per hour so the nightly stops failing on "API rate limit exceeded for installation". This is the biggest single consumer found in the measurement.
Performance
| metric | before | after | delta | harness or run link |
|---|---|---|---|---|
| run listings per hosted-light pass | 24 | 2 (3 when in_progress fills a page) | −21 to −22 (−88 to −92%) | tests/test_ci_hosted_light_rescue.py test_one_repository_listing_per_status_covers_every_declared_workflow |
| run listings per hour (one pass a minute) | ~1,440 | ~120-180 | −1,260 to −1,320 | same, × 60 passes |
Pages per status: a 24-minute sample of the last day's runs (12 two-minute windows) puts the repository's pull request runs at about 50 a minute, with about 190 in flight 3-90 minutes after creation, so in_progress takes 1-2 pages and queued 1. Job reads (at most 40 a pass, conditional, so an unchanged run's 304 is free) are untouched here.
Validation: python3 tests/test_ci_hosted_light_rescue.py (56 passed), tests/test_ci_owned_pool_rescue.py (480 passed), tests/test_ci_runner_pools.py (45 passed). No build caches apply: this job compiles nothing.
Prior art: #35099 (reserve gate and full-page overflow, built on), #34807, #35003, #34820, #34508.
🤖 Generated with Claude Code
Agent session: agent session
![Autofix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark-3x.png)
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.