diegosouzapw/OmniRoute · error

cursor-agent did not return a model catalog from 'agent…

Error message

cursor-agent did not return a model catalog from 'agent --list-models'

What it means

fetchCursorAgentModels exhausted both probes ('agent --list-models' and the legacy '--model --help' fallback) and parseCursorAgentModels extracted zero model ids, with no auth-error text present. The installed cursor-agent release does not expose a parsable catalog.

Solutions

  1. Update cursor-agent to a release supporting the catalog flag
  2. Run the agent commands manually to inspect their raw output
  3. Configure Cursor models statically instead of via binary discovery
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at src/lib/providerModels/cursorAgent.ts:217 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/ecc6c7121e8892fc. Report an issue: GitHub.

Appendix: source

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

  }
  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)) {
      throw new Error("cursor-agent is not authenticated; run 'agent login' on the OmniRoute host");
    }
    throw new Error("cursor-agent did not return a model catalog from 'agent --list-models'");
  }

  return ids.map((id) => ({
    id,
    name: humanizeCursorModelId(id),
    owned_by: "cursor" as const,
  }));
}

View on GitHub (pinned to a179ffed5b)