mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-07 08:26:51 +00:00
fix: handle array-format ToolResultBlockParam.content in PostToolUse hook
This commit is contained in:
parent
d8b53b814a
commit
055a1dff0c
1 changed files with 12 additions and 1 deletions
|
|
@ -957,7 +957,18 @@ export async function presentAssistantMessage(cline: Task) {
|
|||
b.type === "tool_result",
|
||||
)
|
||||
.pop()
|
||||
const resultText = typeof lastResult?.content === "string" ? lastResult.content : ""
|
||||
const resultText =
|
||||
typeof lastResult?.content === "string"
|
||||
? lastResult.content
|
||||
: Array.isArray(lastResult?.content)
|
||||
? lastResult.content
|
||||
.filter(
|
||||
(b): b is import("@anthropic-ai/sdk").Anthropic.TextBlockParam =>
|
||||
b.type === "text",
|
||||
)
|
||||
.map((b) => b.text)
|
||||
.join("\n")
|
||||
: ""
|
||||
const hookContext: HookContext = {
|
||||
event: "PostToolUse",
|
||||
toolName: block.name,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue