[BUG] "invalid_request_error","message":"messages.213.content.0.type: Expected `thinking` or `redacted_thinking`, but found `text`.
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Fedora 43, GNU bash, version 5.3.0(1)-release (x86_64-redhat-linux-gnu), Claude Code v2.0.35 , thinking off.
This bug happened twice in my conversation, both times, if i wrote, again, /context, it worked.
/context
⎿ Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.213.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. We recommend you include thinking blocks from previous turns. To avoid this requirement, disable thinking.
Please consult our documentation at https://docs.claude.com/en/docs/build-with-claude/extended-thinking"},"request_id":"req_011CUtix6MfZSXhdhtac6uVp"}
What Should Happen?
/context
Context Usage
...
Error Messages/Logs
first time:
> /context
⎿ Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.109.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.claude.com/en/docs/build-with-claude/extended-thinking"},"request_id":"req_011CUtVPxfeUMqhHtFrYGsUS"}
second time:
> /context
⎿ Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.213.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. We recommend you include thinking blocks from previous turns. To avoid this requirement, disable `thinking`.
Please consult our documentation at https://docs.claude.com/en/docs/build-with-claude/extended-thinking"},"request_id":"req_011CUtix6MfZSXhdhtac6uVp"}
Steps to Reproduce
at the beginning of the session i was using thinking mode on. then i toggled it off.
the first time i used /context it gave me this error, i tried again right after and it worked.
after a few hours i used /context again and it gave me this error again, i tried again right after and it worked.
Claude Model
Sonnet (default)
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
v2.0.35
Platform
Anthropic API
Operating System
Other Linux
Terminal/Shell
Other
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