fix(desktop): stop simple-git custom-binary warning spam on Windows - #79250
fix(desktop): stop simple-git custom-binary warning spam on Windows#79250hernanda-git wants to merge 1 commit into
Conversation
gitFor() opts into simple-git's unsafe.allowUnsafeCustomBinary when the resolved git binary path contains a space (the default Windows install, C:\Program Files\Git\cmd\git.exe). That opt-in trades simple-git's throw for a console.warn emitted on EVERY client construction, and gitFor() is not memoized — the coding rail rebuilds a client on each status poll, so the desktop log filled with hundreds of identical lines that buried real errors. Suppress only that known warning, only for the duration of the construction call, and restore console.warn in a finally so unrelated warnings still surface. Fixes NousResearch#79245
|
Companion fix for the other symptom in the same log excerpt: #79266 (the |
|
Commenting in the context of #80184 (the composite startup-noise report, whose simple-git half duplicates #79245). Reviewed this against current Verification: I reproduced the warning independently: constructing The fix looks right:
Sibling case worth confirming (whole-bug-class check): the unsafe flag on
The common Windows x86 install Either way, this PR correctly fixes the reported spam. Just flagging the sibling case per the repo's "fix the whole bug class" guidance. |
Adapted from NousResearch/hermes-agent PR NousResearch#79250.
|
Superseded by current-main delivery PR #91798. The exact implementation was replayed through GitHub onto current upstream state while preserving @hernanda-git as the Git author: Exact-head receipts: GitHub reports #91798 clean, mergeable, and rebaseable. Closing this stale/conflicting transport PR so one credited delivery owner remains. This is a supersession receipt, not a rejection of the original implementation. |
Fixes #79245
Symptom
On Windows,
hermes desktopfloods the launching terminal with hundreds of identical lines while the app sits idle:Real errors in the same stream (
Error occurred in handler for 'hermes:api') get buried in the noise.Root cause
apps/desktop/electron/git-review-ops.ts→gitFor()deliberately passesunsafe: { allowUnsafeCustomBinary: true }when the resolved git binary pathcontains a space — the default Windows install is
C:\Program Files\Git\cmd\git.exe.That opt-in is correct and is what keeps the Review pane working on Windows
(#54888, #64810), so it must be preserved.
But simple-git's
custom-binary.pluginruns its validation on everyconstruction and simply trades the throw for a warn:
gitFor()is not memoized: it builds a fresh client per call, and it is calledfrom
repoStatus()and the review ops the coding rail polls. One warning perpoll, forever.
The warning carries no information for us —
gitBinis resolved inside theElectron main process from known install locations / PATH, never from renderer or
user input, and we opted in knowingly.
The fix
Suppress only that one known warning, only around the construction call:
console.warnstill passes through;console.warnin afinally, so the patch cannot leak past the call;case is untouched.
The alternative (memoizing
gitFor) would reduce but not eliminate the spam, andwould introduce client-lifetime/cwd-caching questions this bug doesn't warrant.
Tests
Added to
apps/desktop/electron/git-review-ops.test.ts:console.warnis restored afterwards, so an unrelated warning still surfaces.Both fail on
mainand pass with this change:npx tsc -p tsconfig.electron.json --noEmitis clean.Verified on Windows 10 with git at
C:\Program Files\Git\cmd\git.exe.