diegosouzapw/OmniRoute · error

cursor-agent binary not executable at

Error message

cursor-agent binary not executable at ${binary}

What it means

fetchCursorAgentModels resolved a binary path but runCursorAgent failed to execute it (spawn/permission error surfaced as non-runnable). The file exists at the given path but cannot be executed (missing exec bit, wrong arch, or broken install).

Solutions

  1. chmod +x the cursor-agent binary
  2. Reinstall cursor-agent to fix a broken or wrong-architecture install
  3. Pass a different valid binary path via options.binary
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at src/lib/providerModels/cursorAgent.ts:196 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of diegosouzapw/OmniRoute@a179ffed5b (2026-08-25). Data as JSON: /api/errors/69699a1fdf553465. Report an issue: GitHub.

Appendix: source

Thrown at src/lib/providerModels/cursorAgent.ts:196

  const timeoutMs = options.timeoutMs ?? 5000;

  if (!binary) {
    throw new Error(
      "cursor-agent binary not found. Install it (curl https://cursor.com/install -fsS | bash) so ~/.local/bin/cursor-agent exists, or pass a binary path explicitly."
    );
  }

  const startedAt = Date.now();
  let result: { stdout: string; stderr: string };
  try {
    // Modern Cursor Agent releases provide a dedicated catalog flag. Prefer the
    // flag over the equivalent `models` subcommand because older releases can
    // interpret an unknown positional subcommand as an agent prompt.
    result = await runCursorAgent(binary, ["--list-models"], timeoutMs);
  } catch (err: unknown) {
    const e = err as NodeJS.ErrnoException;
    if (e?.code === "ENOENT") {
      throw new Error(`cursor-agent binary not executable at ${binary}`);
    }
    throw err;
  }
  let combined = `${result.stdout}\n${result.stderr}`;
  let ids = parseCursorAgentModels(combined);

  // Backward compatibility for releases from before the dedicated catalog interface.
  if (ids.length === 0 && !/Authentication required|Not logged in/i.test(combined)) {
    const remainingTimeoutMs = timeoutMs - (Date.now() - startedAt);
    if (remainingTimeoutMs > 0) {
      result = await runCursorAgent(binary, ["--model", "--help"], remainingTimeoutMs);
      combined = `${result.stdout}\n${result.stderr}`;
      ids = parseCursorAgentModels(combined);
    }
  }

  if (ids.length === 0) {
    if (/Authentication required|Not logged in/i.test(combined)) {

View on GitHub (pinned to a179ffed5b)