Expected thinking or redacted_thinking but found tool_use #4919

Open
opened 2026-02-16 17:46:33 -05:00 by yindo · 0 comments
Owner

Originally created by @jbosire-pm on GitHub (Jan 12, 2026).

Originally assigned to: @thdxr on GitHub.

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

Originally created by @jbosire-pm on GitHub (Jan 12, 2026). Originally assigned to: @thdxr on GitHub. ### 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
yindo added the bug label 2026-02-16 17:46:33 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#4919