From 9bbdaab0f7e45e9529d1903999a482803c7d106c Mon Sep 17 00:00:00 2001 From: Archer <545436317@qq.com> Date: Sat, 25 Apr 2026 21:37:55 +0800 Subject: [PATCH] fix: adapt systemTool (#6817) --- .../self-host/upgrading/4-14/41414.en.mdx | 21 +++++ .../self-host/upgrading/4-14/41415.en.mdx | 18 +++++ .../docs/self-host/upgrading/4-14/41415.mdx | 20 +++++ document/content/docs/toc.en.mdx | 2 + document/content/docs/toc.mdx | 1 + document/data/doc-last-modified.json | 2 +- packages/service/core/app/tool/controller.ts | 9 ++- packages/service/core/app/utils.ts | 1 + .../core/workflow/dispatch/child/runTool.ts | 1 - .../core/workflow/dispatch/plugin/run.ts | 79 ++++++++++++------- .../web/components/common/MySelect/index.tsx | 4 +- .../Flow/nodes/render/NodeCard.tsx | 15 ++-- .../pageComponents/app/detail/useChatTest.tsx | 38 +++++---- .../pages/api/core/app/tool/getVersionList.ts | 15 +++- 14 files changed, 163 insertions(+), 63 deletions(-) create mode 100644 document/content/docs/self-host/upgrading/4-14/41414.en.mdx create mode 100644 document/content/docs/self-host/upgrading/4-14/41415.en.mdx create mode 100644 document/content/docs/self-host/upgrading/4-14/41415.mdx diff --git a/document/content/docs/self-host/upgrading/4-14/41414.en.mdx b/document/content/docs/self-host/upgrading/4-14/41414.en.mdx new file mode 100644 index 0000000000..1ff600a1ee --- /dev/null +++ b/document/content/docs/self-host/upgrading/4-14/41414.en.mdx @@ -0,0 +1,21 @@ +--- +title: 'V4.14.14' +description: 'FastGPT V4.14.14 Release Notes' +--- + +## Upgrade Guide + +### 1. Update image tags + +- Update fastgpt-app (FastGPT main service) image tag to: v4.14.14 +- Update fastgpt-pro (FastGPT commercial) image tag to: v4.14.14 + +## 🐛 Bug Fixes + + +## ⚙️ Optimizations + +1. Personal WeChat publishing channel: optimized polling strategy by decoupling pull from reply, preventing blocking under high message volume. +2. Added environment variable `WECHAT_CHANNEL_CONCURRENCY` (default 1000) to control the WeChat channel poll worker concurrency. Recommended to set ≥ peak online channel count. +3. Improved internal network address detection. +4. Added compatibility for DeepSeek tool calling combined with thinking mode to avoid 400 errors from the API. diff --git a/document/content/docs/self-host/upgrading/4-14/41415.en.mdx b/document/content/docs/self-host/upgrading/4-14/41415.en.mdx new file mode 100644 index 0000000000..17d051430f --- /dev/null +++ b/document/content/docs/self-host/upgrading/4-14/41415.en.mdx @@ -0,0 +1,18 @@ +--- +title: 'V4.14.14' +description: 'FastGPT V4.14.14 Release Notes' +--- + +## Upgrade Guide + +### 1. Update image tags + +- Update fastgpt-app (FastGPT main service) image tag to: v4.14.15 +- Update fastgpt-pro (FastGPT commercial) image tag to: v4.14.15 + +## 🐛 Bug Fixes + +1. Fixed compatibility for legacy system tools. +2. Fixed an issue where selecting a system component as a system tool caused errors. + +## ⚙️ Optimizations diff --git a/document/content/docs/self-host/upgrading/4-14/41415.mdx b/document/content/docs/self-host/upgrading/4-14/41415.mdx new file mode 100644 index 0000000000..b6bdead397 --- /dev/null +++ b/document/content/docs/self-host/upgrading/4-14/41415.mdx @@ -0,0 +1,20 @@ +--- +title: 'V4.14.15' +description: 'FastGPT V4.14.15 更新说明' +--- + +## 升级指南 + +建议 4.14.8 以后的用户直接升级到该版本使用。 + +### 1. 更新镜像 tag + +- 更新 fastgpt-app(fastgpt 主服务) 镜像 tag: v4.14.15 +- 更新 fastgpt-pro(fastgpt 商业版) 镜像 tag: v4.14.15 + +## 🐛 修复 + +1. 修复兼容旧版的系统工具。 +2. 修复选中系统组件为系统工具异常。 + +## ⚙️ 优化 diff --git a/document/content/docs/toc.en.mdx b/document/content/docs/toc.en.mdx index 4a7483c502..4db2f09e0d 100644 --- a/document/content/docs/toc.en.mdx +++ b/document/content/docs/toc.en.mdx @@ -118,6 +118,8 @@ description: FastGPT Toc - [/en/docs/self-host/upgrading/4-14/41411](/en/docs/self-host/upgrading/4-14/41411) - [/en/docs/self-host/upgrading/4-14/41412](/en/docs/self-host/upgrading/4-14/41412) - [/en/docs/self-host/upgrading/4-14/41413](/en/docs/self-host/upgrading/4-14/41413) +- [/en/docs/self-host/upgrading/4-14/41414](/en/docs/self-host/upgrading/4-14/41414) +- [/en/docs/self-host/upgrading/4-14/41415](/en/docs/self-host/upgrading/4-14/41415) - [/en/docs/self-host/upgrading/4-14/4142](/en/docs/self-host/upgrading/4-14/4142) - [/en/docs/self-host/upgrading/4-14/4143](/en/docs/self-host/upgrading/4-14/4143) - [/en/docs/self-host/upgrading/4-14/4144](/en/docs/self-host/upgrading/4-14/4144) diff --git a/document/content/docs/toc.mdx b/document/content/docs/toc.mdx index aa652a17ba..2aa06e16bb 100644 --- a/document/content/docs/toc.mdx +++ b/document/content/docs/toc.mdx @@ -118,6 +118,7 @@ description: FastGPT 文档目录 - [/docs/self-host/upgrading/4-14/41412](/docs/self-host/upgrading/4-14/41412) - [/docs/self-host/upgrading/4-14/41413](/docs/self-host/upgrading/4-14/41413) - [/docs/self-host/upgrading/4-14/41414](/docs/self-host/upgrading/4-14/41414) +- [/docs/self-host/upgrading/4-14/41415](/docs/self-host/upgrading/4-14/41415) - [/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 dff6570bcd..1e20ff4a2f 100644 --- a/document/data/doc-last-modified.json +++ b/document/data/doc-last-modified.json @@ -230,7 +230,7 @@ "document/content/docs/self-host/upgrading/4-14/41412.mdx": "2026-04-21T23:04:26+08:00", "document/content/docs/self-host/upgrading/4-14/41413.en.mdx": "2026-04-21T23:04:26+08:00", "document/content/docs/self-host/upgrading/4-14/41413.mdx": "2026-04-21T23:04:26+08:00", - "document/content/docs/self-host/upgrading/4-14/41414.mdx": "2026-04-22T23:35:11+08:00", + "document/content/docs/self-host/upgrading/4-14/41414.mdx": "2026-04-24T18:34:55+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", diff --git a/packages/service/core/app/tool/controller.ts b/packages/service/core/app/tool/controller.ts index cb1060299f..e8cdea02ef 100644 --- a/packages/service/core/app/tool/controller.ts +++ b/packages/service/core/app/tool/controller.ts @@ -446,7 +446,6 @@ export async function getChildAppPreviewNode({ } // http tool else if (source === AppToolSourceEnum.http) { - console.log('pluginId', pluginId); const [parentId, ...rest] = pluginId.split('/'); const toolName = rest.join('/'); const toolset = await MongoApp.findById(parentId).lean(); @@ -718,10 +717,14 @@ export const refreshSystemTools = async (): Promise = return concatTools; }; -// toolId: systemTool-id, commercial-id +// toolId: systemTool-id, commercial-id, community-id(deprecated, 映射为 systemTool-id) export const getSystemToolById = async (toolId: string): Promise => { const tools = await getSystemTools(); - const tool = tools.find((item) => item.id === toolId); + // 兼容旧的 community- 前缀,统一归一化为 systemTool- + const normalizedId = toolId.startsWith(`${AppToolSourceEnum.community}-`) + ? `${AppToolSourceEnum.systemTool}-${toolId.slice(AppToolSourceEnum.community.length + 1)}` + : toolId; + const tool = tools.find((item) => item.id === normalizedId); if (tool) { return cloneDeep(tool); } diff --git a/packages/service/core/app/utils.ts b/packages/service/core/app/utils.ts index 22d2a484d8..abc0f2863b 100644 --- a/packages/service/core/app/utils.ts +++ b/packages/service/core/app/utils.ts @@ -87,6 +87,7 @@ export async function rewriteAppWorkflowToDetail({ const result = await loadToolNode({ id: node.pluginId, versionId: node.version }); if (result.success) { const preview = result.data!; + node.avatar = preview.avatar ?? node.avatar; node.isFolder = preview.isFolder; node.pluginData = { name: preview.name, diff --git a/packages/service/core/workflow/dispatch/child/runTool.ts b/packages/service/core/workflow/dispatch/child/runTool.ts index 2883f68721..53dcf0db92 100644 --- a/packages/service/core/workflow/dispatch/child/runTool.ts +++ b/packages/service/core/workflow/dispatch/child/runTool.ts @@ -50,7 +50,6 @@ export const dispatchRunTool = async (props: RunToolProps): Promise( { + minW={(() => { const w = ButtonRef.current?.clientWidth; if (w) { return `${w}px !important`; @@ -300,6 +299,7 @@ const MySelect = ( ? width.map((item) => `${item} !important`) : `${width} !important`; })()} + w={'max-content'} px={'6px'} py={'6px'} border={'1px solid #fff'} diff --git a/projects/app/src/pageComponents/app/detail/WorkflowComponents/Flow/nodes/render/NodeCard.tsx b/projects/app/src/pageComponents/app/detail/WorkflowComponents/Flow/nodes/render/NodeCard.tsx index 43b6ebd1af..4b23d2870b 100644 --- a/projects/app/src/pageComponents/app/detail/WorkflowComponents/Flow/nodes/render/NodeCard.tsx +++ b/projects/app/src/pageComponents/app/detail/WorkflowComponents/Flow/nodes/render/NodeCard.tsx @@ -655,6 +655,15 @@ const NodeVersion = React.memo(function NodeVersion({ node }: { node: FlowNodeIt ); }, [node.isLatestVersion, node?.version, node?.versionLabel, t]); + const ScrollDataWrapper = useCallback( + (props: { children: React.ReactNode }) => ( + + {props.children} + + ), + [ScrollData] + ); + return ( ( - - {props.children} - - )} + ScrollData={ScrollDataWrapper} valueLabel={valueLabel} /> ); diff --git a/projects/app/src/pageComponents/app/detail/useChatTest.tsx b/projects/app/src/pageComponents/app/detail/useChatTest.tsx index e5fcc780a8..6df7d5d181 100644 --- a/projects/app/src/pageComponents/app/detail/useChatTest.tsx +++ b/projects/app/src/pageComponents/app/detail/useChatTest.tsx @@ -150,30 +150,28 @@ export const useChatTest = ({ // eslint-disable-next-line react-hooks/exhaustive-deps }, [variableList]); - const CustomChatContainer = useCallback( - () => - appDetail.type === AppTypeEnum.workflowTool ? ( - - - - ) : ( - + appDetail.type === AppTypeEnum.workflowTool ? ( + + - ), - [appDetail.type, appId, chatId, isReady, restartChat, startChat, chatConfig] + + ) : ( + + ) ); return { diff --git a/projects/app/src/pages/api/core/app/tool/getVersionList.ts b/projects/app/src/pages/api/core/app/tool/getVersionList.ts index b787fc30e5..9a831059bd 100644 --- a/projects/app/src/pages/api/core/app/tool/getVersionList.ts +++ b/projects/app/src/pages/api/core/app/tool/getVersionList.ts @@ -6,7 +6,10 @@ import { type ApiRequestProps } from '@fastgpt/service/type/next'; import { authApp } from '@fastgpt/service/support/permission/app/auth'; import { ReadPermissionVal } from '@fastgpt/global/support/permission/constant'; import { parsePaginationRequest } from '@fastgpt/service/common/api/pagination'; -import { getSystemToolByIdAndVersionId } from '@fastgpt/service/core/app/tool/controller'; +import { + getSystemToolById, + getSystemToolByIdAndVersionId +} from '@fastgpt/service/core/app/tool/controller'; import { AppToolSourceEnum } from '@fastgpt/global/core/app/tool/constants'; import { PluginErrEnum } from '@fastgpt/global/common/error/code/plugin'; import { Types } from '@fastgpt/service/common/mongo'; @@ -35,7 +38,7 @@ async function handler( }; } - const { source, pluginId: formatPluginId, authAppId } = splitCombineToolId(pluginId); + const { source, authAppId } = splitCombineToolId(pluginId); // System tool plugin if (source === AppToolSourceEnum.systemTool) { @@ -62,7 +65,13 @@ async function handler( }); return app._id; } else { - return formatPluginId; + // Get appId from pluginId + const tool = await getSystemToolById(pluginId); + + if (!tool.associatedPluginId) { + return Promise.reject(PluginErrEnum.unExist); + } + return tool.associatedPluginId; } })();