[BUG] Thinking-mode desync on fresh session causes "Expected `thinking` or `redacted_thinking`, but found `text`" on first prompt

Open 💬 0 comments Opened Jun 16, 2026 by Ashwin0636

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?

On a brand new session in the Claude Code VS Code extension, the very first prompt fails with:

API Error: 400 messages.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.

Running /clear does NOT resolve it — the same error recurs on the next prompt in the cleared session.

However, switching models via the model picker — even switching to the SAME model I was already on (e.g. Sonnet 4.5 → Sonnet 4.5) — immediately fixes it, and the session works normally afterward.

This points to a desync between the thinking-mode UI state and the actual runtime config sent to the API at session start, which switching models forces to re-sync.

What Should Happen?

A new session should start with thinking-mode state consistent with what's actually sent to the API, so the first prompt doesn't fail. /clear should also fully reset this state if a session gets into a bad state.

Error Messages/Logs

API Error: 400 messages.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.claude.com/en/docs/build-with-claude/extended-thinking

Steps to Reproduce

  1. Open a project folder in VS Code with the Claude Code extension installed.
  2. Start a new Claude Code session (or run /clear on an existing one).
  3. Send any prompt as the first message (e.g. "explain the code in this folder").
  4. Observe the 400 error above.
  5. Open the model picker and switch to a different model, then switch back to the original model (e.g. Sonnet 4.5 → Opus → Sonnet 4.5, or even Sonnet 4.5 → Sonnet 4.5 directly).
  6. Resend the same prompt — it now succeeds.
  7. Start another brand new session and repeat from step 3 — the error reproduces again, requiring the same model-switch workaround.

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

v2.1.178

Platform

AWS Bedrock

Operating System

Windows

Terminal/Shell

VS Code integrated terminal

Additional Information

_No response_

View original on GitHub ↗