mirror of
https://github.com/stablyai/orca.git
synced 2026-10-17 16:02:55 +00:00
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.