feat: 完成第二版类型清理

This commit is contained in:
claude-code-best
2026-03-31 23:03:47 +08:00
parent 4c0a655a1c
commit d7a729ca68
604 changed files with 595 additions and 953 deletions

View File

@@ -31,9 +31,9 @@ export function getToolUseIDFromParentMessage(
parentMessage: AssistantMessage,
toolName: string,
): string | undefined {
const toolUseBlock = parentMessage.message.content.find(
const toolUseBlock = Array.isArray(parentMessage.message.content) ? parentMessage.message.content.find(
block => block.type === 'tool_use' && block.name === toolName,
)
) : undefined
return toolUseBlock && toolUseBlock.type === 'tool_use'
? toolUseBlock.id
: undefined