Skip to content

Expected thinking or redacted_thinking but found tool_use #8010

@jbosire-pm

Description

@jbosire-pm

Description

When using Claude models with extended thinking enabled, the API returns a 400 validation error when the model attempts to use tools without a preceding thinking block.

Error Message

400: An error occurred (ValidationException) when calling the ConverseStream operation: 
The model returned the following errors: messages.1.content.0.type: Expected `thinking` or 
`redacted_thinking`, but found `tool_use`. When `thinking` is enabled, a final `assistant` 
message must start with a thinking block (preceeding the lastmost set of `tool_use` and 
`tool_result` blocks).

This wasn't an issue last week so I assume something changed.

Plugins

None

OpenCode version

1.1.14

Steps to reproduce

  1. in an uninitialized project type /init

Screenshot and/or share link

https://opncd.ai/share/lCqFg19t

Operating System

macOS Sequoia 15.7.3

Terminal

Iterm2

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions