diff --git a/src/main/ipc/pty/host-env/assembly.ts b/src/main/ipc/pty/host-env/assembly.ts index 4de8da7fdd4..9f9bbae0e43 100644 --- a/src/main/ipc/pty/host-env/assembly.ts +++ b/src/main/ipc/pty/host-env/assembly.ts @@ -161,10 +161,7 @@ export function buildPtyHostEnv( if (shouldPrepareOmpShadow) { const ompEnv = piTitlebarExtensionService.buildPtyEnv(id, preexistingOmpAgentDir, 'omp', { materializeDefaultHome: explicitPiAgentKind === 'omp', - // WSL executes on the guest and must never inherit the host's - // PI_CONFIG_DIR. Use OMP's guest-local default when the relay has - // not supplied a guest root yet; the relay may still override the - // resulting source directory with its materialized guest path. + // WSL loads the host-rooted managed extension through drvfs; guest storage stays separate. ...(opts.isWsl ? { configDirName: '.omp' } : baseEnv.PI_CONFIG_DIR !== undefined diff --git a/src/relay/omp-config-root.test.ts b/src/relay/omp-config-root.test.ts index 329b3c7fdf8..a33ac667edc 100644 --- a/src/relay/omp-config-root.test.ts +++ b/src/relay/omp-config-root.test.ts @@ -68,7 +68,7 @@ describe('relay OMP config root', () => { expect(existsSync(join(home, '.company-omp'))).toBe(false) }) - it('does not read the relay process config root when the session omits it', async () => { + it('does not fall back to process.env for the config root', async () => { vi.stubEnv('PI_CONFIG_DIR', '.wrong-process-root') expect(await resolveOmpConfigDirName({ HOME: home }, '/bin/bash')).toBeUndefined() }) diff --git a/tests/e2e/omp-launch-environment.spec.ts b/tests/e2e/omp-launch-environment.spec.ts index cced03bf0bb..45b5d989d79 100644 --- a/tests/e2e/omp-launch-environment.spec.ts +++ b/tests/e2e/omp-launch-environment.spec.ts @@ -56,14 +56,15 @@ exec /bin/zsh "$@" } }) +test.skip( + !process.env.ORCA_OMP_PROOF_BINARY || process.platform !== 'darwin', + 'Opt-in macOS OMP runtime proof' +) + test('OMP launched by Orca uses login-profile data and config roots', async ({ orcaPage, electronApp }, testInfo) => { - test.skip( - !process.env.ORCA_OMP_PROOF_BINARY || process.platform !== 'darwin', - 'Opt-in macOS OMP runtime proof' - ) await waitForSessionReady(orcaPage) const worktreeId = await waitForActiveWorktree(orcaPage) await ensureTerminalVisible(orcaPage) @@ -114,7 +115,9 @@ export default function (api) { ) await expect(orcaPage.locator('.xterm-screen').first()).toBeVisible() await orcaPage.screenshot({ path: testInfo.outputPath('omp-profile-root.png') }) - expect(await readdir(join(home, 'xdg-data', 'omp'))).toContain('agent.db') + await expect(async () => { + expect(await readdir(join(home, 'xdg-data', 'omp'))).toContain('agent.db') + }).toPass({ timeout: 30_000 }) const overrideData = join(home, 'pane-data') await mkdir(join(overrideData, 'omp'), { recursive: true }) const overrideResult = testInfo.outputPath('omp-pane-paths.json') @@ -164,7 +167,9 @@ export default function (api) { session: expect.stringContaining(join('pane-data', 'omp', 'sessions')) }) ) - expect(await readdir(join(overrideData, 'omp'))).toContain('agent.db') + await expect(async () => { + expect(await readdir(join(overrideData, 'omp'))).toContain('agent.db') + }).toPass({ timeout: 30_000 }) } finally { await orcaPage.evaluate((id) => window.api.pty.kill(id), overridePty) }