From 7eeb2568d7f026758db302280e03e9ab041d0d4c Mon Sep 17 00:00:00 2001 From: OrcaWin Date: Sun, 4 Oct 2026 03:17:55 -0700 Subject: [PATCH] feat(serve): serve on orcad by default on Windows too (#25162) D7 now runs every case on Windows (orcad-serve-mode-switch-windows), including Electron serve adopting a daemon orcad forked, so Windows no longer needs the Electron default. Co-authored-by: m4air --- docs/reference/orcad-operations.md | 6 +++--- docs/site/content/docs/remote-servers.mdx | 2 +- src/main/orcad/orcad-local-serve-selection.test.ts | 12 ++++-------- src/main/orcad/orcad-local-serve-selection.ts | 6 ------ tests/e2e/orcad-serve-mode-switch.spec.ts | 12 +++--------- 5 files changed, 11 insertions(+), 27 deletions(-) diff --git a/docs/reference/orcad-operations.md b/docs/reference/orcad-operations.md index 4232c24f0ec..32133bce66d 100644 --- a/docs/reference/orcad-operations.md +++ b/docs/reference/orcad-operations.md @@ -78,9 +78,9 @@ no template in the install, the pinned Node could not be fetched, or a failed na the default, and any other value falls back with a reason. - Packaged macOS stays on Electron: only Electron serve, supervised by the CLI, can take a remote app update there, and orcad has no updater. Recipe-JSON serve has no handoff and uses orcad. -- Windows defaults to Electron serve for now; `ORCA_SERVE_RUNTIME=orcad` opts in. Both hosts share - `\daemon` and so one daemon pipe. The `orcad-serve-mode-switch-windows` e2e job gates D7 - on Windows. +- Windows serves on orcad too. Both hosts share `\daemon`, so the daemon pipe name + (hashed from that path) is the same, and the relocated Electron daemon host changes only the + executable, not the pipe. The `orcad-serve-mode-switch-windows` e2e job gates D7 there. The slot and its pinned Node live under the desktop's `/orcad-artifacts`. diff --git a/docs/site/content/docs/remote-servers.mdx b/docs/site/content/docs/remote-servers.mdx index 3e674b66cdb..25ad464f002 100644 --- a/docs/site/content/docs/remote-servers.mdx +++ b/docs/site/content/docs/remote-servers.mdx @@ -167,7 +167,7 @@ orca-ide serve --port 6768 --pairing-address 100.64.1.20 Use only one host mode at a time. If the Orca desktop app is already sharing that computer, do not start a second `orca serve` process for the same setup. -`orca serve` runs on Orca's own Node server (orcad) by default. If orcad can't serve on this computer, it uses the desktop app's server instead and prints one line saying why. On Windows it uses the desktop app's server unless you set `ORCA_SERVE_RUNTIME=orcad`, and on a packaged macOS app it currently always does, so paired clients can still update it. To always use the desktop app's server, set `ORCA_SERVE_RUNTIME=electron`. +`orca serve` runs on Orca's own Node server (orcad) by default. If orcad can't serve on this computer, it uses the desktop app's server instead and prints one line saying why. On a packaged macOS app it currently always uses the desktop app's server, so paired clients can still update it. To always use the desktop app's server, set `ORCA_SERVE_RUNTIME=electron`. ### Mobile from a headless server diff --git a/src/main/orcad/orcad-local-serve-selection.test.ts b/src/main/orcad/orcad-local-serve-selection.test.ts index 52bf0196234..f0d1fa3fc0b 100644 --- a/src/main/orcad/orcad-local-serve-selection.test.ts +++ b/src/main/orcad/orcad-local-serve-selection.test.ts @@ -62,17 +62,14 @@ describe('orca serve runtime selection', () => { expect(options.materializeSlot).not.toHaveBeenCalled() }) - it('serves on orcad by default and when orcad is asked for by name', async () => { + it('serves on orcad by default and when orcad is asked for by name, Windows included', async () => { for (const env of [{}, { [SERVE_RUNTIME_ENV]: 'orcad' }]) { - expect(await selectServeRuntime(input({ env }))).toMatchObject({ kind: 'orcad' }) + for (const platform of ['linux', 'win32'] as const) { + expect(await selectServeRuntime(input({ env, platform }))).toMatchObject({ kind: 'orcad' }) + } } }) - it('serves on orcad on Windows only when orcad is asked for by name', async () => { - const options = input({ env: { [SERVE_RUNTIME_ENV]: 'orcad' }, platform: 'win32' }) - expect(await selectServeRuntime(options)).toMatchObject({ kind: 'orcad' }) - }) - it('runs the local slot on its pinned Node, linked into userData beside it', async () => { const options = input() const selection = await selectServeRuntime(options) @@ -98,7 +95,6 @@ describe('orca serve runtime selection', () => { { env: { [SERVE_RUNTIME_ENV]: 'bun' } }, 'ORCA_SERVE_RUNTIME=bun is neither orcad nor electron' ], - ['Windows by default', { platform: 'win32' as const }, 'not the default on Windows yet'], ['packaged macOS', { usesMacUpdateHandoff: true }, 'so paired clients can still update it'], ['an unsupported host', { hostTarget: () => 'linux-riscv64-glibc' }, 'no orcad build exists'], ['an install without the template', { templateDirs: [] }, 'carries no orcad template'], diff --git a/src/main/orcad/orcad-local-serve-selection.ts b/src/main/orcad/orcad-local-serve-selection.ts index 5c3731d4192..efe9dc88222 100644 --- a/src/main/orcad/orcad-local-serve-selection.ts +++ b/src/main/orcad/orcad-local-serve-selection.ts @@ -61,12 +61,6 @@ export async function selectServeRuntime( if (requested && requested !== 'orcad') { return electron(`${SERVE_RUNTIME_ENV}=${requested} is neither orcad nor electron`) } - // Why: Windows stays on Electron by default until orcad serve is flipped on there separately. - if (!requested && input.platform === 'win32') { - return electron( - 'local orcad serve is not the default on Windows yet; set ORCA_SERVE_RUNTIME=orcad to opt in' - ) - } // Why: only packaged macOS serve can take a remote app update, through Electron's updater // and this CLI's supervisor; orcad has no updater, so switching would drop that. if (input.usesMacUpdateHandoff) { diff --git a/tests/e2e/orcad-serve-mode-switch.spec.ts b/tests/e2e/orcad-serve-mode-switch.spec.ts index 3bb0d0741cd..56135d9814c 100644 --- a/tests/e2e/orcad-serve-mode-switch.spec.ts +++ b/tests/e2e/orcad-serve-mode-switch.spec.ts @@ -272,15 +272,9 @@ test('`orca serve` runs on orcad by default and on Electron with ORCA_SERVE_RUNT try { const byDefault = await startCliServe(profile) try { - // Windows still defaults to Electron serve; orcad is opt-in there. - if (process.platform === 'win32') { - expect(byDefault.stderr()).toContain('not the default on Windows yet') - expect(byDefault.readiness.health).toBeUndefined() - } else { - expect(byDefault.stderr()).toContain('[serve] running on orcad') - expect(byDefault.readiness.health).toBeDefined() - expect(profileLockRole(profile.userDataDir)).toBe('orcad') - } + expect(byDefault.stderr()).toContain('[serve] running on orcad') + expect(byDefault.readiness.health).toBeDefined() + expect(profileLockRole(profile.userDataDir)).toBe('orcad') } finally { await byDefault.stop() }