Skip to content

fix(accounts): a model runs only on its own provider - #549

Open
vaakx-dev wants to merge 1 commit into
mainfrom
sand/stop-provider-switching
Open

vaakx-dev wants to merge 1 commit into
mainfrom
sand/stop-provider-switching

Conversation

@vaakx-dev

Copy link
Copy Markdown
Owner

A model id with a provider prefix now runs only on that provider; with no sign-in there, the turn fails and says so.

What

  • Removed the catalog fallback that ran claude/<model> on any other plan offering a model of the same name (for example Antigravity) when the named provider had no sign-in.
  • The turn fails with <model> runs only on <provider>, and no <provider> account is signed in. Sign in under Settings → Accounts, or pick another model. The LLM contract gains missing(id), so the provider-threads check and the model matcher report the same error instead of … is not available; pick another model or No model matches.
  • Prefixed ids never match a model by name on another provider. Before, anthropic/x could match an OpenRouter model named anthropic/x, both in the model matcher and on the share route.
  • An id that names one account of a plan (plan-2/m) still runs on that plan's pool. This is the one part of the old fallback that stays, now limited to the same plan.

Why

  • The fallback quietly spent a paid plan the user never picked.

Verification

  • bunx tsc: clean.
  • bun test on accounts, provider-threads, model, account-pool, subagents, orchestrator and threads-mcp: everything passes except an agent lists, messages, stops and waits for its subagent on another PC…, which also times out on main on this PC.
  • New tests: a chat on absent/m, with only another plan offering m, fails with the provider error and sends nothing to the other plan. The matcher refuses anthropic/opus when only OpenRouter has a model with that name. The existing account-pool tests cover pooling within one plan, including a saved single-account id.

- an id like claude/<model> no longer moves to another provider that offers the same model when that provider has no sign-in
- the turn fails with an error naming the provider and saying to sign in or pick another model
- prefixed ids never match another provider's model by name, in the model matcher and on shared accounts
- an id naming one account of a plan still runs on that plan's pool
@github-actions

Copy link
Copy Markdown

Performance: ✅ every row is within its limit

Main 932d802 against this PR c23290b, both measured in the same job, medians of 5 runs. Times, memory and CPU fail when the PR is more than 15% worse, bytes when they grow more than 5%; changes under 20 ms or 2 KB never fail. Logs

main PR change
Phone (4× slower CPU, 150 ms, 9 Mbit/s link)
open a chat: shows 320 ms 321 ms +0.5% ✅
open a chat: usable 378 ms 335 ms -11.3% ✅
first visit with an empty cache: usable 2.06 s 2.07 s +0.3% ✅
open a long chat: usable 330 ms 326 ms -1.2% ✅
send: your message shows 72 ms 71 ms -1.0% ✅
send: first reply text shows 344 ms 329 ms -4.1% ✅
main thread blocked over these steps 887 ms 883 ms -0.5% ✅
data on first visit 931.3 KB 931.3 KB +0.0% ✅
data per chat opened 49.9 KB 49.5 KB -0.7% ✅
data while idle for 20 s 220 B 220 B 0% ✅
app code a phone downloads 1.6 MB 1.6 MB 0% ✅
Main pages (same phone and link)
Settings: time to open 58 ms 54 ms -6.9% ✅
Settings: data to open 100 B 100 B 0% ✅
Settings: data per minute left open 600 B 600 B 0% ✅
Add-ons: time to open 82 ms 80 ms -1.7% ✅
Add-ons: data to open 0 B 0 B 0% ✅
Add-ons: data per minute left open 600 B 600 B 0% ✅
Usage: time to open 56 ms 57 ms +2.3% ✅
Usage: data to open 14.5 KB 14.5 KB 0% ✅
Usage: data per minute left open 600 B 600 B 0% ✅
Search: time to open 76 ms 72 ms -5.5% ✅
Search: data to open 0 B 0 B 0% ✅
Search: data per minute left open 600 B 600 B 0% ✅
Performance: time to open 438 ms 441 ms +0.5% ✅
Performance: data to open 851 B 803 B -5.6% ✅
Performance: data per minute left open 1.8 KB 1.9 KB +5.7% ✅
PC side
start-up until ready 2.69 s 2.68 s -0.6% ✅
memory while idle 236.6 MB 236.1 MB -0.2% ✅
CPU used over 60 s idle 310 ms 310 ms 0% ✅
memory after 100 scripted chat turns 273.7 MB 274.8 MB +0.4% ✅
CPU for one reply 39 ms 39 ms 0% ✅
search time on 100k messages 73 ms 71 ms -1.9% ✅
database size per 10k messages 19.8 MB 19.8 MB +0.0% ✅
worktree list with sizes on 40 worktrees 579 ms 585 ms +1.0% ✅
slowest other reply during a worktree list 38 ms 44 ms +17.2% ✅

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