Skip to content

fix: list PRs without baseRefOid on old gh - #70

Merged
Octember merged 1 commit into
mainfrom
fix/gh-list-base-oid
Sep 1, 2026
Merged

fix: list PRs without baseRefOid on old gh#70
Octember merged 1 commit into
mainfrom
fix/gh-list-base-oid

Conversation

@Octember

@Octember Octember commented Sep 1, 2026

Copy link
Copy Markdown
Owner

Summary

  • Ubuntu's gh 2.45 supports headRefOid but not baseRefOid. Requesting it made gh pr list --json fail, and the sweep logged that as "auth/network down" every minute.
  • List without that field and hydrate base SHAs from gh api repos/.../pulls. Same for stupify review.

Test plan

Made with Cursor

`gh pr list --json baseRefOid` 404s the whole list on 2.45, which made every
sweep look like GitHub was down. Take base SHAs from the pulls REST API instead.

Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread src/sweep/prs.ts
// `gh pr list --json` on Ubuntu's 2.45 gh has headRefOid but not baseRefOid — unknown field → empty
// stdout, which the sweep used to log as "auth/network down". Pull base SHAs from REST instead.
function pullBaseOids(slug: string): Map<number, string> | null {
const r = exec('gh', ['api', `repos/${slug}/pulls?state=open&per_page=100`, '--paginate'])

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔴 · conf 0.9 · src/sweep/prs.ts:35

this breaks the large-backlog case this file already protects: gh api --paginate emits one JSON array per REST page, so with >100 open PRs JSON.parse(r.stdout) sees concatenated arrays and the sweep crashes. use gh's slurp mode or otherwise keep one schema-validated JSON value at this boundary.

@Octember
Octember merged commit 25e1322 into main Sep 1, 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