Skip to content

fix(daemon): relocate daemon host image out of the install-dir kill zone - #7473

Merged
Jinwoo-H merged 2 commits into
mainfrom
brennanb2025/relocate-daemon-host-image
Jul 6, 2026
Merged

Jinwoo-H merged 2 commits into
mainfrom
brennanb2025/relocate-daemon-host-image

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Jul 6, 2026 •

Copy link
Copy Markdown
Contributor

Problem

On Windows, terminal daemon sessions don't survive app updates. The terminal daemon was fork()ed with no explicit execPath, so its process image was the install-dir Orca.exe running under ELECTRON_RUN_AS_NODE=1. The NSIS installer's CHECK_APP_RUNNING sweep force-kills any process whose image lives under the install directory — so an update killed the live daemon and every terminal it hosted (including a running Claude process).

Fix

Relocate the daemon's host image out of the install dir. A standalone, version-correct node.exe is staged under %APPDATA%\orca\daemon-host\<appVersion>\, and the daemon is forked from that (execPath = relocated node.exe, execArgv: [], no ELECTRON_RUN_AS_NODE). Its image now lives in userData, outside the installer's kill zone, so it survives updates.

  • Build (afterPack, win32-only): copies the build host's own process.execPath — the official OpenJS-signed Node 24.x node.exe — into resources/daemon-host/node.exe. engines.node="24" pins the build host to the ABI Electron 42 embeds (Node 24.15, NAPI 10) so the relocated host loads node-pty's NAPI conpty.node. Shipping the OpenJS-signed binary means it is validly signed regardless of whether SignPath re-signs nested PEs.
  • Shared runtime module: extracted the version-keyed copy + daemon-pinned GC (from Relocate node-pty ConPTY runtime outside the Windows install dir (fixes update-time terminal loss) #7421) into install-dir-runtime-relocation.ts and reused it for the host. GC only reclaims version dirs that no live daemon pins (via daemon-v<N>.pid appVersion), so a surviving daemon's host is never deleted.
  • Adoption / stale-kill unaffected: process identification matches on daemon-entry/socket/token args and the unchanged entryPath — never the host image name. Verified end-to-end in daemon-health.ts.

Fallback behavior

If no relocated node.exe is present (dev, non-win32, pre-relocation builds), the daemon forks from the current Orca.exe + ELECTRON_RUN_AS_NODE host. This is a "this environment has no install-dir kill zone" path — mac/Linux and dev builds have no NSIS sweep and nothing staged, so they keep launching the daemon the way they always have. It is not a Windows degradation path (see risk #1 for the present-but-unusable case).


Context & handoff — how this differs from the frozen-input work (#7456)

This PR came out of the same production investigation as the frozen-input bug, but fixes a different, more severe failure mode. For an agent picking up either thread:


Tests

  • 23 relocation tests (install-dir-runtime-relocation.test.ts, node-pty-runtime-relocation.test.ts), 3 daemon-host tests, plus contract + electron-builder-config tests covering the staging and the "must be a real node.exe" guard.
  • CI: the release-cut "Verify Windows ConPTY runtime" step now also asserts resources/daemon-host/node.exe is staged.
  • node/cli/web typecheck clean; oxlint + oxfmt clean.

Known risks & accepted limitations

An adversarial audit surfaced these. We are deliberately shipping without a fork-failure fallback — rationale under #1.

  1. Fail-open is presence-only, not "actually-works" — accepted, by decision. The fork uses the relocated host whenever the staged node.exe exists; it does not retry on Orca.exe if that fork fails. Three present-but-unusable cases therefore degrade to the non-persistent in-process LocalPtyProvider (terminals still work — you can type and see output — just no cross-update persistence): (a) AppLocker/WDAC default rules blocking %APPDATA% execution; (b) the staged node.exe quarantined by AV/EDR after the .relocation-complete marker is written (ENOENT at fork); (c) an ABI-incompatible node.exe (daemon starts, then pty.spawn fails). We considered a retry-on-Orca.exe fallback and chose not to add it: it could only prevent a regression for locked-down shops, and it cannot give those environments kill-zone escape anyway — for a non-admin under AppLocker default rules, no path is both execution-allowed and outside the install dir. Terminals stay functional in all three cases.
  2. No observability on the host decision. Nothing logs whether the relocated or fallback host was used, so a silent revert to the buggy path isn't visible in the field. Cheap follow-up (not in this PR): a breadcrumb at the fork + install step.
  3. First update to this build still loses terminals — once. The NSIS sweep runs before the new code executes, so the pre-fix daemon (hosted by Orca.exe) is still killed on the upgrade that ships the fix. Only fixed→fixed updates benefit. Worth a release note.
  4. Security surface (low likelihood). A bare node.exe in user-writable %APPDATA%, forked without an integrity re-check, is a tamper/persistence target and may trip EDR living-off-the-land / publisher-allowlist heuristics. Relocate node-pty ConPTY runtime outside the Windows install dir (fixes update-time terminal loss) #7421 already placed executable native code (conpty.node) in userData, so this is incremental, not novel.

Minor: the ~70 MB copy is synchronous on the first launch after each update (one-time, marker-guarded); downgrade to a pre-fix build leaks daemon-host/<version> dirs (self-heals on the next re-upgrade).

Validation plan

E2E on the next rc: packaged build → install → trigger an update → confirm the daemon + terminals survive. Unit tests can't exercise the NSIS sweep.

The terminal daemon was fork()ed with no explicit execPath, so its process
image was the install-dir Orca.exe run via ELECTRON_RUN_AS_NODE. On Windows,
the NSIS installer's CHECK_APP_RUNNING sweep force-kills processes whose image
lives under the install directory, so an app update killed the live daemon and
every terminal it hosted (including the user's running Claude process).

Relocate the daemon host image out of the install dir: stage a standalone,
version-correct node.exe under %APPDATA%\orca\daemon-host\<appVersion>\ and fork
the daemon from it. The daemon's image now lives in userData, outside the
installer's kill zone, so it survives updates.

Fail-open: if no relocated node.exe is present, fall back to the current
Orca.exe + ELECTRON_RUN_AS_NODE path (zero regression). Adoption and stale-kill
are unaffected — process identification matches on daemon-entry/socket/token
args and the unchanged entryPath, never the host image name.

Build: afterPack stages the build host's own official (OpenJS-signed) Node 24.x
node.exe into resources/daemon-host/node.exe. engines.node="24" pins the build
host to the ABI Electron 42 embeds (Node 24.15, NAPI 10) so the relocated host
loads node-pty's NAPI conpty.node addon. Shipping the OpenJS-signed binary means
it is validly signed regardless of whether SignPath re-signs nested PEs.

Extract the version-keyed copy + daemon-pinned GC shared by the node-pty native
relocation (#7421) into install-dir-runtime-relocation.ts and reuse it for the
host relocation. CI verify step + contract/config tests guard the staging.
@coderabbitai

coderabbitai Bot commented Jul 6, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 69de837c-0356-40f5-8530-fb82b0b83936

📥 Commits

Reviewing files that changed from the base of the PR and between 5af97ea and a836d10.

📒 Files selected for processing (3)
  • src/main/daemon/daemon-host-relocation.ts
  • src/main/daemon/daemon-init.ts
  • src/main/index.ts
✅ Files skipped from review due to trivial changes (1)
  • src/main/index.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/main/daemon/daemon-host-relocation.ts

📝 Walkthrough

Walkthrough

This PR adds a standalone Windows node.exe host for the terminal daemon, stages it during electron-builder packaging into resources/daemon-host, and relocates it at runtime into userData through a shared runtime relocation module. The node-pty runtime relocation logic now uses the shared helper. Daemon startup and fork logic select the relocated node.exe when present, and the workflow and tests add coverage for the new staging and relocation paths.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is detailed, but it misses required template sections like Summary, Screenshots, AI Review Report, Security Audit, and Notes. Add the missing template sections, including a Summary, Screenshots (or No visual change), AI Review Report, Security Audit, and Notes.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: relocating the daemon host image out of the Windows install-dir kill zone.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (4)
src/main/daemon/daemon-host-relocation.ts (1)

40-52: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Consider testing the one-shot installed guard.

installed is set unconditionally before the platform/env checks, so a second call is always a no-op regardless of outcome. This contract isn't directly asserted by the test suite (each test resets modules instead). A quick test calling installRelocatedDaemonHost() twice and asserting only one relocation occurs would lock in this behavior.

config/daemon-host-node-runtime.cjs (2)

10-39: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Consider enforcing the Node-version invariant instead of only documenting it.

The doc comment asserts the staged node.exe is "version-correct by construction" because engines.node pins the build to Node 24.x. But nothing in the code actually verifies process.version against that pin — it only checks the binary is named node.exe and exists. If packaging is ever run under a different local/CI Node version (e.g., a manual electron-builder invocation outside the pinned release-cut.yml workflow, which uses node-version-file: package.json to enforce this), this would silently stage a node.exe with a mismatched NAPI ABI, breaking the daemon at runtime in a way that's hard to diagnose after the fact.

Consider reading engines.node from package.json and asserting process.version satisfies it, failing the build loudly if not.

🛡️ Proposed defensive check
+const { readFileSync } = require('node:fs')
+const semver = require('semver')
+
+function assertExecPathVersionPinned() {
+  const packageJson = JSON.parse(readFileSync(join(__dirname, '..', 'package.json'), 'utf8'))
+  const requiredRange = packageJson.engines && packageJson.engines.node
+  if (requiredRange && !semver.satisfies(process.version, requiredRange)) {
+    throw new Error(
+      `[daemon-host] build host Node ${process.version} does not satisfy engines.node "${requiredRange}"`
+    )
+  }
+}
+
 function ensurePackagedDaemonHostNode(resourcesDir, electronPlatformName) {
   if (electronPlatformName !== 'win32') {
     return
   }
+  assertExecPathVersionPinned()
   const nodeExePath = process.execPath

4-8: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Share the daemon-host path constants
src/main/daemon/daemon-host-relocation.ts still hardcodes 'daemon-host' and 'node.exe', duplicating config/daemon-host-node-runtime.cjs. Pull both values from one shared constant module so the packaged and relocated paths can’t drift.

.github/workflows/release-cut.yml (1)

881-888: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Optional: fold into the existing $requiredFiles loop for consistency.

The new daemon-host check duplicates the existing Test-Path/throw pattern as a standalone block rather than joining $requiredFiles, so the verification logic now exists in two slightly different shapes in the same step.

♻️ Optional consolidation
           $runtimeDir = 'dist/win-unpacked/resources/node_modules/node-pty/build/Release'
+          # The standalone node.exe that hosts the terminal daemon outside the
+          # install-dir kill zone the NSIS updater sweeps. See
+          # src/main/daemon/daemon-host-relocation.ts.
           $requiredFiles = @(
             "$runtimeDir/conpty.node",
             "$runtimeDir/conpty/conpty.dll",
-            "$runtimeDir/conpty/OpenConsole.exe"
+            "$runtimeDir/conpty/OpenConsole.exe",
+            'dist/win-unpacked/resources/daemon-host/node.exe'
           )
           foreach ($file in $requiredFiles) {
             if (-not (Test-Path -LiteralPath $file -PathType Leaf)) {
               throw "Missing Windows node-pty runtime file: $file"
             }
             Get-Item -LiteralPath $file
           }
-          # The standalone node.exe that hosts the terminal daemon outside the
-          # install-dir kill zone the NSIS updater sweeps. See
-          # src/main/daemon/daemon-host-relocation.ts.
-          $daemonHostNode = 'dist/win-unpacked/resources/daemon-host/node.exe'
-          if (-not (Test-Path -LiteralPath $daemonHostNode -PathType Leaf)) {
-            throw "Missing Windows daemon-host runtime file: $daemonHostNode"
-          }
-          Get-Item -LiteralPath $daemonHostNode

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 68440ae6-99bb-4963-8902-4d667d9a834e

📥 Commits

Reviewing files that changed from the base of the PR and between 0fa8589 and 5af97ea.

📒 Files selected for processing (13)
  • .github/workflows/release-cut.yml
  • config/daemon-host-node-runtime.cjs
  • config/electron-builder.config.cjs
  • config/scripts/electron-builder-config.test.mjs
  • config/scripts/package-electron-runtime-contract.test.mjs
  • src/main/daemon/daemon-host-relocation.test.ts
  • src/main/daemon/daemon-host-relocation.ts
  • src/main/daemon/daemon-init.ts
  • src/main/index.ts
  • src/main/pty/install-dir-runtime-relocation.test.ts
  • src/main/pty/install-dir-runtime-relocation.ts
  • src/main/pty/node-pty-runtime-relocation.test.ts
  • src/main/pty/node-pty-runtime-relocation.ts

@Jinwoo-H Jinwoo-H left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed with the context of the original installer-sweep investigation (I wrote #7421 and the harness evidence on it). This is the right fix — it's precisely the "phase 2: daemon image relocation" follow-up #7421's description called for, and it removes our dependence on the installer's single-match .Count blind spot, which was the one remaining accidental protection. I verified the load-bearing assumptions independently rather than taking the description's word:

Verified — ABI. node-pty 1.1.0 is pure N-API (node-addon-api, node_api.h, Napi:: throughout its C++ sources) — no V8-ABI coupling to Electron. And empirically: during the input-freeze investigation I ran the real daemon-entry under a standalone node.exe with the repo's conpty binding, spawning live ConPTY PowerShell sessions, for hours on a Windows machine. The core concept of this PR is field-tested. The engines.node: "24" + node-version-file: package.json wiring in release-cut means the staged binary genuinely version-matches Electron 42's embedded Node.

Verified — GC pinning is safe on main today. All win32 pid files on main currently have startedAtMs: null (the CIM start-time self-report isn't on main yet), so pinning rests on startTimeMatches(pid, null) → fails open → live daemons pin their dirs. Adoption never rewrites the pid file (only the fresh-fork ready handler writes it), so a surviving daemon's pin can't silently shift to the new app version. And the module correctly encodes the .stale.stale lesson: no rename heuristics, pid-file pinning only.

Verified — identity/adoption unaffected. killStaleDaemon/health checks match on command line (daemon-entry + socket/token) and recorded entryPath, never the image name.

Two small requests before/right after merge:

  1. Move the ~70 MB copy off the pre-window startup path. installRelocatedDaemonHost() runs synchronously in the hasSingleInstanceLock block, so the first launch after every update pays a ~70 MB sync copy (plus AV scan of a fresh signed exe) before anything paints — colliding with the Windows startup-latency work (#7266 et al.). Its only consumer is the daemon fork; the function is latched/idempotent, so calling it from initDaemonPtyProvider (or the launcher) instead preserves the ordering guarantee at zero risk.
  2. Include the host-decision breadcrumb now rather than as a follow-up. Known-risk #2 says nothing logs which host the fork used. We just spent a full field investigation blind because main.trace.ndjson carries zero daemon lifecycle logging — one breadcrumb at the fork site (relocated vs fallback + path) is ~5 lines and would have saved hours.

One correction for the handoff record: the #7456 framing ("discovery map missed the legacy session, so keystrokes dispatched to the wrong daemon") is stated more confidently than the evidence supports. My instrumented cross-version harness showed discovery populating the router map correctly and writes landing on the v18 daemon at the router layer; the field freeze is more plausibly the ptyOwnership gate in ipc/pty.ts (writes silently rejected for ids missing from that registry, while resize uses a lenient fallback — matching the field observation that resize reflowed the TUI while typing was dead). #7456 is still worth having as hardening, but the frozen-input root cause should be treated as open until the DevTools writeAccepted probe is run on an affected machine.

Also noting: the platform (windows/mac/linux) CI jobs skipped on this PR — verify and both native-smoke legs passed. Given the risk surface is Windows-packaging-specific and unit-testable parts are covered, the real validation is the planned RC exercise: note it takes TWO fixed builds to see the benefit (the update to the first fixed build still sweeps the old daemon; only fixed→fixed survives).

@Jinwoo-H

Jinwoo-H commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Spec note for the host-decision logging request: emit it through the observability tracer (startSpan → local file sink), NOT recordCrashBreadcrumb. The crash-breadcrumb store is an in-memory ring that only surfaces if the app crashes — useless for the live-but-broken investigations this is meant to serve. Tracer spans land in %APPDATA%\orca\logs\main.trace.ndjson (rotated, and collected by the diagnostic bundle), which is exactly where the field diagnostics for the update incidents already look — e.g. a daemon.fork span with attributes {host: 'relocated'|'fallback', execPath, version}. While in there, the same span is a natural place to also record adopt-vs-fresh, since zero daemon lifecycle events reach the trace file today.

- Move installRelocatedDaemonHost() from app startup into the daemon
  launcher: the ~70MB node.exe copy no longer sits on the first-paint
  path, and launches that adopt a live daemon (no fork) skip it
  entirely. The ordering guarantee is unchanged - the launcher stages
  the host immediately before computing the fork execPath.
- Emit daemon.fork / daemon.adopt spans through the observability
  tracer so field trace files (userData/logs/main.trace.ndjson, also
  collected by diagnostic bundles) show which host image the daemon
  runs from and whether a launch adopted or forked. A silent fallback
  to the install-dir host was previously indistinguishable from the
  fixed path; the update-survival investigations had zero daemon
  lifecycle records to work with.
- Fail-open hardening: installRelocatedDaemonHost() no longer throws
  when process.resourcesPath is unset (tests, node-hosted tooling).

Verified: 79 daemon/relocation/tracer tests + 21 builder-config tests
pass; typecheck clean; end-to-end smoke on Windows forked the BUILT
daemon-entry.js bundle from a standalone node.exe (execPath swap,
empty execArgv, no ELECTRON_RUN_AS_NODE) and drove a live ConPTY
session through it with working input and output.
@Jinwoo-H
Jinwoo-H merged commit f4faafa into main Jul 6, 2026
6 checks passed
@Jinwoo-H
Jinwoo-H deleted the brennanb2025/relocate-daemon-host-image branch July 6, 2026 02:52
Jinwoo-H added a commit that referenced this pull request Jul 6, 2026
Since #7473 the terminal daemon runs under a standalone node.exe.
Electron's bundled Node defaults windowsHide to true; plain node.exe
defaults it to false, so every child_process call in the daemon that
does not pass the flag - the periodic PowerShell CIM process probes,
node-pty's kill-path conpty_console_list_agent fork - now allocates a
visible console, which opens and closes a Windows Terminal window on
the user's screen every few seconds.

Fix: daemon-entry installs a child_process shim (first import, before
any module captures bindings like promisify(execFile)) that defaults
windowsHide: true across spawn/exec/execFile/fork and their sync
variants, restoring the Electron default the daemon has always relied
on. Explicit windowsHide from a caller still wins. Also adds
windowsHide to node-pty's console-list agent fork in the existing
patch as defense in depth.

Verified on Windows: reproduced the flash with the rc.5 production
daemon (WindowsTerminal windows, ~3s cadence matching the CIM probe
interval, conhost spawned visible-capable "0x4"); with the shim, a
node.exe-hosted daemon's children (OpenConsole, powershell, node
helpers) all run without a visible-capable console and session kill
still works end to end.
Jinwoo-H added a commit that referenced this pull request Jul 6, 2026
Since #7473 the terminal daemon runs under a standalone node.exe.
Electron's bundled Node defaults windowsHide to true; plain node.exe
defaults it to false, so every child_process call in the daemon that
does not pass the flag - the periodic PowerShell CIM process probes,
node-pty's kill-path conpty_console_list_agent fork - now allocates a
visible console, which opens and closes a Windows Terminal window on
the user's screen every few seconds.

Fix: daemon-entry installs a child_process shim (first import, before
any module captures bindings like promisify(execFile)) that defaults
windowsHide: true across spawn/exec/execFile/fork and their sync
variants, restoring the Electron default the daemon has always relied
on. Explicit windowsHide from a caller still wins. Also adds
windowsHide to node-pty's console-list agent fork in the existing
patch as defense in depth.

Verified on Windows: reproduced the flash with the rc.5 production
daemon (WindowsTerminal windows, ~3s cadence matching the CIM probe
interval, conhost spawned visible-capable "0x4"); with the shim, a
node.exe-hosted daemon's children (OpenConsole, powershell, node
helpers) all run without a visible-capable console and session kill
still works end to end.
Jinwoo-H added a commit that referenced this pull request Jul 6, 2026
) (#7505)

* Revert "Preload the daemon windowsHide shim via --require; wrap promisify custom (#7499)"

This reverts commit 8f396ba.

* Revert "Hide console windows for children of the node.exe-hosted daemon (#7486)"

This reverts commit f0fdd3a.

* Revert "fix(daemon): relocate daemon host image out of the install-dir kill zone (#7473)"

This reverts commit f4faafa.

* Revert "fix(pty): keep runtime dirs a surviving daemon still uses (#7463)"

This reverts commit 3cd23a1.

* Revert "Relocate node-pty ConPTY runtime outside the Windows install dir (fixes update-time terminal loss) (#7421)"

This reverts commit 509c41e.
Jinwoo-H added a commit that referenced this pull request Jul 7, 2026
… to survive updates

Phase 1 of Windows terminal update-survival. On win32 packaged, the
terminal daemon is now forked from a copy of the Electron runtime staged
under userData/daemon-host/<version> (run as node, ELECTRON_RUN_AS_NODE),
so its process image and all loaded modules live outside the install dir
the NSIS updater deletes and force-closes. Keeping the Electron binary
(not stock node.exe) means run-as-node behavior is byte-identical — no
console flashing, asar-correct — which the reverted #7473 attempt broke.

Proven on CI by tools/daemon-relocation-spike: a copied Orca.exe boots
the daemon, drives a real ConPTY session, and holds zero loaded-module
handles into the install dir, on the minimal file set.

- daemon-host-relocation.ts: materialize (atomic staging + marker-last +
  fail-open), version-keyed dir, PID-pinned GC of old versions.
- daemon-init.ts: fork from the relocated exe/entry when available;
  byte-identical in-dir fork otherwise (non-win32, dev, or fail-open).
- Adoption-neutral: protocol/pipe unchanged; a new app still adopts an
  old in-dir daemon.
- win-update-survival-e2e.yml: builds a branch installer and runs the
  harness with --expect survival to prove sessions survive an update.
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…lyai#7486)

Since stablyai#7473 the terminal daemon runs under a standalone node.exe.
Electron's bundled Node defaults windowsHide to true; plain node.exe
defaults it to false, so every child_process call in the daemon that
does not pass the flag - the periodic PowerShell CIM process probes,
node-pty's kill-path conpty_console_list_agent fork - now allocates a
visible console, which opens and closes a Windows Terminal window on
the user's screen every few seconds.

Fix: daemon-entry installs a child_process shim (first import, before
any module captures bindings like promisify(execFile)) that defaults
windowsHide: true across spawn/exec/execFile/fork and their sync
variants, restoring the Electron default the daemon has always relied
on. Explicit windowsHide from a caller still wins. Also adds
windowsHide to node-pty's console-list agent fork in the existing
patch as defense in depth.

Verified on Windows: reproduced the flash with the rc.5 production
daemon (WindowsTerminal windows, ~3s cadence matching the CIM probe
interval, conhost spawned visible-capable "0x4"); with the shim, a
node.exe-hosted daemon's children (OpenConsole, powershell, node
helpers) all run without a visible-capable console and session kill
still works end to end.
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…#7421→stablyai#7499) (stablyai#7505)

* Revert "Preload the daemon windowsHide shim via --require; wrap promisify custom (stablyai#7499)"

This reverts commit b5710ee.

* Revert "Hide console windows for children of the node.exe-hosted daemon (stablyai#7486)"

This reverts commit 081cf2f.

* Revert "fix(daemon): relocate daemon host image out of the install-dir kill zone (stablyai#7473)"

This reverts commit 38c2e2e.

* Revert "fix(pty): keep runtime dirs a surviving daemon still uses (stablyai#7463)"

This reverts commit 01ad86a.

* Revert "Relocate node-pty ConPTY runtime outside the Windows install dir (fixes update-time terminal loss) (stablyai#7421)"

This reverts commit 24d599f.
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.

3 participants