test(omp): address launch environment review feedback

This commit is contained in:
Neil
2026-09-19 00:34:28 -07:00
parent 6ded53a767
commit b778555cfa
3 changed files with 13 additions and 11 deletions
+1 -4
View File
@@ -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
+1 -1
View File
@@ -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()
})
+11 -6
View File
@@ -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)
}