fix(cli): cover bounded WSL Codex repair

This commit is contained in:
Brennan Benson
2026-08-27 11:36:13 -07:00
parent d591d2fa42
commit da06eb0ec7
2 changed files with 5 additions and 2 deletions
+1 -1
View File
@@ -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()
})
+4 -1
View File
@@ -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<string, CommandHandler> = {
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.