Skip to content

Model picker: Cursor keeps its tab and its models come back after a sign-in - #1503

Open
zeronsh[bot] wants to merge 5 commits into
mainfrom
zeron/cursor-picker-catalog
Open

zeronsh[bot] wants to merge 5 commits into
mainfrom
zeron/cursor-picker-catalog

Conversation

@zeronsh

@zeronsh zeronsh Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Cursor didn't appear in the model picker, even after signing in to Cursor again. This happened in 0.3.7 and in dev builds.

Root cause

  • Fetched once. zgx asked each agent for its models only once, when it connected to the engine (Chats::connected → load_catalog(false)).
  • Dropped tab. Cursor's stored key was dead at that point, so its list came back empty or failed. catalog_of left out every agent without models, so Cursor's tab disappeared.
  • Never asked again. The catalog was then marked complete, so the composer didn't ask again. The sign-in path didn't refetch either, for two reasons:
    • accounts_changed returned early when the agent had no models entry, which is the case when ListModels failed.
    • changed_logins compares only each account's (id, active). Signing in again to the same Cursor account, or replacing its key in place, therefore counted as no change.
  • Engine. In the engine, a forced ListModels with a disk copy present answered from that copy after 100 ms, so a forced refresh could still return the stale list.

Two related problems were found at the same time:

  • "Invalid parameters for registry model" (grok-4.7, gemini-4-carbon). The harness filled each parameter on its own from the model's default variant. That can produce a parameter set no variant actually lists. A Max Mode default (Grok's 500k context) was also sent when the catalog didn't flag it, or when the composer sent fast alone. Before this change the shim passed only the default variant, so the harness couldn't choose a valid one.
  • Dead duplicate Cursor account. Cursor slots were keyed by the store's email, or by the key when there was no email. The SDK doesn't always keep the email, so a re-login of the same account created a second slot. The old slot, holding the revoked key, stayed one switch away from breaking Cursor again.

What changed, by path

