Repository navigation
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
Open
zeronsh[bot] wants to merge 5 commits into
zeronsh[bot] wants to merge 5 commits into
Conversation
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
Bot
force-pushed
the
zeron/cursor-picker-catalog
branch
from
November 17, 2026 23:48
1e960b7 to
839cd1e
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Chats::connected→load_catalog(false)).catalog_ofleft out every agent without models, so Cursor's tab disappeared.accounts_changedreturned early when the agent had nomodelsentry, which is the case when ListModels failed.changed_loginscompares 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.ListModelswith 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:
fastalone. Before this change the shim passed only the default variant, so the harness couldn't choose a valid one.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/*)chat.catalognow has astatus(loading/ready/empty/error) and anerrormessage.emptyshows "No models — sign in", with a button that opens Settings → Providers.errorshows "Couldn't load models", the reason, and Retry.loadingshows skeleton rows.accounts_changedrefetches withforce, even when the agent has no models entry yet. It re-lists agents if this one isn't listed.accounts_seenrefetches an agent that is signed in but whose models failed or came back empty.chat.catalog_freshrefetches entries that are empty, failed, missing or older than 10 minutes. It doesn't block the open and skips agents already being fetched.chat.catalog_retry { harness }.Remote).Settings
settings/general.luau) lists agents without models as disabled rows that say why, and refetches when the page opens.ListHarnesses, which doesn't depend on models, so Cursor already showed there.Orchestrator create dialog's model chip
apps/zgx/ui. The only orchestrator in zgx is the voice one insrc/sessions.rs, which has no picker. All the ways to pick a model listed above shareds.ModelPickerand the same catalog.MCP
list_models/create_chat(crates/mcp)list_modelsasks again withforcewhen the stored catalog is empty or failed.create_chatchecks a model it can't find against a freshly fetched catalog before refusing it.list_harnessesalready listed every agent.Engine (
crates/engine/src/model_catalogs.rs)Cursor variant bug (
crates/harness/src/cursor)fastcases 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)invalidandinvalidReasonare additive and optional.ActivateAgentAccount { force }).crates/uistill 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_againa_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_modelsa_rejected_key_is_shown_to_remove_never_to_switch_tozgx UI (
zgx test ui):ui/tests/model_picker_catalog.test.luauhas 8 tests, covering:catalog_retry:cursor;catalog_fresh;ui/tests/provider_rejected.test.luauhas 2 tests. The full UI suite had 1474 passed and 1 failed. The failure (settings_archived.test.luau"thousands archived") fails the same way onmain.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_catalogsneedsRUST_MIN_STACK=16777216locally onmaintoo.Engine:
a_forced_list_waits_for_the_agent_instead_of_its_disk_copyno_models_anywhere_says_the_agents_own_reasona_cursor_relogin_of_the_same_account_replaces_its_dead_slota_rejected_cursor_key_is_invalid_and_never_switched_toan_expired_cursor_key_is_invalid_without_a_probecargo test -p zeron-engine --lib: 1184 passed, 5 failed. The same 5 fail onmainin this environment: commit_credit ×2, harness_updates shutdown, git_service history, and the registry default slots.crates/uidoesn'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"') fromui/picker_cursor_fixture.luau. No credentials were needed.Cursor's tab and its models:
A failed list, and an empty list:
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.