mirror of
https://github.com/multica-ai/multica.git
synced 2026-08-02 01:45:52 +02:00
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:
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user