fix: mcp toolcall (#6683)

* fix: mcp toolcall

* perf: test sign
This commit is contained in:
Archer
2026-03-31 17:02:56 +08:00
committed by GitHub
parent 736667fbd1
commit 7f2dd9d24a
12 changed files with 22 additions and 25 deletions
@@ -27,4 +27,5 @@ description: 'FastGPT V4.14.10 更新说明'
1. 子工作流的全局变量默认值未生效。
2. agent 模式下已配的 rerank 模型不显示。
3. bge-m3 embedding 向量模型输出都为 0 的问题。
3. bge-m3 embedding 向量模型输出都为 0 的问题。
4. MCP 并发调用时,连接异常导致调用失败。
+1 -1
View File
@@ -220,7 +220,7 @@
"document/content/docs/self-host/upgrading/4-14/4140.mdx": "2026-03-03T17:39:47+08:00",
"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.mdx": "2026-03-30T10:05:42+08:00",
"document/content/docs/self-host/upgrading/4-14/41410.mdx": "2026-03-30T22:11:30+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",
+4 -4
View File
@@ -45,7 +45,10 @@ const BaseModelItemSchema = z.object({
// If has requestUrl, it will request the model directly
requestUrl: z.string().optional(),
requestAuth: z.string().optional()
requestAuth: z.string().optional(),
// Test mode: when enabled, classify/extract/tool call/evaluation scenarios are disabled
testMode: z.boolean().optional() // test mode flag
});
type BaseModelItemType = z.infer<typeof BaseModelItemSchema>;
@@ -65,9 +68,6 @@ export const LLMModelItemSchema = PriceTypeSchema.extend(BaseModelItemSchema.sha
vision: z.boolean().optional(),
reasoning: z.boolean().optional(),
// Test mode: when enabled, classify/extract/tool call/evaluation scenarios are disabled
testMode: z.boolean().optional(), // test mode flag
functionCall: z.boolean(),
toolChoice: z.boolean(),
+1 -1
View File
@@ -60,7 +60,7 @@ export class MCPClient {
await this.client.connect(transport);
return this.client;
} catch (error) {
logger.debug('StreamableHTTP connect failed, falling back to SSE', { url: this.url, error });
await this.client.close().catch(() => {});
await this.client.connect(
new SSEClientTransport(new URL(this.url), {
requestInit: {
+1 -1
View File
@@ -95,7 +95,7 @@
"model.show_stop_sign": "Display stop sequence parameters",
"model.show_top_p": "Show Top-p parameters",
"model.test_mode": "Mark as test model",
"model.test_mode_tip": "After being turned on, the model is only used for AI dialogue and is not used for other model processing scenarios such as knowledge base file processing, text extraction, application evaluation, problem classification, tool calling nodes, etc.",
"model.test_mode_tip": "When enabled, the model will have a Beta logo added when selected.",
"model.test_model": "Model testing",
"model.tool_choice": "Tool choice",
"model.tool_choice_tag": "ToolCall",
+1 -1
View File
@@ -95,7 +95,7 @@
"model.show_stop_sign": "展示停止序列参数",
"model.show_top_p": "展示 Top-p 参数",
"model.test_mode": "标记为测试模型",
"model.test_mode_tip": "开启后,该模型仅用于 AI 对话,不用于知识库文件处理、文本提取、应用评测、问题分类、工具调用节点等其他模型处理场景。",
"model.test_mode_tip": "开启后,该模型在选择时候,将会增加 Beta 标志。",
"model.test_model": "模型测试",
"model.tool_choice": "支持工具调用",
"model.tool_choice_tag": "工具调用",
+1 -1
View File
@@ -95,7 +95,7 @@
"model.show_stop_sign": "展示停止序列參數",
"model.show_top_p": "展示 Top-p 參數",
"model.test_mode": "標記為測試模型",
"model.test_mode_tip": "開啟後,模型僅用於 AI 對話,不用於知識庫文件處理、文字擷取、應用評測、問題分類、工具呼叫節點等其他模型處理場景。",
"model.test_mode_tip": "開啟後,模型在選擇時候,將會增加 Beta 標誌。",
"model.test_model": "模型測試",
"model.tool_choice": "支援工具呼叫",
"model.tool_choice_tag": "工具呼叫",
@@ -19,7 +19,7 @@ type Props = SelectProps & {
};
const isTestModeModel = (model?: SystemModelItemType) => {
return !!(model && 'testMode' in model && model.testMode);
return !!model?.testMode;
};
const SelectorActiveTestModeTip = React.memo(function SelectorActiveTestModeTip() {
@@ -154,7 +154,7 @@ const ModelTable = ({ permissionConfig = false }: { permissionConfig?: boolean }
return {
model: item.model,
name: item.name,
testMode: 'testMode' in item ? item.testMode : undefined,
testMode: item.testMode,
avatar: provider.avatar,
providerId: provider.id,
providerName: provider.name,
@@ -1150,14 +1150,12 @@ export const ModelEditModal = ({
)}
{isTTSModel && <VoicesField control={control} setValue={setValue} t={t} />}
{CustomApi}
{isLLMModel && (
<SwitchField
label={t('account:model.test_mode')}
tip={t('account:model.test_mode_tip')}
field={'testMode'}
register={register}
/>
)}
<SwitchField
label={t('account:model.test_mode')}
tip={t('account:model.test_mode_tip')}
field={'testMode'}
register={register}
/>
</Grid>
</Section>
</ModalBody>
@@ -394,7 +394,7 @@ const ModelTable = ({ Tab }: { Tab: React.ReactNode }) => {
>
{showModelId ? item.model : item.name}
</CopyBox>
{Boolean('testMode' in item && item.testMode) && <TestModeBetaTag />}
{item.testMode && <TestModeBetaTag />}
</Flex>
</HStack>
<HStack mt={2}>
@@ -48,15 +48,13 @@ async function handler(
priceTiers: model.priceTiers,
isActive: model.isActive ?? false,
isCustom: model.isCustom ?? false,
testMode: model?.testMode,
// Tag
contextToken:
'maxContext' in model ? model.maxContext : 'maxToken' in model ? model.maxToken : undefined,
vision: 'vision' in model ? model.vision : undefined,
toolChoice: 'toolChoice' in model ? model.toolChoice : undefined,
// LLM Model
testMode: 'testMode' in model ? model.testMode : undefined
toolChoice: 'toolChoice' in model ? model.toolChoice : undefined
}));
}