Composer picker, new chat, side-chat composer (lane_tab), Zeron v2 template copies (apps/zgx/src/chat.rs, ui/ds/model_picker.luau, ui/screens/chat/*)

  • Each agent in chat.catalog now has a status (loading / ready / empty / error) and an error message.
  • An agent that is offered always keeps its tab:
    • empty shows "No models — sign in", with a button that opens Settings → Providers.
    • error shows "Couldn't load models", the reason, and Retry.
    • loading shows skeleton rows.
  • Models are fetched again in these cases:
    • Login, logout, account switch or key update: accounts_changed refetches with force, even when the agent has no models entry yet. It re-lists agents if this one isn't listed.
    • Same account signed in again, or key replaced in place: accounts_seen refetches an agent that is signed in but whose models failed or came back empty.
    • Picker opens: the new chat.catalog_fresh refetches entries that are empty, failed, missing or older than 10 minutes. It doesn't block the open and skips agents already being fetched.
    • Manual retry: the new chat.catalog_retry { harness }.
  • The same behavior applies to another device's catalog (Remote).

Settings

  • Thread naming (settings/general.luau) lists agents without models as disabled rows that say why, and refetches when the page opens.
  • Settings → Providers lists agents from ListHarnesses, which doesn't depend on models, so Cursor already showed there.

Orchestrator create dialog's model chip

  • There is no such dialog or chip in apps/zgx/ui. The only orchestrator in zgx is the voice one in src/sessions.rs, which has no picker. All the ways to pick a model listed above share ds.ModelPicker and the same catalog.

MCP list_models / create_chat (crates/mcp)

  • list_models asks again with force when the stored catalog is empty or failed.
  • It never returns an empty list as success. It errors with "lists no models" or "could not list its models: …", plus a hint when it can tell (not installed, turned off, not signed in).
  • create_chat checks a model it can't find against a freshly fetched catalog before refusing it.
  • list_harnesses already listed every agent.

Engine (crates/engine/src/model_catalogs.rs)

  • A forced list waits for the agent instead of answering from the disk copy.
  • When there are no models anywhere, the agent's own reason is kept.

Cursor variant bug (crates/harness/src/cursor)

  • The shim passes every variant.
  • A run fills in what the person picked from the first listed non-Max variant that contains those picks. It uses a Max variant only when Max was picked, and drops picks for parameters the model doesn't have.
  • The picker's defaults are the variant a run actually starts on, so Grok shows 256k.
  • Not verified live: there's no Cursor account here. If Cursor's live catalog carries no Max Mode flag, a Max default can't be detected and would still be sent. The mismatched-parameter and lone-fast cases are fixed either way. crates/harness/examples/cursor_models_probe.rs, run against a real account, would confirm the catalog's shape.

Duplicate / dead accounts (crates/engine/src/agent_accounts.rs, apps/zgx/src/agents.rs, ui/ds/provider_card.luau)

  • A Cursor slot now also records the Cursor user it belongs to, taken from the usage probe's session.
  • A login of the same account, matched by email ignoring case or by user, replaces its older slots.
  • A key rejected with 401/403, or one that has expired, marks the account invalid. The fields invalid and invalidReason are additive and optional.
  • What an invalid account can't do:
    • Activating it is refused unless forced (ActivateAgentAccount { force }).
    • It is never pinned.
    • It is never offered as a switch in Settings or in the composer.
  • Settings shows the reason and a Remove button. A new sign-in takes over from it.
  • The older GPUI Settings in crates/ui still shows Switch for it, but the engine refuses the switch.

Tests

  • zgx Rust (cargo test --bin zeron-zgx): 737 passed, 0 failed. New tests:

    • a_cursor_with_no_models_at_connect_keeps_its_tab_and_a_sign_in_brings_them: empty and failed at connect, then a login, then a forced refetch, then 48 models in a ready tab.
    • an_account_change_for_an_agent_not_listed_lists_them_again
    • a_connected_agent_with_no_models_still_has_its_tab: this device and a remote one.
    • a_picker_opening_asks_again_for_failed_empty_and_stale_models
    • a_rejected_key_is_shown_to_remove_never_to_switch_to
  • zgx UI (zgx test ui): ui/tests/model_picker_catalog.test.luau has 8 tests, covering:

    • the empty tab and its sign-in state;
    • error → Retry → catalog_retry:cursor;
    • picker open → catalog_fresh;
    • models that come in after an empty catalog showing on Cursor's tab.

    ui/tests/provider_rejected.test.luau has 2 tests. The full UI suite had 1474 passed and 1 failed. The failure (settings_archived.test.luau "thousands archived") fails the same way on main.

  • Harness: 8 new Cursor variant unit tests, with grok-4.7 and gemini-4-carbon shaped catalog items, plus integration updates in tests/cursor.rs. All harness tests pass.

  • MCP: list_models_asks_again_when_the_kept_catalog_is_empty, list_models_says_why_it_has_none, create_chat_checks_a_missing_model_against_a_fresh_catalog. 88/88 pass. discovery_and_creation_use_the_selected_hosts_catalogs needs RUST_MIN_STACK=16777216 locally on main too.

  • Engine:

    • a_forced_list_waits_for_the_agent_instead_of_its_disk_copy
    • no_models_anywhere_says_the_agents_own_reason
    • a_cursor_relogin_of_the_same_account_replaces_its_dead_slot
    • a_rejected_cursor_key_is_invalid_and_never_switched_to
    • an_expired_cursor_key_is_invalid_without_a_probe

    cargo test -p zeron-engine --lib: 1184 passed, 5 failed. The same 5 fail on main in this environment: commit_credit ×2, harness_updates shutdown, git_service history, and the registry default slots.

  • crates/ui doesn't build in this environment, because of its WPE build script. Its only change is the two new fields in test literals.

Screenshot

Rendered offscreen with zgx's audit renderer (AUDIT_SHOTS='picker_cursor@520x560|=test_picker_open:1|^role:tab "Cursor"') from ui/picker_cursor_fixture.luau. No credentials were needed.

Cursor's tab and its models:

Cursor tab

A failed list, and an empty list:


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

A model's picks and defaults were filled one parameter at a time from its
default variant, so a run could send a combination no variant has (the
backend answers "Invalid parameters for registry model"), and a Max Mode
default (Grok 4.7's 500k context) went out whenever the catalog's flag for
it was missing or the composer sent Fast alone. The shim now passes every
variant; a run completes the person's picks to the first listed non-Max
variant that holds them (a Max one only when picked), and the picker's
defaults are the variant a run starts on.
… why

A forced ListModels (a sign-in, a Retry) answered from the disk copy it
meant to replace after 100ms; it now waits for the agent. With no models
anywhere, the agent's own reason is kept instead of a generic one. MCP
list_models asks again with force when the kept catalog is empty or failed
and never returns an empty list as success; create_chat checks a model it
doesn't find against a fresh catalog before refusing it.
…ome back

The catalog was looked up once when the engine connected. An agent whose
models came empty or failed then (Cursor with a dead key) was left out of
the picker's tabs, and the catalog stood complete, so nothing asked again:
a sign-in skipped an agent with no models entry, and signing in again to
the same account changed no login at all.

Each agent's models now carry a status (loading, ready, empty, error) and
the error's words, and every offered agent keeps its tab. They're asked
again, forced, when its logins change or are seen signed in while its
models failed; when a picker opens (empty, failed, missing, or older than
ten minutes, without holding the open: chat.catalog_fresh); and from the
picker's Retry (chat.catalog_retry). The picker says "No models — sign in"
(opening Providers) or "Couldn't load models" with Retry, in the chat and
side-chat composers, new chats, and Settings' thread naming.
A Cursor slot was keyed by the store's email, else by its key, and the SDK
doesn't always keep the email, so signing in again to the same account
kept the dead slot (its revoked key) beside the new one, one switch away
from breaking Cursor again. Slots now also know the Cursor user (from the
usage probe's session), and a login of the same account, by email in any
case or by user, replaces its older slots.

A login whose key was rejected (401/403) or has expired is marked invalid
with its reason (additive invalid/invalidReason fields); activating it is
refused unless forced, it's never pinned, and a new sign-in takes over
from it. Settings shows it with the reason and a Remove, not a switch.
@zeronsh
zeronsh Bot force-pushed the zeron/cursor-picker-catalog branch from 1e960b7 to 839cd1e Compare November 17, 2026 23:48

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant