Skip to content

feature: V4.11.1 #5350

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 27 commits into from
Aug 1, 2025
Merged

feature: V4.11.1 #5350

merged 27 commits into from
Aug 1, 2025

Conversation

c121914yu
Copy link
Collaborator

No description provided.

Copy link

github-actions bot commented Jul 31, 2025

Preview sandbox Image:

registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-pr:fatsgpt_sandbox_8733c2f0aad721c38e5bfa114fba194eb62f9051

Copy link

github-actions bot commented Jul 31, 2025

Preview mcp_server Image:

registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-pr:fatsgpt_mcp_server_8733c2f0aad721c38e5bfa114fba194eb62f9051

Copy link

github-actions bot commented Jul 31, 2025

Docs Preview:


🚀 FastGPT Document Preview Ready!

🔗 👀 Click here to visit preview

Copy link

github-actions bot commented Jul 31, 2025

Preview fastgpt Image:

registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-pr:fatsgpt_8733c2f0aad721c38e5bfa114fba194eb62f9051

@c121914yu c121914yu requested a review from Copilot July 31, 2025 07:46
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces FastGPT version 4.11.1 with significant enhancements to the logging system, MCP toolsets, and application workflow functionality.

Key changes include:

  • Enhanced app logs with configurable fields, improved search, filtering by team members, and additional metrics (response time, error count, points)
  • Simplified MCP toolset architecture with new runtime workflow dispatch for dynamic tool expansion
  • Improved system variable handling in workflows and variable management UI

Reviewed Changes

Copilot reviewed 128 out of 137 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
test/cases/global/core/app/jsonschema.test.ts Adds 'reference' to renderTypeList for all input types in test cases
test/cases/function/packages/global/common/string/textSplitter.test.ts Updates table formatting in text splitter tests and adds new test case for table split handling
projects/app/src/web/support/user/hooks/useSendCode.tsx Exports openCodeAuthModal from useSendCode hook
projects/app/src/web/core/workflow/utils.ts Adds systemInputConfig filtering in filterSensitiveNodesData
projects/app/src/web/core/chat/context/chatItemContext.tsx Adds optional chatId field to ChatBoxDataType
projects/app/src/web/core/app/api/plugin.ts Updates team plugin templates handling for MCP tools
projects/app/src/web/core/app/api/log.ts New API module for app log management (updateLogKeys, getLogKeys, getAppChatLogs)
projects/app/src/web/core/app/api.ts Removes app chat logs API and updates delAppById return type
projects/app/src/service/common/system/cron.ts Adds cronRefreshModels to system cron jobs
projects/app/src/pages/dashboard/apps/index.tsx Adds localStorage cleanup for deleted apps
projects/app/src/pages/api/support/mcp/client/getTools.ts Updates MCP tools API to properly await results
Multiple API files Updates to MCP tools handling, app deletion, and log management endpoints
Multiple pageComponents files Extensive updates to logs UI with configurable fields, new filters, and enhanced UX
Multiple i18n files Adds translations for new log management features
packages/web files Updates to hooks, components, and utilities supporting new functionality
packages/service files Core service updates for workflow dispatch, app management, and MCP handling
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (2)

projects/app/src/pageComponents/app/detail/Logs/index.tsx:24

  • [nitpick] The variable name chatSearch is ambiguous. Consider renaming to searchText or chatSearchQuery to better indicate it searches both chat titles and session IDs.
