TL;DR: getCursorModels() spawns cursor-agent models on every call with no cache of the negative result, so when cursor-agent is not installed each agent-picker render re-probes the missing binary and emits another warning.
Seen on v0.3.3, running in a container that ships Claude, Codex, Opencode, and Amp, but not cursor-agent. The path looks unchanged on main as of 9abf40b.
Detail
server-agents/cursor/src/agents/cursor/cursor-models.ts
export async function getCursorModels(
config: CursorConfig,
logger: AgentLogger,
): Promise<CursorModelOption[]> {
try {
const parsed = parseCursorModelsOutput(await runCursorModels(config));
if (parsed.length > 0) return parsed;
} catch (error) {
logger.warn('Cursor model discovery failed', {
error: error instanceof Error ? error.message : String(error),
});
}
return [];
}
There is no availability gate and no memo of the failure, so the spawn is retried indefinitely. Observed output, all from a single UI connection:
[ws:chat] ws: chat client connected
[agents:cursor:cursor-models] cursor: model discovery failed: Executable not found in $PATH: "cursor-agent"
... 13 more identical lines
Over a long-lived server this is the bulk of the log volume.
Suggested fix
Either cache the negative result for the process lifetime, or gate discovery behind a Bun.which(config.binary()) check, along the lines of the guard added for opencode in #42.
Possibly related to #44.
Happy to send a PR if useful. Thanks for garcon.
TL;DR:
getCursorModels()spawnscursor-agent modelson every call with no cache of the negative result, so whencursor-agentis not installed each agent-picker render re-probes the missing binary and emits another warning.Seen on v0.3.3, running in a container that ships Claude, Codex, Opencode, and Amp, but not
cursor-agent. The path looks unchanged onmainas of 9abf40b.Detail
server-agents/cursor/src/agents/cursor/cursor-models.tsThere is no availability gate and no memo of the failure, so the spawn is retried indefinitely. Observed output, all from a single UI connection:
Over a long-lived server this is the bulk of the log volume.
Suggested fix
Either cache the negative result for the process lifetime, or gate discovery behind a
Bun.which(config.binary())check, along the lines of the guard added foropencodein #42.Possibly related to #44.
Happy to send a PR if useful. Thanks for garcon.