From 65a2ed7d498103056e6c74419df59a000b2679c7 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 30 Sep 2026 19:28:51 +0800 Subject: [PATCH] =?UTF-8?q?fix(web):=20=E4=BC=9A=E8=AF=9D=E6=AD=A5?= =?UTF-8?q?=E9=AA=A4=E6=98=8E=E7=BB=86=E9=87=8C=E7=9A=84=E8=83=BD=E5=8A=9B?= =?UTF-8?q?=20ID=20=E6=8D=A2=E6=88=90=E8=83=BD=E5=8A=9B=E6=A0=87=E9=A2=98,?= =?UTF-8?q?=E4=B8=8E=E6=9C=80=E7=BB=88=E6=B1=87=E6=8A=A5=E4=B8=80=E8=87=B4?= =?UTF-8?q?(FIX-9)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 --- .../components/agent/agent-conversation.tsx | 6 ++++-- apps/web/app/components/agent/agui3.test.ts | 21 +++++++++++++++++++ 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/apps/web/app/components/agent/agent-conversation.tsx b/apps/web/app/components/agent/agent-conversation.tsx index 68218be0..2f9d6512 100644 --- a/apps/web/app/components/agent/agent-conversation.tsx +++ b/apps/web/app/components/agent/agent-conversation.tsx @@ -196,7 +196,9 @@ function ToolRow({ call, audit }: { call: ToolCallView; audit?: InvocationAudit const [open, setOpen] = useState(false); const meta = capabilityMeta(call.capabilityId); const denied = isDenied(call); - const summary = denied ? deniedReason(call).text : toolSummary(call); + const raw = denied ? deniedReason(call).text : toolSummary(call); + // 旧会话的错误文字里带能力 ID / 原因码:和最终汇报一样换成能力标题与人话 + const summary = raw ? humanizeReport(raw).text : raw; return (
  • ), )} diff --git a/apps/web/app/components/agent/agui3.test.ts b/apps/web/app/components/agent/agui3.test.ts index df5e6380..18bac1ba 100644 --- a/apps/web/app/components/agent/agui3.test.ts +++ b/apps/web/app/components/agent/agui3.test.ts @@ -571,3 +571,24 @@ describe("进度行时长(FIX-9):从这一轮开始算到结论正文", () => { expect(t).toMatch(/· 7 秒/); }); }); + +describe("步骤明细(FIX-9):能力 ID 换成能力标题", () => { + it("失败原因与工具之间的话里的能力 ID 走能力标题", () => { + const activity: ActivityItem[] = [ + { kind: "note", key: "n1", text: "site.health_check 被拒,改用 site.list。", at: AT }, + { + kind: "tool", + key: "c1", + call: call({ + capabilityId: "download.inspect", + status: "failed", + outputSummary: '{"error":{"code":"x","message":"site.health_check 调用失败"}}', + }), + }, + ]; + const t = text(render(createElement(StepSummary, { activity, running: false }))); + expect(t).not.toContain("site.health_check"); + expect(t).not.toContain("site.list"); + expect(t).toContain("检测站点 被拒"); + }); +});