Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

chore: files changed app/src/services/api/aiSettingsApi.ts

Steven Enamakel394362313895
diff --git a/app/src/services/api/aiSettingsApi.ts b/app/src/services/api/aiSettingsApi.ts
index e71bffcfb9..14f281ffc2 100644
--- a/app/src/services/api/aiSettingsApi.ts
+++ b/app/src/services/api/aiSettingsApi.ts
@@ -147,6 +147,12 @@ export interface AISettings {
* image attachments for custom/BYOK models.
*/
modelRegistry: ModelRegistryEntry[];
+ /**
+ * The managed "default model" (Routing → Default model): the catalog id a
+ * managed `chat` turn runs on. Raw `config.default_model` — a managed tier
+ * name (`chat-v1`) means nothing is pinned and the backend picks.
+ */
+ defaultModel?: string;
/**
* #3767: authoritative, core-side per-tier decision (mirrors the Rust factory's
* real routing resolution). For each chat-mode tier (`chat` = Quick mode,
@@ -355,7 +361,9 @@ export async function loadAISettings(): Promise<AISettings> {
reasoning: config.credits_bypass?.reasoning === true,
};
- return { cloudProviders, routing, modelRegistry, creditsBypass };
+ const defaultModel = (config.default_model ?? '').trim();
+
+ return { cloudProviders, routing, modelRegistry, defaultModel, creditsBypass };
}
// ─── Write path: diff + save ───────────────────────────────────────────────
@@ -401,6 +409,10 @@ export async function saveAISettings(prev: AISettings, next: AISettings): Promis
}
}
+ if ((prev.defaultModel ?? '') !== (next.defaultModel ?? '')) {
+ patch.default_model = next.defaultModel ?? '';
+ }
+
// Per-model registry (vision flags): any change → send the full list.
if (!modelRegistriesEqual(prev.modelRegistry, next.modelRegistry)) {
patch.model_registry = next.modelRegistry.map(