Repository navigation
Closed
Description
The workflow
- A user opens a new thread's model picker, or changes the model of an existing thread, on a machine where
cursor-agentis installed. - bb resolves the provider catalog. cursor has no model-list CLI (
modelCli.listArgsis empty), so the host daemon takes the full-agent discovery path: spawncursor-agent, ACPinitialize, headlessauthenticate,session/new— all insideMODEL_LIST_TIMEOUT_MS(30s) — then per-model reasoning probes (PROBE_BUDGET_MS1s each). - Server-side,
listProviderModelsMemoized(apps/server/src/services/system/execution-options.ts) calls the host viacallHostRetryableOnlineRpcwithCOMMAND_TIMEOUT_MS(30s); the retryable wrapper gives the first attempt half the budget (15s) and retries once with the remainder. - A successful discovery is cached in host-daemon memory for
SESSION_MODEL_DISCOVERY_TTL_MS(60s) only, keyed on agent command + probe options. Only concurrent calls are deduped (lifecycleDedupers.providerModelList); nothing persists across picker opens once the previous call has completed. - On timeout: the server logs
"Failed to resolve provider models"(504command_timeout), serves the provider'sfallbackModelsin the picker, and the UI shows "Timed out loading models for cursor".
What happens today (measured)
Production logs from a five-host deployment on bb-app 0.40.0, 2026-09-18 → 09-28:
- 369
"Failed to resolve provider models"/command_timeoutevents. By provider: acp-cursor 283 (77%), codex 34, an acp-opencode dialect provider 28, pi 12, claude-code 12. - Cursor failures concentrate on the two hosts where cursor threads are actually used, and recur daily: 73 on 09-18, 79 on 09-22, 99 on 09-28 alone.
- Same-millisecond duplicate log lines show several surfaces resolving catalogs at once (new-thread start resolves all providers), each fanning out to its own host RPC.
- The repeat rate implies that nearly every picker open past the 60s in-memory TTL pays a fresh
cursor-agentspawn + handshake, and most of those exceed the 30s budget. The fallback catalog is served silently in its place — plausible-looking models with only a toast to signal anything is wrong.
What you would expect
- Persist the last successful catalog on the host (or server) and serve it stale-while-revalidate: the picker should never block on a fresh agent spawn when a cached catalog exists, and a failed refresh should keep the stale list rather than silently substituting fallback models.
- Pre-warm or keep alive a discovery connection — e.g. discover at host-daemon start and on CLI version change (relates to provider.list_models startup probe logs "ACP agent is not authenticated." at warn on every daemon start #2291, which already probes at daemon start and logs auth failures there).
- Revisit the budget split for heavyweight agents: a
cursor-agentcold start plus headless auth routinely exceeds 30s, and the retryable RPC spends half its budget on the first attempt. - Longer term: if cursor ever ships a cheap
models listCLI flag, prefer themodelClipath.
Related: #4370 (silent switch to catalog default when an id goes missing — same "catalog resolution failed quietly" family), #4155 (empty claude-code catalog), #2958 and #4367 (same discovery code path, other symptoms).
Environment
bb-app 0.40.0, five enrolled hosts (macOS + Linux), cursor-agent installed on two.
Metadata
Metadata
Assignees
Labels
No labels
Activity