Skip to content

fix(ci): bound hosted gate workflow pagination#100332

Merged
steipete merged 1 commit into
mainfrom
codex/fix-hosted-gate-pagination
Jul 5, 2026
Merged

fix(ci): bound hosted gate workflow pagination#100332
steipete merged 1 commit into
mainfrom
codex/fix-hosted-gate-pagination

Conversation

@steipete

@steipete steipete commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where maintainers landing a pull request could exhaust the shared GitHub REST API quota when the hosted-gate verifier followed an unbounded workflow-runs pagination chain.

Why This Change Was Made

The verifier now fetches workflow-run pages explicitly, repeating the exact head SHA on every request and stopping at GitHub's documented 1,000-result search window. This preserves complete gate evidence while bounding API use.

User Impact

No product behavior changes. Maintainer PR preparation remains complete and no longer risks consuming an hourly API quota in one run.

Evidence

@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: S maintainer Maintainer-authored PR labels Jul 5, 2026
@clawsweeper

clawsweeper Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 5, 2026, 11:48 AM ET / 15:48 UTC.

Summary
The PR replaces the hosted gate verifier's gh api --paginate --slurp workflow-runs fetch with bounded per-page requests and adds focused parser/pagination tests.

PR surface: Tests +9, Other +26. Total +35 across 2 files.

Reproducibility: no. live quota exhaustion was reproduced in this read-only review. Source inspection shows current main asks gh api --paginate to follow all workflow-run pages for the head SHA, and the CLI/API contract supports the bounded-pagination concern.

Review metrics: 1 noteworthy metric.

  • Hosted-gate fetch path: 1 API pagination path changed. This path decides which exact-head CI/Testbox runs are accepted during maintainer landing, so the automation boundary is worth calling out separately from file count.

Stored data model
Persistent data-model change detected: serialized state: scripts/verify-pr-hosted-gates.mjs. Confirm migration or upgrade compatibility proof before merge.

Merge readiness
Overall: 🦞 diamond lobster
Proof: 🦞 diamond lobster
Patch quality: 🦞 diamond lobster
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Risk before merge

  • [P1] At last live check, several CI jobs for current head 6ef1068cd175b2ab1626e58da3b490882a30c322 were still in progress, so maintainer landing should wait for required exact-head gates even though no patch-level defect surfaced.

Maintainer options:

  1. Decide the mitigation before merge
    Land the bounded pagination fix through normal maintainer gates once current-head required checks and prepare-run evidence are acceptable, keeping hosted gate evidence centralized in scripts/verify-pr-hosted-gates.mjs.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • No automated repair is needed; this protected-label PR should stay open for maintainer landing once current-head gates are acceptable.

Security
Cleared: The diff changes a repository script's GitHub API pagination arguments and tests only; no new third-party code, secret handling, permissions, or supply-chain surface was introduced.

Review details

Best possible solution:

Land the bounded pagination fix through normal maintainer gates once current-head required checks and prepare-run evidence are acceptable, keeping hosted gate evidence centralized in scripts/verify-pr-hosted-gates.mjs.

Do we have a high-confidence way to reproduce the issue?

No live quota exhaustion was reproduced in this read-only review. Source inspection shows current main asks gh api --paginate to follow all workflow-run pages for the head SHA, and the CLI/API contract supports the bounded-pagination concern.

Is this the best way to solve the issue?

Yes. The PR fixes the narrow owner path by replacing the verifier's unbounded page walker, while leaving the downstream exact-head evidence selection unchanged and covered by focused tests.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against a308e3b83429.

Label changes

Label justifications:

  • P2: This is a normal-priority maintainer CI tooling fix with limited product-runtime blast radius.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): Terminal-style proof in the PR body/comments covers the verifier path with Testbox, check:changed, exact-head CI, and prepare-run evidence, and the current head keeps the same changed blobs as the proof-reviewed head.
  • proof: sufficient: Contributor real behavior proof is sufficient. Terminal-style proof in the PR body/comments covers the verifier path with Testbox, check:changed, exact-head CI, and prepare-run evidence, and the current head keeps the same changed blobs as the proof-reviewed head.
Evidence reviewed

PR surface:

Tests +9, Other +26. Total +35 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 13 4 +9
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 33 7 +26
Total 2 46 11 +35

What I checked:

  • Current main still has the old pagination path: Current main loads workflow runs with gh api ... --paginate --slurp and parses all returned pages before collecting hosted gate evidence. (scripts/verify-pr-hosted-gates.mjs:222, a308e3b83429)
  • PR implementation bounds the page walk: The PR branch fetches page 1, computes a capped page count from total_count, repeats head_sha and page on each request, and appends only those bounded pages. (scripts/verify-pr-hosted-gates.mjs:235, 6ef1068cd175)
  • Focused regression coverage was added: The updated test verifies the new single-page parser and the 0, 101, and 10,000 result page-count cases, including the 10-page cap. (test/scripts/verify-pr-hosted-gates.test.ts:398, 6ef1068cd175)
  • Caller boundary is centralized: scripts/pr-lib/gates.sh calls scripts/verify-pr-hosted-gates.mjs from run_hosted_prepare_gates, so the fix lands at the central hosted exact-head gate verifier rather than duplicating logic elsewhere. (scripts/pr-lib/gates.sh:1, a308e3b83429)
  • API and CLI contract check: gh help api says --paginate sequentially requests pages until none remain and --slurp wraps all pages; GitHub's official workflow-runs docs say filtered workflow-run searches using head_sha return up to 1,000 results. (docs.github.com)
  • Real behavior proof was reviewed: The PR body and comments report focused Testbox tests, pnpm check:changed, fresh autoreview, exact-head CI, and OPENCLAW_TESTBOX=1 scripts/pr prepare-run 100332; the changed verifier/test blobs are identical between proof head ff3e1bf586e145a33e20e82a2d4a4a91c874fbc4 and current head 6ef1068cd175b2ab1626e58da3b490882a30c322. (6ef1068cd175)

