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.