You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Invalid Request: Mismatch in Thinking Block Parameters During API Call #2608
Bug Description
API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.5.content.61: When providing thinking or redacted_thinking blocks, the blocks must match the parameters during the original request."}}
Hey Anthropic team, I think I've figured out what's causing the widespread "thinking blocks must match parameters" error seen in issues #2608, #2746, #2573, #2171, #1755, and the related bug in #1179
From what I can tell in the minified cli.js, when a user submits a long prompt with thinking budget ("think" < "think hard" < "think harder" < "ultrathink"), the client synthetically adds a {role: "assistant", content: [{type: "thinking"}]} message to the conversation history before making the API call
The API then rejects this because it sees a thinking block it didn't create, which violates the protocol
With access to the full source, you should be able to find this by searching for where that synthetic assistant message is pushed to the history, likely gated by a thinking budget flag and a line-count check
Consider removing that client-side message injection and using the proper API parameters for extended thinking instead
Hope this helps you consolidate these issues and track it down
Interesting, I just got this on claude-code v2.0.37.
I don't have any good context to report since I wasn't doing anything peculiar when it happened. I had started the convo on one machine and it happened when I continued the convo on another machine through VNC, but I don't see how that could be related.
I never encountered this issue in months of using claude-code.
This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.
Activity
slavakurilyak commentedon Jul 1, 2025
Hey Anthropic team, I think I've figured out what's causing the widespread "thinking blocks must match parameters" error seen in issues #2608, #2746, #2573, #2171, #1755, and the related bug in #1179
From what I can tell in the minified
cli.js, when a user submits a long prompt with thinking budget ("think" < "think hard" < "think harder" < "ultrathink"), the client synthetically adds a{role: "assistant", content: [{type: "thinking"}]}message to the conversation history before making the API callThe API then rejects this because it sees a
thinkingblock it didn't create, which violates the protocolWith access to the full source, you should be able to find this by searching for where that synthetic assistant message is pushed to the history, likely gated by a thinking budget flag and a line-count check
Consider removing that client-side message injection and using the proper API parameters for extended thinking instead
Hope this helps you consolidate these issues and track it down
Kanezal commentedon Jul 7, 2025
need fix!
Kanezal commentedon Jul 19, 2025
I think it was completely fixed, no such error for 3 hours straight.
danneu commentedon Nov 12, 2025
Interesting, I just got this on claude-code v2.0.37.
I don't have any good context to report since I wasn't doing anything peculiar when it happened. I had started the convo on one machine and it happened when I continued the convo on another machine through VNC, but I don't see how that could be related.
I never encountered this issue in months of using claude-code.
github-actions commentedon Dec 13, 2025
This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.
github-actions commentedon Dec 20, 2025
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.