Skip to content

Page the REST pulls list by hand instead of --paginate - #72

Merged
Octember merged 1 commit into
mainfrom
fix/rest-pulls-page-by-hand
Sep 7, 2026
Merged

Page the REST pulls list by hand instead of --paginate#72
Octember merged 1 commit into
mainfrom
fix/rest-pulls-page-by-hand

Conversation

@Octember

@Octember Octember commented Sep 7, 2026

Copy link
Copy Markdown
Owner

Why

The bevyl reviewer (stupify-bevyl-ai-bevyl-ai) has logged gh api pulls failed (auth/network down?) — aborting sweep every minute since 2026-09-03 02:47Z, right after the #71 bundle landed. No PR on bevyl-ai/bevyl.ai has been reviewed since.

The failing call is the REST base-SHA fetch #70 added:

gh api "repos/bevyl-ai/bevyl.ai/pulls?state=open&per_page=100" --paginate

Page 1 comes back fine through the exe.dev proxy. Its Link header is <https://github.com/ghapi/repositories/1023932389/pulls?...&page=2>; rel="next", and gh --paginate follows that URL verbatim, so page 2 bypasses GH_HOST, hits github.com/ghapi with no credentials, and 404s. gh exits 1, pullBaseOids returns null, the sweep aborts. Only a repo with more than 100 open PRs has a page 2, so the other five VMs never saw it (bevyl has 135).

Reproduced on the VM: the same URL with &page=2 and no --paginate returns the remaining 35 PRs; the Link URL fetched directly returns 404.

What

  • Loop page=1..N with explicit per_page/page params until a short page. No --paginate.
  • Log gh's first stderr line when the call fails, matching the gh pr list branch. The old branch logged a fixed string and swallowed the real error, which is why this took five days to read.

Deployed the bundle from this branch to stupify-bevyl-ai-bevyl-ai (backup at review-sweep.ts.bak-pre-paginate-fix). The other VMs are still on the Sep 1 bundle and should get this once merged.

`gh api --paginate` follows GitHub's Link header verbatim, and that header
names github.com/ghapi. Behind an exe.dev GH_HOST proxy the second page
therefore escapes the proxy, goes out unauthenticated, and 404s the whole
call, so pullBaseOids returned null and every sweep aborted. Only a repo
with more than 100 open PRs ever has a second page, which is why this hit
bevyl (135 open) for five days and no other VM.

Ask for page=N explicitly instead, and log gh's first stderr line on
failure the way the gh pr list branch already does, so the next time this
call dies the log says why.

@exe-dev-github-integration exe-dev-github-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM ✅

@Octember
Octember merged commit 03e95bc into main Sep 7, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant