Repository navigation
Bound every synchronous git/ssh call on the main process - #116
Merged
currentbits merged 1 commit intoAug 16, 2026
Merged
Conversation
execFileSync blocks the Electron event loop, agent streaming included. Only push opted into a timeout; diff, listFiles, sync info, repo info, merge and the ssh variants of those had none, so a hung filesystem or an unreachable remote froze the whole app — the prStatus failure class, never generalized. ssh.js execCommand is now the single choke point: it defaults timeout to SYNC_TIMEOUT_MS (15s), and worktrees gitOut/gitTry route through it instead of execFileSync. Caller-supplied timeouts still win (push keeps 30s); services gitFetch/gitPull pass 60s since network git is honestly slower. Co-Authored-By: Claude Opus 5 <[email protected]>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
currentbits
deleted the
coder/synchronous-git-on-the-main-process-even-d0e336
branch
October 3, 2026 16:07
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #88.
execFileSyncblocks the Electron main-process event loop — agent streaming and every window with it. Onlypushopted into a timeout, sodiff,listFiles, sync info, repo info,mergeand the ssh variants of all of them ran unbounded: one hung filesystem or unreachable remote froze the whole app. Same failure class as theprStatusfreeze already indocs/ISSUES.md, which was fixed at one call site and never generalized. (sshConnectTimeout=10bounds the connect, not the command.)What changed
electron/ssh.js—execCommanddefaultstimeoutto a newSYNC_TIMEOUT_MS(15s) when the caller did not set one. One choke point instead of a guard per call site.electron/worktrees.js—gitOut/gitTryroute throughexecCommandinstead of callingexecFileSyncdirectly, so they inherit that default. Local and remote git are now bounded by the same line.electron/services.js—gitFetch/gitPullpass an explicit 60s; network git is legitimately slower than local, and the 15s default would have broken them.pushkeeps its explicit 30s, andgitTry.timedOutalready keys onETIMEDOUT, which is whatexecFileSyncthrows on a timeout kill (verified).Verification
electron/test/ssh.test.js: default applied locally, default applied over ssh, caller override wins, andgitTryinherits it. Mutation-checked — deleting the default line fails 3 of them.Not done
Moving the hot IPC paths (
diff,listFiles) to async spawn. 15s is a bounded freeze, not no freeze — that is a larger change than a bound, and is called out as a remainder in thedocs/ISSUES.mdentry.🤖 Generated with Claude Code