Likely related people:

  • steipete: Peter Steinberger authored the current PR and also appears in the merged history for the hosted exact-head gate verifier/caller path, including the adjacent merged PR that introduced this tooling surface. (role: recent area contributor; confidence: high; commits: 4a2629ebe36c, 14eb460dd21a, 6ef1068cd175; files: scripts/verify-pr-hosted-gates.mjs, scripts/pr-lib/gates.sh, test/scripts/verify-pr-hosted-gates.test.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
Review history (3 earlier review cycles)
  • reviewed 2026-07-05T13:35:57.236Z sha 0665349 :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-05T14:02:11.139Z sha 604790f :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-05T15:01:32.466Z sha ff3e1bf :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P2 Normal backlog priority with limited blast radius. labels Jul 5, 2026

steipete commented Jul 5, 2026

Copy link
Copy Markdown
Contributor Author

Land-ready at 0665349b6ab6bec80148bf3897fd9aa050a61bc8.

Proof:

No known proof gaps. Internal CI/landing tooling only; no changelog required.

@steipete
steipete force-pushed the codex/fix-hosted-gate-pagination branch from 0665349 to 604790f Compare July 5, 2026 13:51

steipete commented Jul 5, 2026

Copy link
Copy Markdown
Contributor Author

Rebased land-ready proof for exact head 604790f1b87c46fe01bc14e10674c1f83f387a66:

  • Blacksmith Testbox tbx_01kws6dks482rv1pbv7erbnvkp: focused verifier tests, 18 passed
  • same Testbox: tooling check:changed lane passed
  • fresh Codex autoreview clean (patch_correct 0.97)
  • exact-head GitHub CI: CI 30/30 plus Workflow Sanity, CodeQL, OpenGrep, and Periphery passed
  • review artifacts reinitialized and validated against this head

No remaining proof gaps. Proceeding through the repository landing wrapper.

@steipete
steipete force-pushed the codex/fix-hosted-gate-pagination branch from 604790f to c6d19b3 Compare July 5, 2026 14:42

steipete commented Jul 5, 2026

Copy link
Copy Markdown
Contributor Author

Final exact-head refresh: c6d19b326f5f35dbe8694ae10ab14f21d8bfeb33 is fully green (CI 30/30, Workflow Sanity, CodeQL, OpenGrep, Periphery). Review artifacts are validated against this head; prior focused Testbox and fresh autoreview evidence remains unchanged. Proceeding directly through prepare-run and merge-run.

@steipete
steipete force-pushed the codex/fix-hosted-gate-pagination branch from c6d19b3 to ff3e1bf Compare July 5, 2026 14:52
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Jul 5, 2026

steipete commented Jul 5, 2026

Copy link
Copy Markdown
Contributor Author

Exact-head CI retry is green for ff3e1bf586e145a33e20e82a2d4a4a91c874fbc4.

Attempt 1 had one QA timing failure in unrelated native-command-session-target: /stop acknowledged, but its recovery reply arrived 0.56s after the 60s assertion deadline. The immediately previous exact head completed the same recovery in 0.85s. The failed-job rerun passed, leaving CI 30/30 green; Workflow Sanity, CodeQL, OpenGrep, and Periphery are also green. No verifier-path failure occurred.

@steipete
steipete force-pushed the codex/fix-hosted-gate-pagination branch from ff3e1bf to 6ef1068 Compare July 5, 2026 15:42
@steipete

steipete commented Jul 5, 2026

Copy link
Copy Markdown
Contributor Author

Exact-head hosted proof is green on 6ef1068cd175b2ab1626e58da3b490882a30c322 after the final rebase onto current main.

  • CI: 30/30 jobs passed, including QA Smoke CI.
  • Workflow Sanity, CodeQL, OpenGrep PR Diff, and iOS Periphery all passed.
  • Focused Blacksmith Testbox verifier tests: 18/18 passed on tbx_01kws6dks482rv1pbv7erbnvkp.
  • Tooling check:changed and final Codex autoreview were clean.

The repo-native review artifacts validate for this exact PR head; ready for the merge wrapper.

@steipete
steipete merged commit 286d0b9 into main Jul 5, 2026
81 checks passed
@steipete
steipete deleted the codex/fix-hosted-gate-pagination branch July 5, 2026 15:55
@steipete

steipete commented Jul 5, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. scripts Repository scripts size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant