stablyai/orca · warning · Error

ETIMEDOUT

ETIMEDOUT

Error message

Timed out running ${command}

What it means

Thrown by withPreflightTimeout (preflight-command-exec.ts:20-42) when a preflight command does not settle within PREFLIGHT_COMMAND_TIMEOUT_MS (5000 ms). It races the command promise against a setTimeout; on timeout it rejects with an Error carrying code 'ETIMEDOUT'. The timeout.unref() call (line 32) means the timer does not keep the Node event loop alive. Used by execLocalPreflightCommand and execCommandInWsl to probe tools like git --version before relying on them.

Source

Thrown at src/main/ipc/preflight-command-exec.ts:28

const execFileAsync = promisify(execFile)
export const PREFLIGHT_COMMAND_TIMEOUT_MS = 5000
const WSL_COMMAND_PATH_SENTINEL = '__ORCA_PREFLIGHT_COMMAND_PATH__'

export type PreflightCommandResult = { stdout: string; stderr: string }

export function shellQuote(value: string): string {
  return `'${value.replace(/'/g, "'\\''")}'`
}

async function withPreflightTimeout<T>(command: string, commandPromise: Promise<T>): Promise<T> {
  let timeout: ReturnType<typeof setTimeout> | null = null
  try {
    return await Promise.race([
      commandPromise,
      new Promise<never>((_resolve, reject) => {
        timeout = setTimeout(() => {
          const error = Object.assign(new Error(`Timed out running ${command}`), {
            code: 'ETIMEDOUT'
          })
          reject(error)
        }, PREFLIGHT_COMMAND_TIMEOUT_MS)
        if (typeof timeout.unref === 'function') {
          timeout.unref()
        }
      })
    ])
  } finally {
    if (timeout) {
      clearTimeout(timeout)
    }
  }
}

export async function execLocalPreflightCommand(
  command: string,
  args: string[]

View on GitHub (pinned to 1136503c6a)

Solutions

  1. Run the failing command manually in a terminal with 'time' to confirm it is slow or interactive, then fix the root cause (e.g. disable an interactive credential prompt).
  2. For WSL, ensure the distro is already running (wsl --list --running) to avoid cold-start latency.
  3. Add exemptions for the toolchain in privilege-management/antivirus software.
  4. If the command is inherently slow on this host, the preflight is working as designed — treat the tool as unavailable for preflight purposes (callers fall back).
  5. Note execFileAsync also has its own timeout=PREFLIGHT_COMMAND_TIMEOUT_MS (line 51), so the child is killed at 5s regardless.
Defensive patterns

Strategy: try-catch

Type guard

function isPreflightTimeout(e: unknown): e is Error & { code: 'ETIMEDOUT' } {
  return e instanceof Error && (e as { code?: string }).code === 'ETIMEDOUT'
}

Try / catch

try {
  await execLocalPreflightCommand(cmd, args)
} catch (e) {
  if (isPreflightTimeout(e)) {
    // tool is effectively unavailable for preflight; fall back to a non-preflight path or report unavailable
  } else throw e
}

Prevention

When it happens

Trigger: A preflight probe such as 'git --version' or a WSL path lookup script hangs past 5 seconds: the executable prompts for input, is gated by privilege-management software (the file references this at preflight-command-exec.ts:85-89), waits on a slow network mount, or the WSL distro is slow to start.

Common situations: Privilege-management/corporate EDR gating each process spawn; a slow WSL cold start; a git credential helper blocking on a keychain prompt; an antivirus scanning the spawned binary; a hung NFS/Home directory path on PATH resolution.

Understand the failure class

Related errors


AI-assisted analysis of stablyai/orca@1136503c6a (2026-08-12). Data as JSON: /api/errors/7f2cd33eebfc062a. Report an issue: GitHub.