You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Talk to GitHub through its API instead of the gh CLI (account per host, saved token, GHE) #1528
Every PR operation shells out to gh (electron/worktrees-pr.js:36, prWorkspace.jsgh pr view, the refresher). The costs: one process per poll per thread, gh must be installed and logged in, the wrong account gets picked on multi-account machines, and GHE is unsupported (see the polling-hygiene issue).
Proposal (M):
A small GitHub REST/GraphQL transport. It gets its token from gh auth token --hostname <host> when available (so nothing changes for existing users), or from a token saved in the OS keychain via Settings.
Choose the account per host in Settings › Source control.
Batch the refresher: one GraphQL query for all open PRs in a repo instead of gh pr view per thread.
Keep gh as the fallback during migration. Route the outbound secret scan over the new path too.
This is also the abstraction GitLab (#193) should plug into later.
Part 1 is on branch coder/talk-to-github-through-its-api-instead-o-04dd2a (d1ecfc69).
New electron/github.js. It gets a token from gh auth token --hostname <host> (cached per host, cleared on a 401 and on Settings › Rescan), sends GraphQL over fetch, and supports GHE via https://<host>/api/graphql.
The refresher now sends one GraphQL query per repo, up to 50 PRs per request, instead of one gh pr view per thread. If there's no token or the API fails, it falls back to the old per-thread gh call. CODER_GITHUB_API=0 forces gh.
Live check against this repo: 3 PRs in one request, 508 ms. A nonexistent PR number is skipped and doesn't fail the batch.
Split out: #1533 (account per host and a saved token; the keychain is blocked by the safeStorage ACL problem described in secrets.js) and #1534 (moving the interactive PR and issue operations onto the transport, with the outbound secret scan on that path).
PR #1550 is open. It's rebased onto current main as one commit (87b4f31) and closes #1528, #1533 and #1534 when merged. Ported onto main's split modules: worktrees-pr.js, ipc-app.js, the store-* modules and settings/GitPane.tsx. The batched refresher now sits alongside PR watch-and-wake (#1493). Tests: renderer 2916/0, electron 4407/0, vite build succeeds.
PR #1550 is open. It's rebased onto current main as one commit (87b4f31) and closes #1528, #1533 and #1534 when merged. Ported onto main's split modules: worktrees-pr.js, ipc-app.js, the store-* modules and settings/GitPane.tsx. The batched refresher now sits alongside PR watch-and-wake (#1493). Tests: renderer 2916/0, electron 4407/0, vite build succeeds.
Activity
currentbits commentedon Oct 9, 2026
Part 1 is on branch
coder/talk-to-github-through-its-api-instead-o-04dd2a(d1ecfc69).electron/github.js. It gets a token fromgh auth token --hostname <host>(cached per host, cleared on a 401 and on Settings › Rescan), sends GraphQL overfetch, and supports GHE viahttps://<host>/api/graphql.gh pr viewper thread. If there's no token or the API fails, it falls back to the old per-threadghcall.CODER_GITHUB_API=0forcesgh.Split out: #1533 (account per host and a saved token; the keychain is blocked by the safeStorage ACL problem described in
secrets.js) and #1534 (moving the interactive PR and issue operations onto the transport, with the outbound secret scan on that path).currentbits commentedon Oct 9, 2026
All four parts are on branch
coder/talk-to-github-through-its-api-instead-o-04dd2a, which isn't pushed or open as a PR yet:electron/github.js), with tokens from gh, the chosen account, or a saved token — d1ecfc69 / bcab6b1cgh pr viewper thread — d1ecfc69gh pr checkoutdeliberately stays on gh.A join test (26eac0bc) confirms that a token saved in Settings authenticates interactive PR actions.
Merged tree: typecheck clean; renderer tests 2693/0; electron tests 4136/0 with a CI-style env.
Separate pre-existing gap, not part of this work: issue comments and creates have never been secret-scanned. Filed as a suggested follow-up.
currentbits commentedon Oct 9, 2026
PR #1550 is open. It's rebased onto current main as one commit (87b4f31) and closes #1528, #1533 and #1534 when merged. Ported onto main's split modules:
worktrees-pr.js,ipc-app.js, thestore-*modules andsettings/GitPane.tsx. The batched refresher now sits alongside PR watch-and-wake (#1493). Tests: renderer 2916/0, electron 4407/0,vite buildsucceeds.currentbits commentedon Oct 9, 2026
PR #1550 is open. It's rebased onto current main as one commit (87b4f31) and closes #1528, #1533 and #1534 when merged. Ported onto main's split modules:
worktrees-pr.js,ipc-app.js, thestore-*modules andsettings/GitPane.tsx. The batched refresher now sits alongside PR watch-and-wake (#1493). Tests: renderer 2916/0, electron 4407/0,vite buildsucceeds.Talk to GitHub through its API instead of the gh CLI (#1528)
Talk to GitHub through its API instead of the gh CLI (#1528)