From b92a26cdd4dd55e781382b702ed32e00c9c42f7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=91=A3=E5=AE=8F=E5=87=AF?= Date: Sun, 30 Aug 2026 20:02:21 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BC=9A=E5=95=86=E7=AC=AC=E4=BA=8C?= =?UTF-8?q?=E6=AD=A5=E5=8F=AA=E5=AF=B9=E5=8F=AF=E9=A2=84=E8=A7=88=E6=88=90?= =?UTF-8?q?=E5=93=81=E5=87=BA=E6=96=87=E4=BB=B6=E5=8D=A1/=E5=BC=80?= =?UTF-8?q?=E6=B2=99=E7=AE=B1=EF=BC=8C=E5=8E=BB=E6=8E=89=E5=B9=B2=E9=A2=84?= =?UTF-8?q?=E5=B9=B6=E5=8F=91=E9=80=81=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/MessageStepsCard.tsx | 17 +++++++---- .../components/Step2Panel.tsx | 28 +++++++++---------- .../hooks/useStep2Orchestration.ts | 25 +++++++++++------ 3 files changed, 41 insertions(+), 29 deletions(-) diff --git a/frontend-web/src/roundtable-planning/components/MessageStepsCard.tsx b/frontend-web/src/roundtable-planning/components/MessageStepsCard.tsx index 73463705..95a281a9 100644 --- a/frontend-web/src/roundtable-planning/components/MessageStepsCard.tsx +++ b/frontend-web/src/roundtable-planning/components/MessageStepsCard.tsx @@ -22,6 +22,7 @@ import { ChainOfThoughtStep, } from "@/components/ai-elements/chain-of-thought"; import { Button } from "@/components/ui/button"; +import { languageOfStreamingArtifact } from "@/core/artifacts/streaming-write-preview"; import { cn } from "@/lib/utils"; import { getStepDisplay, @@ -177,13 +178,17 @@ function ToolStep({ const display = getStepDisplay(step.key, step.label, step.args); const argNode = renderStepArgs(step.key, step.args, resolveAgentName); const [, toolName] = step.key.split(":"); - // 只让「自己生成/展示的文件」可点(write_file / str_replace / present_files), - // 与主聊天页一致。read_file 不可点 —— 否则智能体调用技能时读取的 SOUL.md、 - // 执行的 .py 脚本等也会被渲染成可点击文件名,点开却没有意义。 + // 只让「自己生成/展示的文件」可点,与主聊天页一致。read_file 不可点 —— 否则智能体 + // 调用技能时读取的 SOUL.md、执行的 .py 脚本等也会被渲染成可点击文件名,点开却没有意义。 + // write_file / str_replace 还要过与文件卡同一道门槛(`languageOfStreamingArtifact`, + // 只认 .md/.html/.mermaid 等可预览成品):席位写的过程文件(fetch.py / r1.txt)与 + // 畸形路径(mnt/user-data/outputs)只作步骤展示、点了也不会打开沙箱。 + // present_files 由后端校验"outputs 下真实存在",保持可点。 + const stepPath = typeof step.args?.path === "string" ? step.args.path : ""; const isArtifactStep = - toolName === "write_file" || - toolName === "str_replace" || - toolName === "present_files"; + toolName === "present_files" || + ((toolName === "write_file" || toolName === "str_replace") && + !!languageOfStreamingArtifact(stepPath)); return ( )} -