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
fix(windows): hide console windows from the update signature check and OpenCode preflight - #52063
On Windows, Orca sometimes made black command-prompt windows pop up for a moment. One showed up while Orca checked that a downloaded update was really signed by us. Others showed up while Orca checked OpenCode before starting it. This fix tells Windows to run those background helpers without a window. They do the same work, but nothing flashes on screen.
What Changed
Update signature check. New file config/patches/[email protected], registered in pnpm-workspace.yaml (the patch_hash lines in pnpm-lock.yaml change to match).
Before: electron-updater 6.8.12's windowsExecutableCodeSignatureVerifier.js runs Get-AuthenticodeSignature with execFile(..., { shell: true, timeout }) and no windowsHide. Electron's main process has no console, so cmd.exe and the powershell.exe it starts each opened a visible console window.
After: the patch adds one line, windowsHide: true, to the options in preparePowerShellExec. Nothing else in the file changes: shell: true, the arguments and escaping, and the Status, path and publisher checks are byte-for-byte the same. The handleError fallback uses the same options, so it is covered too.
Before: the unsupervised spawnProcess call, which only runs on Windows, passed detached: true. libuv turns that into DETACHED_PROCESS, and Windows ignores CREATE_NO_WINDOW when that flag is set. So opencode serve had no console at all, and every console program it started (including the native binary started by OpenCode's npm launcher) opened its own visible window.
After: the flag is removed. The child gets the hidden console that windowsHide provides (the spawnProcess default), and its own child processes inherit that hidden console. The flag is removed outright instead of made conditional, because createProviderSpawnSpec sets supervised = platform !== 'win32', so this branch only runs on Windows. The POSIX supervised path (spawnProviderProcess) still detaches and does not change.
Why
Fixes visible console windows popping up in two background flows on Windows. Upstream electron-updater 7 already uses windowsHide: true (builder-util-runtime/src/authenticodeSignature.ts). Until Orca moves to it, a one-line pnpm patch is the smallest fix and keeps the built-in Authenticode check. Orca must never override verifyUpdateCodeSignature. The patch is pinned to the exact version 6.8.12. pnpm's default allowUnusedPatches: false makes install fail on a version bump until the patch is redone or dropped, so it cannot quietly go stale. detached: true in the preflight was left over from #42760, when one spawn call served both platforms.
N/A for screenshots. The window only flashes for a moment, so the proof is a Windows probe that checks the console window directly. Each probe runs from a parent process with no console, the same way Electron runs when started from Explorer. A PowerShell grandchild then reports GetConsoleWindow / IsWindowVisible. Real Windows host, Node v24.18.0:
Ran the real electron-updater verifier on Windows, unpatched and then patched, against a signed node.exe. In both cases the correct publisher was accepted (585 ms unpatched, 531 ms patched) and a wrong publisher was rejected with the usual failure string. The only difference in the execFile options was windowsHide: true.
A throwaway vitest (not committed) that stubs win32 checks that the preflight child is not detached. It fails on main and passes on this branch. No regression test was committed because it would only check a spawn flag or a line in a third-party file.
Patch integrity: the patch's index hash matches the unmodified 6.8.12 file. A diff -r of the unpatched and patched packages shows only that one line. The lockfile changes only the patch_hash lines; no version or integrity changes.
vitest run src/main/opencode src/main/updater src/main/provider-process: 12 files, 38 tests passed.
oxlint, oxfmt, anti-slop oxlint, native-plugin oxlint, ast-grep and the changed-code quality gate are all clean.
Platforms: Windows for the behavior. macOS for unit tests and to confirm the POSIX path is unchanged.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
Every added test fails without this change and avoids the test anti-patterns
Performance
None, because only process-creation flags change, and only on Windows. The number of spawns is the same (1 before, 1 after), with no new I/O, subprocesses or polling. Neither path is hot: the signature check runs once per downloaded Windows update, and the preflight runs once per OpenCode launch attempt. No renderer or store code changes, so per-tab fan-out does not apply.
Risk
Level: Low
The riskiest part is the dependency patch. It adds one option line and does not touch the signature, path or publisher logic. The Windows run above confirms that verification still accepts the right publisher and rejects a wrong one.
Without the detach, the preflight child joins libuv's kill-on-close job on Windows. A preflight still running (it has a 10 s cap) now ends when Orca exits instead of being left orphaned.
Windows tree teardown (taskkill /T) does not rely on process groups, so it is unaffected.
Reviewed for correctness, security (the dependency patch was read byte by byte) and performance. The root cause was checked against libuv's src/win/process.c.
Agent skill upstream boundary
Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.
Notes
Original fix by theobinomy in #52063. Their authorship is kept on the commit.
Checklist
This PR is small and focused
I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
I stated the risk: what could break, for whom, and how to back it out
Before/after screenshots or videos attached for UI changes, or N/A with reason
Self-reviewed for correctness, security, and performance
Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)
No actionable comments were generated in the recent review.
Walkthrough
The updater patch adds windowsHide: true to the PowerShell process options and is mapped to [email protected] in the workspace configuration. The unsupervised OpenCode child spawn no longer sets detached: true. Its program, arguments, working directory, and environment remain passed to the spawn.
Merge Risk: Minimal · up to 6e5b9 · assessed changes only
Path filters excluded changed files. This rating applies only to the assessed changes.
Pre-merge checks: 4
Check name
Status
Explanation
Linked Issues check
Issue #52051 has two coding requirements. Signature verification must stay enabled, and neither path may show a console window.
The changed files are config/patches/[email protected], pnpm-workspace.yaml, and src/main/opencode/model-launch/opencode-launch-model-context.ts. Each change maps to an objective in #52051…
Title check
The title names the two Windows-only changes: hiding console windows in the update signature check and in the OpenCode preflight. It matches the changeset and the linked issue #52051. It uses the conv…
Description check
The description follows the repository template. It covers ELI5, What Changed (before and after with mechanism), Why, a linked issue (Fixes #52051), Visual Proof (N/A with a reason and a probe output)…
Full details: Linked Issues check
Explanation
Issue #52051 has two coding requirements. Signature verification must stay enabled, and neither path may show a console window.
(1) Update signature check [#52051]: config/patches/[email protected] adds windowsHide: true to the preparePowerShellExec options. Those options feed the shell: true Get-AuthenticodeSignature execFile call. pnpm-workspace.yaml maps the patch to [email protected]. The PR description states that the signature, path, and publisher checks are unchanged.
(2) OpenCode launch model preflight [#52051]: src/main/opencode/model-launch/opencode-launch-model-context.ts sets detached to process.platform !== 'win32'. On Windows the opencode serve child is no longer detached. windowsHide stays on through the spawnProcess default. The new comments state that the Windows path stays attached to avoid separate console windows.
Evidence for (2) comes from the author's reasoning and manual Windows 11 checks described in the PR description. Those checks are not reproduced here, and no automated test covers this behavior. The change matches the expected behavior in the issue. The side effect that the preflight child now ends if Orca exits mid-preflight is disclosed in the PR description and is not a stated requirement violation.
The current-head summary shows the same mechanism as the prior review. The changes since the previous head were not inspected in detail, so this verdict relies on the supplied summary.
Full details: Out of Scope Changes check
Explanation
The changed files are config/patches/[email protected], pnpm-workspace.yaml, and src/main/opencode/model-launch/opencode-launch-model-context.ts. Each change maps to an objective in #52051. The patch adds windowsHide to the signature-check options. The workspace entry registers that patch. The preflight change sets detached per platform. The external editor launch file is intentionally untouched, as the PR description states. pnpm-lock.yaml is excluded by the ignored-files rule. Its absence does not affect this assessment, because the lock file follows from the patch registration. The overlap with PR #43005 on the same patch file is a merge coordination note, not an out-of-scope change. No unrelated change is demonstrated.
Full details: Title check
Explanation
The title names the two Windows-only changes: hiding console windows in the update signature check and in the OpenCode preflight. It matches the changeset and the linked issue #52051. It uses the conventional fix(windows) prefix and is 89 characters long, which is within a reasonable length.
Full details: Description check
Explanation
The description follows the repository template. It covers ELI5, What Changed (before and after with mechanism), Why, a linked issue (Fixes #52051), Visual Proof (N/A with a reason and a probe output), Testing with checked boxes and platforms, Performance with a completed 'None, because' line, Risk with a level and back-out plan, AI Disclosure (left blank, which the template allows for internal contributors), the upstream boundary checkbox, Notes, and the Checklist. The description is detailed and specific. The only gap is that the Risk level and some checklist items are asserted rather than fully evidenced in the description itself, but this does not make the description incomplete.
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
…d OpenCode preflight
electron-updater 6.8.12 verifies the downloaded installer's Authenticode
signature with execFile({ shell: true }) and no windowsHide, so Windows
opened a visible console for cmd.exe and powershell.exe. Patch the
verifier to pass windowsHide: true; the signature, path and publisher
checks are unchanged.
The Windows-only OpenCode launch-model preflight spawned opencode serve
with detached: true. libuv maps that to DETACHED_PROCESS, which overrides
CREATE_NO_WINDOW, so the child had no console and every console program
it started opened its own window. Drop the flag so the child gets the
hidden console. The POSIX supervised path still detaches.
Fixesstablyai#52051
nwparker
changed the title
fix(windows): stop console windows from the update signature check and OpenCode preflight
fix(windows): hide console windows from the update signature check and OpenCode preflight
Nov 28, 2026
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
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.
ELI5
On Windows, Orca sometimes made black command-prompt windows pop up for a moment. One showed up while Orca checked that a downloaded update was really signed by us. Others showed up while Orca checked OpenCode before starting it. This fix tells Windows to run those background helpers without a window. They do the same work, but nothing flashes on screen.
What Changed
config/patches/[email protected], registered inpnpm-workspace.yaml(thepatch_hashlines inpnpm-lock.yamlchange to match).windowsExecutableCodeSignatureVerifier.jsrunsGet-AuthenticodeSignaturewithexecFile(..., { shell: true, timeout })and nowindowsHide. Electron's main process has no console, socmd.exeand thepowershell.exeit starts each opened a visible console window.windowsHide: true, to the options inpreparePowerShellExec. Nothing else in the file changes:shell: true, the arguments and escaping, and the Status, path and publisher checks are byte-for-byte the same. ThehandleErrorfallback uses the same options, so it is covered too.src/main/opencode/model-launch/opencode-launch-model-context.ts.spawnProcesscall, which only runs on Windows, passeddetached: true. libuv turns that intoDETACHED_PROCESS, and Windows ignoresCREATE_NO_WINDOWwhen that flag is set. Soopencode servehad no console at all, and every console program it started (including the native binary started by OpenCode's npm launcher) opened its own visible window.windowsHideprovides (thespawnProcessdefault), and its own child processes inherit that hidden console. The flag is removed outright instead of made conditional, becausecreateProviderSpawnSpecsetssupervised = platform !== 'win32', so this branch only runs on Windows. The POSIX supervised path (spawnProviderProcess) still detaches and does not change.Why
Fixes visible console windows popping up in two background flows on Windows. Upstream electron-updater 7 already uses
windowsHide: true(builder-util-runtime/src/authenticodeSignature.ts). Until Orca moves to it, a one-line pnpm patch is the smallest fix and keeps the built-in Authenticode check. Orca must never overrideverifyUpdateCodeSignature. The patch is pinned to the exact version 6.8.12. pnpm's defaultallowUnusedPatches: falsemakes install fail on a version bump until the patch is redone or dropped, so it cannot quietly go stale.detached: truein the preflight was left over from #42760, when one spawn call served both platforms.Linked Issue
Fixes #52051
Visual Proof
N/A for screenshots. The window only flashes for a moment, so the proof is a Windows probe that checks the console window directly. Each probe runs from a parent process with no console, the same way Electron runs when started from Explorer. A PowerShell grandchild then reports
GetConsoleWindow/IsWindowVisible. Real Windows host, Node v24.18.0:Testing
Ran the real electron-updater verifier on Windows, unpatched and then patched, against a signed
node.exe. In both cases the correct publisher was accepted (585 ms unpatched, 531 ms patched) and a wrong publisher was rejected with the usual failure string. The only difference in theexecFileoptions waswindowsHide: true.A throwaway vitest (not committed) that stubs win32 checks that the preflight child is not detached. It fails on main and passes on this branch. No regression test was committed because it would only check a spawn flag or a line in a third-party file.
Patch integrity: the patch's
indexhash matches the unmodified 6.8.12 file. Adiff -rof the unpatched and patched packages shows only that one line. The lockfile changes only thepatch_hashlines; no version or integrity changes.vitest run src/main/opencode src/main/updater src/main/provider-process: 12 files, 38 tests passed.oxlint, oxfmt, anti-slop oxlint, native-plugin oxlint, ast-grep and the changed-code quality gate are all clean.
Platforms: Windows for the behavior. macOS for unit tests and to confirm the POSIX path is unchanged.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
Every added test fails without this change and avoids the test anti-patterns
Performance
None, because only process-creation flags change, and only on Windows. The number of spawns is the same (1 before, 1 after), with no new I/O, subprocesses or polling. Neither path is hot: the signature check runs once per downloaded Windows update, and the preflight runs once per OpenCode launch attempt. No renderer or store code changes, so per-tab fan-out does not apply.
Risk
Level: Low
taskkill /T) does not rely on process groups, so it is unaffected.patch_hash.Review
Reviewed for correctness, security (the dependency patch was read byte by byte) and performance. The root cause was checked against libuv's
src/win/process.c.Agent skill upstream boundary
Notes
Original fix by theobinomy in #52063. Their authorship is kept on the commit.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)