feat(desktop): warn when main-model switch leaves auxiliary tasks pinned to another provider (#40286)

Switching the main model never touches auxiliary slot pins (they're
independent, sticky per-task overrides). A user who switches main away
from a now-unpaid provider keeps paying 402s on every background aux call
until they manually reset those pins — silently, with no UI signal.

- /api/model/set scope:'main' now returns stale_aux: slots still pinned
  to a provider different from the new main (additive field).
- Desktop Model Settings shows a switch-time notice after Apply AND a
  persistent banner when any loaded aux slot mismatches the main provider,
  both wired to the existing 'Reset all to main' action.
- Never auto-clears pins — a dedicated cheaper aux model is a legitimate
  config; surface-and-offer instead of nuking.
- Fixes a stale pre-existing assertion in the panel test (main model now
  renders via selectors, not a standalone label).
This commit is contained in:
Teknium
2026-06-05 23:35:36 -07:00
committed by GitHub
parent f8a241e105
commit b91aade176
7 changed files with 217 additions and 3 deletions
+12
View File
@@ -1608,6 +1608,14 @@ export interface ModelAssignmentRequest {
task?: string;
}
/** An auxiliary task still pinned to a provider that differs from the
* newly-selected main provider after a main-model switch. */
export interface StaleAuxAssignment {
task: string;
provider: string;
model: string;
}
export interface ModelAssignmentResponse {
ok: boolean;
scope?: string;
@@ -1615,6 +1623,10 @@ export interface ModelAssignmentResponse {
model?: string;
tasks?: string[];
reset?: boolean;
/** Auxiliary slots still pinned to a different provider than the new main.
* Switching main never clears aux pins; this lets the UI warn the user
* their helper tasks aren't following the switch. Only set on scope:'main'. */
stale_aux?: StaleAuxAssignment[];
}
// ── OAuth provider types ────────────────────────────────────────────────