From 6aac45ada0e662bc16f368398d0134ebf6e7e025 Mon Sep 17 00:00:00 2001 From: Jinwoo Hong <73622457+Jinwoo-H@users.noreply.github.com> Date: Thu, 4 Jun 2026 20:40:47 -0400 Subject: [PATCH] Fix Codex home PTY test path on Windows Use a platform-shaped selected Codex home fixture so native Windows PTY tests exercise the host Codex home path instead of filtering a POSIX /tmp path as WSL-shaped. --- src/main/ipc/pty.test.ts | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/main/ipc/pty.test.ts b/src/main/ipc/pty.test.ts index 44f804c44..3e0a5c69e 100644 --- a/src/main/ipc/pty.test.ts +++ b/src/main/ipc/pty.test.ts @@ -170,6 +170,10 @@ const POWERSHELL_OSC133_ARGS = [ '-EncodedCommand', encodePowerShellCommand(getPowerShellOsc133Bootstrap()) ] +const TEST_CODEX_HOME = + process.platform === 'win32' + ? 'C:\\Users\\test\\AppData\\Roaming\\orca\\codex-runtime-home\\home' + : '/tmp/orca-codex-home' function makeDisposable() { return { dispose: vi.fn() } @@ -530,9 +534,9 @@ describe('registerPtyHandlers', () => { }) it('injects the selected Codex home into Orca terminal PTYs', async () => { - const env = await spawnAndGetEnv(undefined, undefined, () => '/tmp/orca-codex-home') - expect(env.CODEX_HOME).toBe('/tmp/orca-codex-home') - expect(env.ORCA_CODEX_HOME).toBe('/tmp/orca-codex-home') + const env = await spawnAndGetEnv(undefined, undefined, () => TEST_CODEX_HOME) + expect(env.CODEX_HOME).toBe(TEST_CODEX_HOME) + expect(env.ORCA_CODEX_HOME).toBe(TEST_CODEX_HOME) }) it('injects the OpenCode hook env into Orca terminal PTYs', async () => { @@ -879,10 +883,10 @@ describe('registerPtyHandlers', () => { const env = await spawnAndGetEnv( undefined, { CODEX_HOME: '/tmp/system-codex-home' }, - () => '/tmp/orca-codex-home' + () => TEST_CODEX_HOME ) - expect(env.CODEX_HOME).toBe('/tmp/orca-codex-home') - expect(env.ORCA_CODEX_HOME).toBe('/tmp/orca-codex-home') + expect(env.CODEX_HOME).toBe(TEST_CODEX_HOME) + expect(env.ORCA_CODEX_HOME).toBe(TEST_CODEX_HOME) }) it('injects explicit proxy settings into local PTY env', async () => { @@ -1088,9 +1092,9 @@ describe('registerPtyHandlers', () => { }) it('injects the selected Codex home on the daemon path', async () => { - const env = await daemonSpawnAndGetEnv({}, () => '/tmp/orca-codex-home') - expect(env.CODEX_HOME).toBe('/tmp/orca-codex-home') - expect(env.ORCA_CODEX_HOME).toBe('/tmp/orca-codex-home') + const env = await daemonSpawnAndGetEnv({}, () => TEST_CODEX_HOME) + expect(env.CODEX_HOME).toBe(TEST_CODEX_HOME) + expect(env.ORCA_CODEX_HOME).toBe(TEST_CODEX_HOME) }) it('injects explicit proxy settings on the daemon path', async () => {