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: [],
}
}