优化agent执行命令时tool call的标题显示
This commit is contained in:
@@ -265,9 +265,8 @@ function buildCommandTerminalOutput(
|
|||||||
return isStreaming ? withTrailingNewline(prompt) : prompt
|
return isStreaming ? withTrailingNewline(prompt) : prompt
|
||||||
}
|
}
|
||||||
|
|
||||||
const firstNonEmptyLine = terminalOutput
|
const lines = terminalOutput.split("\n")
|
||||||
.split("\n")
|
const firstNonEmptyLine = lines.find((line) => line.trim().length > 0)
|
||||||
.find((line) => line.trim().length > 0)
|
|
||||||
const commandFirstLine = command.split("\n")[0]?.trim() ?? ""
|
const commandFirstLine = command.split("\n")[0]?.trim() ?? ""
|
||||||
|
|
||||||
if (firstNonEmptyLine) {
|
if (firstNonEmptyLine) {
|
||||||
@@ -925,6 +924,10 @@ function deriveToolTitle(
|
|||||||
|
|
||||||
// Command tools
|
// Command tools
|
||||||
if (name === "bash" || name === "exec_command") {
|
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 direct = getField("command") ?? getField("cmd") ?? getField("script")
|
||||||
const parsedCommand = commandFromUnknownValue(parsed)
|
const parsedCommand = commandFromUnknownValue(parsed)
|
||||||
const fallback = extractCommandFromUnknownInput(titleSource)
|
const fallback = extractCommandFromUnknownInput(titleSource)
|
||||||
|
|||||||
Reference in New Issue
Block a user