#21832·ai

@ai-sdk/Anthropic: 跳过工具集工具调用仍会发送其 tool_result,导致 400 "未预期的工具使用 ID"

作者: rachel-pace创建于 2026年9月30日更新于 2026年9月30日
标签task-identify-issue-type-donetask-bug-reproduction-successfactory-activefactory-automatictask-identify-harness-labels-done

`convertToAnthropicPrompt` 在其输入中没有 `action` 字符串时会跳过助理工具集工具调用。它只会记录警告 `toolset 工具调用,工具 <name> 缺少 action`。下一个工具消息中的匹配的 `tool_result` 仍会发送,因此 Anthropic 拒绝请求: