Skip to content

Take resolveThreadGit and the default-branch lookup off sync git on the PR read paths (closes #228) - #230

Merged
currentbits merged 8 commits into
mainfrom
coder/sync-local-git-remains-in-resolvethreadg-f3a349
Aug 17, 2026
Merged

currentbits merged 8 commits into
mainfrom
coder/sync-local-git-remains-in-resolvethreadg-f3a349

Conversation

@currentbits

@currentbits currentbits commented Aug 17, 2026 •

Copy link
Copy Markdown
Owner

Closes #228.

What this is now

This branch originally also converted the synchronous gh on the PR read paths, because at the time it was cut origin/main still had sync ghTry at a 30s bound — contrary to what #228's body claimed. #229 has since landed and finished exactly that work, so the overlapping half was dropped in favour of main's version during the merge.

What is left is precisely the remainder #228 was filed for, and it is still missing from main: the PR read paths call resolveThreadGit, which does two synchronous local git calls (branch --show-current, remote get-url origin), and createPr resolves its base through the synchronous defaultBranch.

Changes

electron/worktrees.js

  • resolveThreadGit → async, on the existing gitOutAsync / gitTryAsync. Every error message and throw condition is byte-identical; the try/catch shape around the branch lookup is preserved by using gitOutAsync (which throws) rather than the Try variant.
  • new defaultBranchAsync, used by createPr. The synchronous defaultBranch stays exactly as it is — setupWorktree, mergeWorktree and the orphan sweep still call it and are deliberately blocking.
  • listPrs had one straggler sync gitTry for remote get-url origin; now gitTryAsync.
  • await added at all five call sites (prStatus, prChecks, mergePr, refreshPrStates, createPr). All five were already async, so no signature outside this file changes and electron/ipc.js needs no edit.
  • The ponytail: note on sync gitOut now names the write flows it actually covers, states its ceiling, and points at the CODER_LOOP_LAG probe as the trigger for converting further — the measure-first method App beachballs when multiple threads run concurrently #124 established.

electron/test/list-prs.test.js

  • one regression test: the PR read helpers and defaultBranchAsync are AsyncFunction, and defaultBranch is still a plain Function so the write-path split does not silently erode.

Sync git in this file is now confined to the worktree write flows plus createPr's ahead-of-base git log check.

Verification

  • npm run typecheck — clean.
  • npm run test:electron — 861 tests, 850 pass, 11 fail. Baseline on origin/main (79a1e52) in an identical worktree: 860 tests, 849 pass, the same 11 failures (orch-server / MCP-over-socket, environment-dependent, untouched here). Net: +1 test, no new failures.
  • npm run test:renderer — 724/724 pass.

Not done

Willem added 7 commits August 17, 2026 11:46
… Web mode silently drops image attachments; the button just d
Convert electron tests for resolveThreadGit/listPrs/prStatus/prChecks/createPr/mergePr going async: await every call site, turn assert.throws into assert.rejects, and add a small AsyncFunction regression on the three read paths.
Convert resolveThreadGit, listPrs, prStatus, and prChecks to async
gitTryAsync/ghTryAsync so tab render and poll cannot freeze the UI.
createPr and mergePr become async only to await those helpers; their
write-path ghTry, push, and gitTry stay synchronous on purpose.
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@currentbits currentbits changed the title Make the PR read paths non-blocking (closes #228) Make the GitHub PR read paths non-blocking in the Electron main process (closes #228) Aug 17, 2026
…remainder

origin/main (#229) finished the sync-gh work this branch had duplicated, so
the overlapping half is dropped in favour of main's. What survives is exactly
what #228 asked for and main still does not have: resolveThreadGit and the
project default-branch lookup off sync git on the PR read paths.
@currentbits currentbits changed the title Make the GitHub PR read paths non-blocking in the Electron main process (closes #228) Take resolveThreadGit and the default-branch lookup off sync git on the PR read paths (closes #228) Aug 17, 2026
@currentbits
currentbits merged commit c862c1b into main Aug 17, 2026
1 check failed
@currentbits
currentbits deleted the coder/sync-local-git-remains-in-resolvethreadg-f3a349 branch October 3, 2026 16:07
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.

Sync local git remains in resolveThreadGit / defaultBranch on the PR read paths

1 participant