Skip to content

Header: 'anthropic-beta': 'interleaved-thinking-2025-05-14' Causes error "...tool_use ids were found without tool_result blocks immediately after: ..." #6472

Closed
@Thimows

Description

@Thimows

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
Image

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"

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions