fix(core): check for "toolCall" type in hasToolUse() to match pi-ai types
The hasToolUse() function was checking for "tool_use" (raw Anthropic format) but pi-ai normalizes tool call blocks to type "toolCall". This made tool narration non-functional in the ChannelManager (Desktop/embedded) path. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
d1570698ac
commit
ef8b38899a
1 changed files with 1 additions and 1 deletions
|
|
@ -16,7 +16,7 @@ export function hasToolUse(message: AgentMessage | undefined): boolean {
|
|||
if (!message || typeof message !== "object" || !("content" in message)) return false;
|
||||
const content = (message as { content?: Array<{ type: string }> }).content;
|
||||
if (!Array.isArray(content)) return false;
|
||||
return content.some((c) => c.type === "tool_use");
|
||||
return content.some((c) => c.type === "toolCall" || c.type === "tool_use");
|
||||
}
|
||||
|
||||
/** Extract thinking/reasoning content from an AgentMessage */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue