You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: normalize mangled tool names and IDs from OpenAI-compatible providers
Some OpenAI-compatible providers (like Kimi via openai-completions) send tool
calls with IDs like "functions.exec:0" which get corrupted to "functions exec:0"
(space instead of dot), and tool names like "exec" become "functions exec".
This causes "Tool functions exec not found" errors because the tool result
cannot be matched to the original tool call.
Changes:
- Add normalizePrefixedToolName() to strip "functions." or "functions " prefixes
from tool names in session-transcript-repair.ts
- Add normalizeMangledToolCallId() to fix "functions " -> "functions." in tool
call IDs in tool-call-id.ts
- Update extractToolResultId() to normalize mangled IDs before matching
- Update sanitizeToolCallIdsForCloudCodeAssist() to use normalized IDs as map
keys, ensuring "functions.exec:0" and "functions exec:0" map to the same
sanitized value
- Add comprehensive tests for the normalization behavior
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
0 commit comments