From 6d86564911ecc67389bd4e799203afe990bf1bbe Mon Sep 17 00:00:00 2001 From: xintaofei Date: Mon, 9 Mar 2026 19:53:40 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96agent=E6=89=A7=E8=A1=8C?= =?UTF-8?q?=E5=91=BD=E4=BB=A4=E6=97=B6tool=20call=E7=9A=84=E6=A0=87?= =?UTF-8?q?=E9=A2=98=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/message/content-parts-renderer.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/components/message/content-parts-renderer.tsx b/src/components/message/content-parts-renderer.tsx index 5b1a465..6596f54 100644 --- a/src/components/message/content-parts-renderer.tsx +++ b/src/components/message/content-parts-renderer.tsx @@ -265,9 +265,8 @@ function buildCommandTerminalOutput( return isStreaming ? withTrailingNewline(prompt) : prompt } - const firstNonEmptyLine = terminalOutput - .split("\n") - .find((line) => line.trim().length > 0) + const lines = terminalOutput.split("\n") + const firstNonEmptyLine = lines.find((line) => line.trim().length > 0) const commandFirstLine = command.split("\n")[0]?.trim() ?? "" if (firstNonEmptyLine) { @@ -925,6 +924,10 @@ function deriveToolTitle( // Command tools if (name === "bash" || name === "exec_command") { + const description = getField("description") + if (description) { + return ellipsis(description, 80) + } const direct = getField("command") ?? getField("cmd") ?? getField("script") const parsedCommand = commandFromUnknownValue(parsed) const fallback = extractCommandFromUnknownInput(titleSource)