[BUG] API Error 400: Invalid 'text' content - Expected 'thinking' block

Resolved 💬 14 comments Opened May 19, 2025 by backnotprop Closed May 21, 2025

This happens _sometimes_ on random prompts in TUI. Since the latest 0.2.120 update.

I say random because sometimes I have thinking trigger words in the prompts, sometimes I don't. In both cases I will get this error:

API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"me
    ssages.1.content.0.type: Expected `thinking` or `redacted_thinking`, but found
    `text`. 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).
     We recommend you include thinking blocks from previous turns. To avoid this
    requirement, disable `thinking`. Please consult our documentation at
    https://docs.anthropic.com/en/docs/build-with-claude/extended-thinking"}}

Usually I can just resend the prompt and it works. Thinking still works in this case as well.

Same issue as AI slop bugs: #1174 #1167

View original on GitHub ↗

This issue has 14 comments on GitHub. Read the full discussion on GitHub ↗