Skip to content

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

@backnotprop

Description

@backnotprop

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

Metadata

Metadata

Assignees

No one assigned

    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