From da06eb0ec7ac440ced556226a88abe5d8f08ca32 Mon Sep 17 00:00:00 2001 From: Brennan Benson <79079362+brennanb2025@users.noreply.github.com> Date: Thu, 27 Aug 2026 11:29:36 -0700 Subject: [PATCH] fix(cli): cover bounded WSL Codex repair --- src/cli/handlers/agent-hooks.test.ts | 2 +- src/cli/handlers/agent-hooks.ts | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/cli/handlers/agent-hooks.test.ts b/src/cli/handlers/agent-hooks.test.ts index 45a504c5849..e5aea0ab400 100644 --- a/src/cli/handlers/agent-hooks.test.ts +++ b/src/cli/handlers/agent-hooks.test.ts @@ -152,7 +152,7 @@ describe('agent hooks CLI handler', () => { expect(callMock).toHaveBeenCalledExactlyOnceWith( 'agentHooks.prepareCodexForWslPane', { codexHome: home, orcaCodexHome: home, wslDistro: 'Ubuntu-24.04' }, - { timeoutMs: 10_000 } + { timeoutMs: 40_000 } ) expect(prepareManagedCodexHomeBeforeShellLaunchMock).not.toHaveBeenCalled() }) diff --git a/src/cli/handlers/agent-hooks.ts b/src/cli/handlers/agent-hooks.ts index 78a2d344baf..c7105a26f76 100644 --- a/src/cli/handlers/agent-hooks.ts +++ b/src/cli/handlers/agent-hooks.ts @@ -28,6 +28,9 @@ type AgentHookCommandResult = { statuses: AgentHookInstallStatus[] } +// Covers the 5s WSL identity probe, 30s trust grant, and bounded app-server reap. +const WSL_CODEX_PREPARE_TIMEOUT_MS = 40_000 + function getDataPath(): string { const userDataPath = getDefaultUserDataPath() const indexPath = join(userDataPath, 'orca-profile-index.json') @@ -216,7 +219,7 @@ export const AGENT_HOOK_HANDLERS: Record = { orcaCodexHome: process.env.ORCA_CODEX_HOME ?? '', wslDistro: process.env.WSL_DISTRO_NAME }, - { timeoutMs: 10_000 } + { timeoutMs: WSL_CODEX_PREPARE_TIMEOUT_MS } ) } catch { // Best effort: old or unavailable runtimes must not block Codex launch.