fix: trim whitespace from tool names to prevent invalid tool calls
Some models (e.g. kimi-k2.5) return tool names with leading spaces like ' delegate_task', causing tool matching to fail. Add .trim() in transformToolName() and defensive trim in claude-code-hooks. Fixes #1568
This commit is contained in:
@@ -175,7 +175,7 @@ export function createClaudeCodeHooksHook(
|
||||
input: { tool: string; sessionID: string; callID: string },
|
||||
output: { args: Record<string, unknown> }
|
||||
): Promise<void> => {
|
||||
if (input.tool === "todowrite" && typeof output.args.todos === "string") {
|
||||
if (input.tool.trim() === "todowrite" && typeof output.args.todos === "string") {
|
||||
let parsed: unknown
|
||||
try {
|
||||
parsed = JSON.parse(output.args.todos)
|
||||
|
||||
Reference in New Issue
Block a user