Skip to content

Model picker times out for ACP providers: cursor catalog discovery re-spawns the full agent (30s budget, 60s cache, silent fallback) #4459

Closed

Description

@CameronCrow

The workflow

  1. A user opens a new thread's model picker, or changes the model of an existing thread, on a machine where cursor-agent is installed.
  2. bb resolves the provider catalog. cursor has no model-list CLI (modelCli.listArgs is empty), so the host daemon takes the full-agent discovery path: spawn cursor-agent, ACP initialize, headless authenticate, session/new — all inside MODEL_LIST_TIMEOUT_MS (30s) — then per-model reasoning probes (PROBE_BUDGET_MS 1s each).
  3. Server-side, listProviderModelsMemoized (apps/server/src/services/system/execution-options.ts) calls the host via callHostRetryableOnlineRpc with COMMAND_TIMEOUT_MS (30s); the retryable wrapper gives the first attempt half the budget (15s) and retries once with the remainder.
  4. 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.
  5. On timeout: the server logs "Failed to resolve provider models" (504 command_timeout), serves the provider's fallbackModels in 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_timeout events. 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-agent spawn + 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-agent cold 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 list CLI flag, prefer the modelCli path.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions