Fix toolName reference in ClaudeCode message transformation

- Correctly reference toolName from contentBlockState using blockKey instead of block.tool_use_id
- Ensure proper tool result chunk generation when handling assistant messages
- Maintain consistent data structure for tool call processing
This commit is contained in:
suyao 2025-09-22 15:09:34 +08:00
parent e09cd6b6d7
commit 8fbb93b0bf
No known key found for this signature in database

View File

@ -118,7 +118,7 @@ function handleUserOrAssistantMessage(message: Extract<SDKMessage, { type: 'assi
chunks.push({
type: 'tool-result',
toolCallId: block.tool_use_id,
toolName: contentBlockState[block.tool_use_id].toolName,
toolName: contentBlockState[blockKey].toolName,
input: '',
output: block.content
})