From 0a3d5d8aae07e9f518dc652a16da0ae77c7cb620 Mon Sep 17 00:00:00 2001 From: archer <545436317@qq.com> Date: Tue, 7 Apr 2026 21:25:15 +0800 Subject: [PATCH] fix: model refresh --- .../docs/self-host/upgrading/4-14/41411.mdx | 15 +++++++++++++++ document/content/docs/toc.mdx | 1 + document/data/doc-last-modified.json | 8 ++++---- .../components/core/ai/SettingLLMModel/index.tsx | 12 +++++++----- 4 files changed, 27 insertions(+), 9 deletions(-) create mode 100644 document/content/docs/self-host/upgrading/4-14/41411.mdx diff --git a/document/content/docs/self-host/upgrading/4-14/41411.mdx b/document/content/docs/self-host/upgrading/4-14/41411.mdx new file mode 100644 index 000000000000..5662c44cae50 --- /dev/null +++ b/document/content/docs/self-host/upgrading/4-14/41411.mdx @@ -0,0 +1,15 @@ +--- +title: 'V4.14.11(进行中)' +description: 'FastGPT V4.14.11 更新说明' +--- + + +## 🚀 新增内容 + + +## ⚙️ 优化 + + +## 🐛 修复 + +1. 对话 Agent 模式,模型存在刷新后被重置问题。 \ No newline at end of file diff --git a/document/content/docs/toc.mdx b/document/content/docs/toc.mdx index 9ba7b6296903..ef834411bd10 100644 --- a/document/content/docs/toc.mdx +++ b/document/content/docs/toc.mdx @@ -113,6 +113,7 @@ description: FastGPT 文档目录 - [/docs/self-host/upgrading/4-14/4140](/docs/self-host/upgrading/4-14/4140) - [/docs/self-host/upgrading/4-14/4141](/docs/self-host/upgrading/4-14/4141) - [/docs/self-host/upgrading/4-14/41410](/docs/self-host/upgrading/4-14/41410) +- [/docs/self-host/upgrading/4-14/41411](/docs/self-host/upgrading/4-14/41411) - [/docs/self-host/upgrading/4-14/4142](/docs/self-host/upgrading/4-14/4142) - [/docs/self-host/upgrading/4-14/4143](/docs/self-host/upgrading/4-14/4143) - [/docs/self-host/upgrading/4-14/4144](/docs/self-host/upgrading/4-14/4144) diff --git a/document/data/doc-last-modified.json b/document/data/doc-last-modified.json index a128bafd95af..5e4d5e80854b 100644 --- a/document/data/doc-last-modified.json +++ b/document/data/doc-last-modified.json @@ -173,8 +173,8 @@ "document/content/docs/self-host/custom-models/ollama.mdx": "2026-03-03T17:39:47+08:00", "document/content/docs/self-host/custom-models/xinference.en.mdx": "2026-03-30T10:05:42+08:00", "document/content/docs/self-host/custom-models/xinference.mdx": "2026-03-30T10:05:42+08:00", - "document/content/docs/self-host/deploy/docker.en.mdx": "2026-03-31T23:15:29+08:00", - "document/content/docs/self-host/deploy/docker.mdx": "2026-04-02T10:04:45+08:00", + "document/content/docs/self-host/deploy/docker.en.mdx": "2026-04-02T23:10:34+08:00", + "document/content/docs/self-host/deploy/docker.mdx": "2026-04-02T23:10:34+08:00", "document/content/docs/self-host/deploy/sealos.en.mdx": "2026-03-03T17:39:47+08:00", "document/content/docs/self-host/deploy/sealos.mdx": "2026-03-03T17:39:47+08:00", "document/content/docs/self-host/design/dataset.en.mdx": "2026-03-03T17:39:47+08:00", @@ -221,7 +221,7 @@ "document/content/docs/self-host/upgrading/4-14/4141.en.mdx": "2026-03-03T17:39:47+08:00", "document/content/docs/self-host/upgrading/4-14/4141.mdx": "2026-03-03T17:39:47+08:00", "document/content/docs/self-host/upgrading/4-14/41410.en.mdx": "2026-03-31T23:15:29+08:00", - "document/content/docs/self-host/upgrading/4-14/41410.mdx": "2026-04-01T13:34:01+08:00", + "document/content/docs/self-host/upgrading/4-14/41410.mdx": "2026-04-02T13:43:47+08:00", "document/content/docs/self-host/upgrading/4-14/4142.en.mdx": "2026-03-03T17:39:47+08:00", "document/content/docs/self-host/upgrading/4-14/4142.mdx": "2026-03-03T17:39:47+08:00", "document/content/docs/self-host/upgrading/4-14/4143.en.mdx": "2026-03-03T17:39:47+08:00", @@ -241,7 +241,7 @@ "document/content/docs/self-host/upgrading/4-14/41481.en.mdx": "2026-03-09T12:02:02+08:00", "document/content/docs/self-host/upgrading/4-14/41481.mdx": "2026-03-09T17:39:53+08:00", "document/content/docs/self-host/upgrading/4-14/4149.en.mdx": "2026-03-23T12:17:04+08:00", - "document/content/docs/self-host/upgrading/4-14/4149.mdx": "2026-03-25T20:20:19+08:00", + "document/content/docs/self-host/upgrading/4-14/4149.mdx": "2026-04-07T21:01:52+08:00", "document/content/docs/self-host/upgrading/outdated/40.en.mdx": "2026-03-03T17:39:47+08:00", "document/content/docs/self-host/upgrading/outdated/40.mdx": "2026-03-03T17:39:47+08:00", "document/content/docs/self-host/upgrading/outdated/41.en.mdx": "2026-03-03T17:39:47+08:00", diff --git a/projects/app/src/components/core/ai/SettingLLMModel/index.tsx b/projects/app/src/components/core/ai/SettingLLMModel/index.tsx index 78044021e1a0..f26fa2fd0966 100644 --- a/projects/app/src/components/core/ai/SettingLLMModel/index.tsx +++ b/projects/app/src/components/core/ai/SettingLLMModel/index.tsx @@ -29,27 +29,29 @@ const SettingLLMModel = ({ const model = defaultData.model; - const { modelSet, modelList } = useMemoEnhance(() => { + const { modelSet, modelList, defaultLLMModel } = useMemoEnhance(() => { const modelSet = new Set(llmModelList.map((item) => item.model)); return { modelList: llmModelList, - modelSet + modelSet, + defaultLLMModel: getWebDefaultLLMModel(llmModelList).model }; }, [llmModelList]); // Set default model const lastDefaultModel = useLatest(defaultModel); useEffect(() => { + if (modelSet.size === 0) return; if (!modelSet.has(model)) { - const defaultLLM = lastDefaultModel.current || getWebDefaultLLMModel(modelList).model; - if (defaultLLM) { + const defaultLLM = lastDefaultModel.current || defaultLLMModel; + if (defaultLLM && modelSet.has(defaultLLM)) { onChange({ ...defaultData, model: defaultLLM }); } } - }, [modelList, model, defaultData]); + }, [model, defaultData, modelSet, defaultLLMModel]); const { isOpen: isOpenAIChatSetting,