Closed
Description
Description
It seems like when using Claude Sonnet 4 with the beta header:
const anthropic = createAnthropic({
headers: {
'anthropic-beta': 'interleaved-thinking-2025-05-14'
}
});
Causes the following issue when you send a follow up message after a message which contains a tool call and the "interleaved-thinking" thinking/reasoning blocks:
7: `tool_use` ids were found without `tool_result` blocks immediately after: toolu_018YfQDEboEehRZvnmFZUrTU. Each `tool_use` block must have a corresponding `tool_result` block in

The is a beta header of course, so I am not sure if this is a AI SDK or Claude error. But it seems like Claude is expecting a certain format which gets disrupted by the interleaved reasoning blocks.
AI SDK Version
"ai": "^4.3.16",
"@ai-sdk/anthropic": "^1.2.12"