refactor: remove graph tools references and related logic from AIAgent and workflows

This commit is contained in:
mlogclub
2026-06-26 18:56:09 +08:00
parent 015b57bfe7
commit d4ff0980c4
14 changed files with 48 additions and 199 deletions
@@ -4,6 +4,8 @@ import { readFile } from "node:fs/promises"
const configWorkbenchSource = await readFile(new URL("./config-workbench.tsx", import.meta.url), "utf8")
const zhMessagesSource = await readFile(new URL("../../../../messages/zh-CN.json", import.meta.url), "utf8")
const adminApiSource = await readFile(new URL("../../../../lib/api/admin.ts", import.meta.url), "utf8")
const zhMessages = JSON.parse(zhMessagesSource)
test("AI Agent workflow-era policy copy separates handoff execution from knowledge fallback", () => {
const combinedSource = `${configWorkbenchSource}\n${zhMessagesSource}`
@@ -19,3 +21,13 @@ test("AI Agent workflow-era policy copy separates handoff execution from knowled
assert.doesNotMatch(configWorkbenchSource, /兜底策略/)
assert.doesNotMatch(configWorkbenchSource, /兜底文案/)
})
test("AI Agent config no longer exposes legacy graph tool routing knobs", () => {
const aiAgentMessages = JSON.stringify(zhMessages.aiAgent ?? {})
assert.doesNotMatch(configWorkbenchSource, /graphTools/)
assert.doesNotMatch(adminApiSource, /graphTools/)
assert.doesNotMatch(aiAgentMessages, /graphTools/)
assert.doesNotMatch(aiAgentMessages, /Graph Tool/)
assert.doesNotMatch(aiAgentMessages, /内置流程/)
})
@@ -396,7 +396,6 @@ export function AIAgentConfigWorkbench({
knowledgeIds: uniqueNumbers(selectedKnowledgeIds),
skillIds: uniqueNumbers(selectedSkillIds),
directTools,
graphTools: [],
}
}
-2
View File
@@ -239,7 +239,6 @@ export type AIAgent = {
description: string
arguments?: Record<string, string>
}[]
graphTools: string[]
workflowVersionId: number
workflowPublished: boolean
workflowState: string
@@ -273,7 +272,6 @@ export type CreateAIAgentPayload = {
description: string
arguments?: Record<string, string>
}[]
graphTools: string[]
}
export type UpdateAIAgentPayload = CreateAIAgentPayload & {
+1 -8
View File
@@ -1090,7 +1090,6 @@
"knowledgeTab": "Knowledge",
"skillsTab": "Skills",
"directToolsTab": "MCP tools",
"graphToolsTab": "Graph Tools",
"knowledgeHint": "Select at least one knowledge base. You can adjust priority order.",
"selectKnowledge": "Select and add knowledge base",
"searchKnowledge": "Search knowledge bases",
@@ -1117,13 +1116,7 @@
"searchDirectTool": "Search Direct Tools",
"emptyDirectTool": "No Direct Tools available",
"noDirectToolsHint": "Without Direct Tools, the agent will not call external or built-in tools directly. It will rely on knowledge bases, skills, and normal replies.",
"removeDirectTool": "Remove Direct Tool {name}",
"graphToolsHint": "Use for built-in workflows such as ticket creation and human handoff. These are kept separate from Direct Tools.",
"selectGraphTool": "Select Graph Tool",
"searchGraphTool": "Search Graph Tools",
"emptyGraphTool": "No Graph Tools available",
"noGraphToolsHint": "Without Graph Tools, the agent will not expose built-in workflow tools such as ticket creation or human handoff.",
"removeGraphTool": "Remove Graph Tool {name}"
"removeDirectTool": "Remove Direct Tool {name}"
},
"aiConfig": {
"allStatuses": "All statuses",
+1 -8
View File
@@ -1090,7 +1090,6 @@
"knowledgeTab": "知识库",
"skillsTab": "Skills",
"directToolsTab": "MCP tools",
"graphToolsTab": "内置流程",
"knowledgeHint": "至少选择一个知识库,可调整知识库优先级。",
"selectKnowledge": "选择并添加知识库",
"searchKnowledge": "搜索知识库",
@@ -1117,13 +1116,7 @@
"searchDirectTool": "搜索 Direct Tool",
"emptyDirectTool": "没有可添加的 Direct Tool",
"noDirectToolsHint": "不配置 Direct Tool 时,Agent 不会直接调用外部或内置工具,只会依赖知识库、Skill 和普通回复。",
"removeDirectTool": "移除 Direct Tool {name}",
"graphToolsHint": "用于建单、转人工等系统内置流程,不再混放到 Direct Tools 中。",
"selectGraphTool": "选择 Graph Tool",
"searchGraphTool": "搜索 Graph Tool",
"emptyGraphTool": "没有可添加的 Graph Tool",
"noGraphToolsHint": "不配置 Graph Tool 时,Agent 不会暴露建单/转人工等内置流程工具。",
"removeGraphTool": "移除 Graph Tool {name}"
"removeDirectTool": "移除 Direct Tool {name}"
},
"aiConfig": {
"allStatuses": "全部状态",