[eric] models: the free lane's haiku default can no longer outlive the lane or get persisted by the guard (ENG-343)

This commit is contained in:
ciregenz
2026-08-18 19:04:38 -07:00
parent 61521453bb
commit a08be0e823
2 changed files with 6 additions and 0 deletions
+3
View File
@@ -84,6 +84,9 @@ def migrate_legacy_fields(raw: dict) -> dict:
if raw.get("connection_mode") == "free-trial":
raw["connection_mode"] = "own_key"
raw.pop("free_trial_token", None)
# The free lane's forced Haiku default must not outlive the lane (ENG-343): dropping the field lets the real default take over.
if raw.get("default_model") == "haiku":
raw.pop("default_model", None)
return raw
+3
View File
@@ -376,6 +376,9 @@ const DefaultModelGuard: React.FC<{ children: React.ReactNode }> = ({ children }
const currentExists = flat.some((m) => m.value === settings.default_model);
if (currentExists) return;
// Nothing real connected means the synthesized free row is the whole list; persisting it would brand haiku as the user's default forever (ENG-343).
if (!flat.some((m) => m.billing_kind !== 'free')) return;
const fallback = pickFallbackModel(byProvider);
if (!fallback || fallback.value === settings.default_model) return;