import DateRangePicker, {

packages/service/core/workflow/dispatch/utils.ts:165

  • Function name rewriteRuntimeWorkFlow has inconsistent capitalization. Should be rewriteRuntimeWorkflow to maintain consistency with other function names in the codebase.
export const rewriteRuntimeWorkFlow = async ({

Comment on lines +214 to +222
const [logKeys = DefaultAppLogKeys, setLogKeys] = useLocalStorageState<AppLogKeysType[]>(
`app_log_keys_${appId}`
);
const { runAsync: fetchLogKeys, data: teamLogKeys = [] } = useRequest2(
async () => {
const res = await getLogKeys({ appId });
const keys = res.logKeys.length > 0 ? res.logKeys : DefaultAppLogKeys;
setLogKeys(keys);
return keys;
Copy link
Preview

Copilot AI Jul 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using localStorage with a fallback to DefaultAppLogKeys creates potential synchronization issues. Consider implementing a proper loading state or ensuring the localStorage value is validated against the expected schema.

Suggested change
const [logKeys = DefaultAppLogKeys, setLogKeys] = useLocalStorageState<AppLogKeysType[]>(
`app_log_keys_${appId}`
);
const { runAsync: fetchLogKeys, data: teamLogKeys = [] } = useRequest2(
async () => {
const res = await getLogKeys({ appId });
const keys = res.logKeys.length > 0 ? res.logKeys : DefaultAppLogKeys;
setLogKeys(keys);
return keys;
const [rawLogKeys, setLogKeys] = useLocalStorageState<string>(
`app_log_keys_${appId}`
);
const [logKeys, setValidatedLogKeys] = useState<AppLogKeysType[]>(() => {
try {
const parsedKeys = JSON.parse(rawLogKeys || 'null');
if (Array.isArray(parsedKeys) && parsedKeys.every(key => typeof key === 'string')) {
return parsedKeys as AppLogKeysType[];
}
} catch (e) {
console.warn('Invalid logKeys in localStorage, falling back to default:', e);
}
return DefaultAppLogKeys;
});
const [isLogKeysLoading, setLogKeysLoading] = useState(true);
const { runAsync: fetchLogKeys, data: teamLogKeys = [] } = useRequest2(
async () => {
setLogKeysLoading(true);
try {
const res = await getLogKeys({ appId });
const keys = res.logKeys.length > 0 ? res.logKeys : DefaultAppLogKeys;
setLogKeys(JSON.stringify(keys));
setValidatedLogKeys(keys);
return keys;
} finally {
setLogKeysLoading(false);
}

Copilot uses AI. Check for mistakes.

Comment on lines 217 to 219
...externalProvider.externalWorkflowVariables,
...variables
...getSystemVariables(data)
// ...variables
Copy link
Preview

Copilot AI Jul 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variable merging order has changed with commented out ...variables. This could lead to unexpected behavior where external variables override user-defined variables. Consider documenting the intended precedence or restoring the original order.

Copilot uses AI. Check for mistakes.

@@ -178,6 +183,17 @@ export async function getChildAppPreviewNode({
})
: true;

if (item.type === AppTypeEnum.toolSet) {
const children = await getMCPChildren(item);
Copy link
Preview

Copilot AI Jul 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The getMCPChildren call inside the preview node generation could be expensive for large toolsets. Consider caching or lazy-loading this data to improve performance.

Suggested change
const children = await getMCPChildren(item);
const cacheKey = String(item._id);
let children = mcpChildrenCache.get(cacheKey);
if (!children) {
children = await getMCPChildren(item);
mcpChildrenCache.set(cacheKey, children);
}

Copilot uses AI. Check for mistakes.

...variables,
{
...data,
key: getNanoid(8)
Copy link
Preview

Copilot AI Jul 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The random key generation using getNanoid(8) could potentially create conflicts. Consider using a more robust key generation strategy or adding conflict detection.

Suggested change
key: getNanoid(8)
key: (() => {
let newKey;
do {
newKey = getNanoid(16);
} while (variables.some((item) => item.key === newKey));
return newKey;
})()

Copilot uses AI. Check for mistakes.

FinleyGe and others added 23 commits August 1, 2025 15:23
* feat: support system toolset

* fix: type

* fix: system tool config

* chore: mcptool config migrate

* refactor: mcp toolset

* fix: fe type error

* fix: type error

* fix: show version

* chore: support extract tool's secretInputConfig out of inputs

* chore: compatible with old version mcp

* chore: adjust

* deps: update dependency @fastgpt-skd/plugin

* fix: version
* chore: compatible with old version mcp

* fix: version

* fix: compatible bug

* fix: mcp object params

* fix: type error

* chore: update test cases

* chore: remove log
* log keys config modal

* multiple select

* api

* fontsize

* code

* chatid

* fix build

* fix

* fix component

* change name

* log keys config

* fix

* delete unused

* fix
* doc

* fix: action

* remove log
* feat: table test: 1

* feat: table test: 2

* feat: table test: 3

* feat: table test: 4

* feat: table test : 5 把maxSize改回chunkSize

* feat: table test : 6 都删了,只看maxSize

* feat: table test : 7 恢复初始,接下来删除标签功能

* feat: table test : 8 删除标签功能

* feat: table test : 9 删除标签功能成功

* feat: table test : 10 继续调试,修改trainingStates

* feat: table test : 11 修改第一步

* feat: table test : 12 修改第二步

* feat: table test : 13 修改了HtmlTable2Md

* feat: table test : 14 修改表头分块规则

* feat: table test : 15 前面表格分的太细了

* feat: table test : 16 改着改着表头又不加了

* feat: table test : 17 用CUSTOM_SPLIT_SIGN不行,重新改

* feat: table test : 18 表头仍然还会多加,但现在分块搞的合理了终于

* feat: table test : 19 还是需要搞好表头问题,先保存一下调试情况

* feat: table test : 20 调试结束,看一下replace有没有问题,没问题就pr

* feat: table test : 21 先把注释删了

* feat: table test : 21 注释replace都改了,下面切main分支看看情况

* feat: table test : 22 修改旧文件

* feat: table test : 23 修改测试文件

* feat: table test : 24 xlsx表格处理

* feat: table test : 25 刚才没保存先com了

* feat: table test : 26 fix

* feat: table test : 27 先com一版调试

* feat: table test : 28 试试放format2csv里

* feat: table test : 29 xlsx解决

* feat: table test : 30 tablesplit解决

* feat: table test : 31

* feat: table test : 32
* fix: system-tool secret inputs

* fix: rewrite runtime node i18n for system tool

* perf: mcp old version compatibility

* fix: splitPluginId

* fix: old mcp toolId

* fix: filter secret key

* feat: support system toolset activation

* chore: remove log
Copy link

github-actions bot commented Aug 1, 2025

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 22.15% 12431 / 56119
🔵 Statements 22.15% 12431 / 56119
🔵 Functions 30.13% 349 / 1158
🔵 Branches 68.14% 922 / 1353
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/global/common/string/markdown.ts 4.86% 100% 0% 4.86% 7-38, 41-116, 124-158, 161-173, 176-198
packages/global/common/string/textSplitter.ts 89.25% 86.72% 100% 89.25% 39-40, 59-60, 73-74, 198-205, 220-221, 273-275, 281, 302-311, 355-357, 462-463, 479-480
packages/global/common/string/time.ts 21.62% 100% 0% 21.62% 11, 13, 15, 17, 24-50, 53-74, 78-84, 87-106
packages/global/core/app/jsonschema.ts 100% 88.88% 100% 100%
packages/global/core/app/logs/constants.ts 0% 0% 0% 0% 1-49
packages/global/core/app/mcpTools/utils.ts 13.43% 100% 0% 13.43% 20-52, 55-88
packages/global/core/app/plugin/constants.ts 100% 100% 100% 100%
packages/global/core/app/plugin/utils.ts 11.11% 100% 0% 11.11% 7-8, 10-25, 36-64
packages/global/core/workflow/constants.ts 100% 100% 100% 100%
packages/global/core/workflow/utils.ts 8.88% 100% 0% 8.88% 57-62, 65-69, 73-78, 80-129, 133-175, 178-188, 196-197, 200-237, 240-312, 315-322, 325-334, 337-343, 347-348, 355-362, 370-376, 379-380, 384-415, 419-438
packages/global/core/workflow/runtime/utils.ts 22.94% 86.66% 13.33% 22.94% 24-33, 35-49, 140-143, 148-149, 158-195, 198-209, 212-235, 238-260, 263-268, 275-363, 371-418, 421-442, 445-488, 491-521, 525-547
packages/service/core/ai/config/utils.ts 0% 100% 100% 0% 2-245
packages/service/core/app/controller.ts 0% 100% 100% 0% 2-223
packages/service/core/app/mcp.ts 6.71% 0% 0% 6.71% 13-134, 137-166
packages/service/core/app/utils.ts 0% 0% 0% 0% 1-203
packages/service/core/app/logs/logkeysSchema.ts 0% 100% 100% 0% 2-32
packages/service/core/app/plugin/controller.ts 5.09% 100% 0% 5.09% 59-479, 482-519, 522-523, 526-533, 536-599, 602-615
packages/service/core/app/plugin/utils.ts 17.64% 100% 0% 17.64% 15-36
packages/service/core/app/tool/api.ts 32% 100% 0% 32% 5-23
packages/service/core/workflow/dispatch/index.ts 12.03% 100% 0% 12.03% 137-845, 849-884, 888-912
packages/service/core/workflow/dispatch/utils.ts 13.27% 80% 11.11% 13.27% 28-76, 79-90, 107-115, 119-136, 138-146, 149-157, 166-253, 256-280
packages/service/core/workflow/dispatch/ai/agent/index.ts 7.03% 100% 0% 7.03% 43-308, 311-362, 369-411
packages/service/core/workflow/dispatch/child/runTool.ts 8.04% 100% 0% 8.04% 44-249
packages/service/core/workflow/dispatch/plugin/run.ts 10.95% 100% 0% 10.95% 42-190
packages/service/support/permission/teamLimit.ts 36.89% 16.66% 33.33% 36.89% 13-25, 28-41, 55-56, 60-68, 72-91, 104-105, 109-115, 119-126
packages/service/support/permission/app/auth.ts 82.35% 88% 66.66% 82.35% 19-37, 58-59, 69-70, 146-147
packages/service/thirdProvider/doc2x/index.ts 4.3% 100% 0% 4.3% 18-234
packages/service/thirdProvider/fastgptPlugin/index.ts 100% 100% 100% 100%
packages/service/worker/readFile/extension/xlsx.ts 0% 0% 0% 0% 1-44
packages/service/worker/text2Chunks/index.ts 0% 0% 0% 0% 1-15
packages/web/components/common/Icon/constants.ts 0% 100% 100% 0% 3-492
packages/web/hooks/useSafeTranslation.ts 0% 0% 0% 0% 1-23
projects/app/src/pages/api/core/ai/model/delete.ts 0% 100% 100% 0% 2-41
projects/app/src/pages/api/core/ai/model/updateDefault.ts 0% 100% 100% 0% 2-101
projects/app/src/pages/api/core/app/del.ts 0% 100% 100% 0% 2-49
projects/app/src/pages/api/core/app/detail.ts 0% 100% 100% 0% 2-43
projects/app/src/pages/api/core/app/exportChatLogs.ts 0% 100% 100% 0% 2-293
projects/app/src/pages/api/core/app/getChatLogs.ts 0% 100% 100% 0% 2-264
projects/app/src/pages/api/core/app/logs/getLogKeys.ts 0% 100% 100% 0% 2-36
projects/app/src/pages/api/core/app/logs/updateLogKeys.ts 0% 100% 100% 0% 2-34
projects/app/src/pages/api/core/app/mcpTools/create.ts 0% 100% 100% 0% 2-79
projects/app/src/pages/api/core/app/mcpTools/getChildren.ts 0% 100% 100% 0% 2-33
projects/app/src/pages/api/core/app/mcpTools/update.ts 0% 100% 100% 0% 2-68
projects/app/src/pages/api/core/app/plugin/getPreviewNode.ts 0% 100% 100% 0% 4-31
projects/app/src/pages/api/core/app/plugin/getSystemPluginTemplates.ts 0% 100% 100% 0% 2-50
projects/app/src/pages/api/core/app/plugin/getVersionList.ts 0% 100% 100% 0% 2-103
projects/app/src/pages/api/core/app/plugin/path.ts 0% 100% 100% 0% 2-39
projects/app/src/pages/api/support/mcp/client/getTools.ts 0% 0% 0% 0% 1-31
projects/app/src/pages/api/support/mcp/client/runTool.ts 0% 0% 0% 0% 1-33
projects/app/src/pages/api/support/user/team/plan/getTeamPlanStatus.ts 0% 100% 100% 0% 2-56
projects/app/src/service/common/system/cron.ts 0% 0% 0% 0% 1-93
projects/app/src/web/core/app/api.ts 0% 0% 0% 0% 1-48
projects/app/src/web/core/app/api/log.ts 0% 100% 100% 0% 3-15
projects/app/src/web/core/app/api/plugin.ts 0% 0% 0% 0% 1-129
projects/app/src/web/core/workflow/utils.ts 37.95% 67.39% 33.33% 37.95% 88, 127-132, 172-192, 196-206, 210-223, 227-263, 334-381, 401-402, 411-412, 415-435, 437-447, 458-523, 530-545, 549-661, 666-716
Generated in workflow #1654 for commit 8733c2f by the Vitest Coverage Report Action

@c121914yu c121914yu merged commit e25d7ef into main Aug 1, 2025
10 checks passed
Copy link
Contributor

gru-agent bot commented Aug 1, 2025

⏳ Processing in progress

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants