From 714e5ec29250d42f6e48ddd8ca54ec3bb73ae573 Mon Sep 17 00:00:00 2001
From: yaqi <1360968891@qq.com>
Date: Tue, 24 Nov 2026 18:30:19 +0800
Subject: [PATCH] feat(settings): show the fallback chain on the language
models page
---
.../sections/models/LlmSettingsSection.tsx | 37 +++++++++++++++++++
web/lib/model-catalog-types.ts | 5 +++
web/locales/en/app.json | 2 +
web/locales/zh/app.json | 2 +
4 files changed, 46 insertions(+)
diff --git a/web/features/settings/sections/models/LlmSettingsSection.tsx b/web/features/settings/sections/models/LlmSettingsSection.tsx
index 1f889d78a..2ac0e26c8 100644
--- a/web/features/settings/sections/models/LlmSettingsSection.tsx
+++ b/web/features/settings/sections/models/LlmSettingsSection.tsx
@@ -1,9 +1,45 @@
"use client";
+
import { useTranslation } from "react-i18next";
+
import { ModelsWorkspace } from "@/components/settings/ModelsWorkspace";
import { SettingsPageHeader } from "@/components/settings/shared";
+import { useSettings } from "@/features/settings/store/SettingsStore";
+
+/**
+ * The ordered fallback chain (#2693) is configured outside this page for now.
+ * Show it read-only so an operator can tell whether a failover path exists —
+ * an Apply on this page preserves the chain, it does not create one.
+ */
+function FallbackChainNotice() {
+ const { t } = useTranslation();
+ const { catalog } = useSettings();
+ const chain = catalog.services.llm.fallbacks ?? [];
+ if (chain.length === 0) return null;
+ return (
+
+
+ {t("Fallback chain: {{count}} configured", { count: chain.length })}
+
+
+ {t(
+ "When the active model fails before any output, DeepTutor tries these in order and returns to the primary once its cooldown ends. Edited in the catalog, not on this page.",
+ )}
+
+
+ {chain.map((entry) => (
+ -
+ {entry.profile_id} / {entry.model_id}
+
+ ))}
+
+
+ );
+}
+
export default function LlmSettingsPage() {
const { t } = useTranslation();
+
return (
+
);
diff --git a/web/lib/model-catalog-types.ts b/web/lib/model-catalog-types.ts
index eac342179..ddb3c732b 100644
--- a/web/lib/model-catalog-types.ts
+++ b/web/lib/model-catalog-types.ts
@@ -145,6 +145,11 @@ export type CatalogService = {
active_model_id?: string | null;
/** `task` only: the tasks that run on something other than the global choice. */
overrides?: Record;
+ /**
+ * `llm` only: the ordered fallback chain (#2693). Edited outside this page;
+ * the settings UI only displays it, and an Apply without the key preserves it.
+ */
+ fallbacks?: { profile_id: string; model_id: string }[];
profiles: CatalogProfile[];
};
diff --git a/web/locales/en/app.json b/web/locales/en/app.json
index 3929d6e2a..672b975c5 100644
--- a/web/locales/en/app.json
+++ b/web/locales/en/app.json
@@ -1744,6 +1744,8 @@
"Public API base": "Public API base",
"Leave blank for local Docker. Use the externally reachable backend URL, including any proxy path.": "Leave blank for local Docker. Use the externally reachable backend URL, including any proxy path.",
"CORS origins": "CORS origins",
+ "Fallback chain: {{count}} configured": "Fallback chain: {{count}} configured",
+ "When the active model fails before any output, DeepTutor tries these in order and returns to the primary once its cooldown ends. Edited in the catalog, not on this page.": "When the active model fails before any output, DeepTutor tries these in order and returns to the primary once its cooldown ends. Edited in the catalog, not on this page.",
"Only required for authenticated cross-origin deployments. Use frontend origins, not API URLs.": "Only required for authenticated cross-origin deployments. Use frontend origins, not API URLs.",
"Comma, semicolon, and newline separators are accepted. Bare host:port values are stored as http://host:port.": "Comma, semicolon, and newline separators are accepted. Bare host:port values are stored as http://host:port.",
"Auth is enabled but secure cookies are off. Cross-site HTTPS deployments should set auth.cookie_secure=true and restart so SameSite=None cookies work in modern browsers.": "Auth is enabled but secure cookies are off. Cross-site HTTPS deployments should set auth.cookie_secure=true and restart so SameSite=None cookies work in modern browsers.",
diff --git a/web/locales/zh/app.json b/web/locales/zh/app.json
index e9b5459bf..deeefbe65 100644
--- a/web/locales/zh/app.json
+++ b/web/locales/zh/app.json
@@ -1160,6 +1160,8 @@
"Public API base": "公共 API base",
"Leave blank for local Docker. Use the externally reachable backend URL, including any proxy path.": "本机 Docker 留空即可。远程部署填写浏览器可访问的后端 URL,可包含代理路径。",
"CORS origins": "CORS 来源",
+ "Fallback chain: {{count}} configured": "回退链:已配置 {{count}} 个",
+ "When the active model fails before any output, DeepTutor tries these in order and returns to the primary once its cooldown ends. Edited in the catalog, not on this page.": "当前模型在产生输出前失败时,会按顺序尝试这些候选;主模型冷却结束后自动回切。该配置在目录中编辑,不在本页修改。",
"Only required for authenticated cross-origin deployments. Use frontend origins, not API URLs.": "仅认证跨域部署需要填写。这里填前端页面来源,不是 API URL。",
"Comma, semicolon, and newline separators are accepted. Bare host:port values are stored as http://host:port.": "支持逗号、分号和换行分隔。裸 host:port 会按 http://host:port 保存。",
"Auth is enabled but secure cookies are off. Cross-site HTTPS deployments should set auth.cookie_secure=true and restart so SameSite=None cookies work in modern browsers.": "认证已启用,但安全 Cookie 未开启。跨站 HTTPS 部署应设置 auth.cookie_secure=true 并重启,使 SameSite=None Cookie 在现代浏览器中生效。",