claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[Bug] Anthropic API Error: Invalid thinking parameter in requests

Open Dimonka2 opened this issue 3 weeks ago • 2 comments

Bug Description I have an constant 400 errors related to "thinking" after Claude Code restart. Whatever I ask or enable/disable thinking - getting:

API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.43.content.7: thinking or redacted_thinking
blocks in the latest assistant message cannot be modified. These blocks must remain as they were in the original response."},"request_id":"req_011CW199azwZceA5p6ujPbTY"}

Environment Info

  • Platform: win32
  • Terminal: vscode
  • Version: 2.0.65
  • Feedback ID: b5bc0b69-6ad4-455c-b820-24f775adead4

Errors

[{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages.43.content.7: `thinking` or `redacted_thinking` blocks in the latest assistant message cannot be modified. These blocks must remain as they were in the original response.\"},\"request_id\":\"req_011CW199azwZceA5p6ujPbTY\"}\n    at B9.generate ({path_to_env}/bin/nodejs/node-v22.14.0-win-x64/node_modules/@anthropic-ai/claude-code/cli.js:122:10379)\n    at MR.makeStatusError ({path_to_env}/bin/nodejs/node-v22.14.0-win-x64/node_modules/@anthropic-ai/claude-code/cli.js:860:2195)\n    at MR.makeRequest ({path_to_env}/bin/nodejs/node-v22.14.0-win-x64/node_modules/@anthropic-ai/claude-code/cli.js:860:5419)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async dsA.model ({path_to_env}/bin/nodejs/node-v22.14.0-win-x64/node_modules/@anthropic-ai/claude-code/cli.js:4026:11283)\n    at async dsA ({path_to_env}/bin/nodejs/node-v22.14.0-win-x64/node_modules/@anthropic-ai/claude-code/cli.js:1009:34744)\n    at async mg2 ({path_to_env}/bin/nodejs/node-v22.14.0-win-x64/node_modules/@anthropic-ai/claude-code/cli.js:4026:11437)\n    at async {path_to_env}/bin/nodejs/node-v22.14.0-win-x64/node_modules/@anthropic-ai/claude-code/cli.js:4026:3864\n    at async An1 ({path_to_env}/bin/nodejs/node-v22.14.0-win-x64/node_modules/@anthropic-ai/claude-code/cli.js:1411:2037)\n    at async TZA ({path_to_env}/bin/nodejs/node-v22.14.0-win-x64/node_modules/@anthropic-ai/claude-code/cli.js:4026:3834)","timestamp":"2025-12-11T15:32:07.874Z"}]

Dimonka2 avatar Dec 11 '25 15:12 Dimonka2

One remark: this error appears when I restore my past session. In a new session there is no this error.

Dimonka2 avatar Dec 11 '25 15:12 Dimonka2

I've just hit this as well. winding back my session didn't help. Claude doctor:

 Diagnostics
 └ Currently running: npm-local (2.0.65)
 └ Path: /opt/homebrew/Cellar/node/24.10.0/bin/node
 └ Invoked: /Users/roberttaylor/.claude/local/node_modules/.bin/claude
 └ Config install method: local
 └ Auto-updates: default (true)
 └ Search: OK (vendor)

robtaylor avatar Dec 11 '25 18:12 robtaylor