From 644d06c4874ef851a01ac2c3733d35139fbf5903 Mon Sep 17 00:00:00 2001 From: Robin Newhouse Date: Wed, 10 Dec 2025 11:56:49 -0800 Subject: [PATCH] Fix tool use argument handling in Claude Code provider (#8023) The Claude Code CLI returns tool arguments as complete objects, but the StreamResponseHandler expects string chunks for streaming. This caused tool calls to fail with "missing parameter" errors because the object was being concatenated with a string, resulting in "[object Object]". This change stringifies the tool arguments in the Claude Code provider before yielding them, ensuring they are correctly parsed by the StreamResponseHandler. --- .changeset/polite-mammals-cut.md | 5 +++++ src/core/api/providers/claude-code.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/polite-mammals-cut.md diff --git a/.changeset/polite-mammals-cut.md b/.changeset/polite-mammals-cut.md new file mode 100644 index 00000000..bfc5e190 --- /dev/null +++ b/.changeset/polite-mammals-cut.md @@ -0,0 +1,5 @@ +--- +"claude-dev": patch +--- + +Fix tool use argument handling in Claude Code provider to correctly stringify object arguments for the stream handler. diff --git a/src/core/api/providers/claude-code.ts b/src/core/api/providers/claude-code.ts index 13fca9c6..8e8a8731 100644 --- a/src/core/api/providers/claude-code.ts +++ b/src/core/api/providers/claude-code.ts @@ -121,7 +121,7 @@ export class ClaudeCodeHandler implements ApiHandler { function: { id: content.id, name: content.name, - arguments: content.input, + arguments: JSON.stringify(content.input), }, }, }