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
undefined: The model returned the following errors: messages.3.content.47: thinking or redacted_thinking blocks in the latest assistant message cannot be modified. These blocks must remain as they were in the original response.
Plugins
No response
OpenCode version
1.2.6
Steps to reproduce
Use Claude Opus 4.6 from Amazon with thinking mode turned on using ctrl+t to select variant (i found that using the non-thinking variant avoids this issue)
Use until token is over 170k
Try to compact, and the error appears
undefined: The model returned the following errors: messages.3.content.47: thinking or redacted_thinking blocks in the latest assistant message cannot be modified. These blocks must remain as they were in the original response.
Compaction not able to proceed
WORKAROUND: Switch to another model on bedrock say Minimax M2, compact works okay, then switch back to Opus 4.6 it will work
This issue might be a duplicate of existing issues. Please check:
Claude Opus 4.5 (latest) eventually fails: thinking block cannot be modified #13286: Same exact error — thinking or redacted_thinking blocks cannot be modified — reported for Claude Opus 4.5 with the same root cause (thinking block preservation during message reconstruction/compaction). The difference here is the model (Opus 4.6 via Amazon Bedrock) and the specific trigger (compaction at ~170k tokens), but the underlying bug appears to be the same.
Please review #13286 and consider whether this is the same issue or a related variant specific to Bedrock/compaction flow.
Is anyone still having this issue? if so can u send me a session: opencode export > session.json run this command NOT /export and send me json file, u can also dm it on X or discord, or email me
Hi @rekram1-node ! I have sent you the export on X.com. If you want I can also email it to you (i couldn't find your email ID, and the discord link in your github profile is invalid).
I have observed the same issue in sonnet-4.6 on bedrock and opus so the export I sent to you was for sonnet. If needed, I can also send you an opus export since the issue is very easy to reproduce.
This was addressed in the latest release by changing compaction requests so the conversation history is serialized into a single user message. This prevents preserved assistant thinking / redacted_thinking blocks from being modified or replayed as part of the compaction request.
We also verified the post-compaction path with Amazon Bedrock Claude Opus 4.6 and thinking enabled, including retained recent turns, a tail beginning at an assistant-message boundary, and multiple messages sent after compaction. We could not reproduce the failure on the latest release.
Closing as resolved. If you continue to hit this on the latest version, please let us know with updated reproduction details and we can reopen the issue.
Activity
github-actions commentedon Feb 19, 2026
This issue might be a duplicate of existing issues. Please check:
thinkingorredacted_thinkingblocks cannot be modified — reported for Claude Opus 4.5 with the same root cause (thinking block preservation during message reconstruction/compaction). The difference here is the model (Opus 4.6 via Amazon Bedrock) and the specific trigger (compaction at ~170k tokens), but the underlying bug appears to be the same.Please review #13286 and consider whether this is the same issue or a related variant specific to Bedrock/compaction flow.
neshreve commentedon Mar 2, 2026
Also experiencing this behavior on OpenCode 1.2.15, Claude Sonnet 4.6 via AWS Bedrock
inventumamet commentedon Mar 2, 2026
I haven't had any issues with 1.2.15 so far with opus 4.6. I thought it had been fixed 😁
bbartels commentedon Apr 20, 2026
Running into this issue with 1.4.7
rekram1-node commentedon May 7, 2026
Is anyone still having this issue? if so can u send me a session:
opencode export > session.jsonrun this command NOT /export and send me json file, u can also dm it on X or discord, or email meIgnisDa commentedon May 7, 2026
Hi @rekram1-node ! I have sent you the export on X.com. If you want I can also email it to you (i couldn't find your email ID, and the discord link in your github profile is invalid).
I have observed the same issue in sonnet-4.6 on bedrock and opus so the export I sent to you was for sonnet. If needed, I can also send you an opus export since the issue is very easy to reproduce.
J-Light commentedon May 8, 2026
Can confirm this issue is repeatable when variant is set to non-default of high.
bbartels commentedon May 12, 2026
@rekram1-node Would you mind taking another look? :) Seems like @IgnisDa has sent you an export
cheeseandcereal commentedon Jun 10, 2026
I thought #29786 would solve this issue, but I'm still experiencing this issue on 1.17.0
jessevdp commentedon Jun 11, 2026
Probably maybe related: when I use compaction via
bedrockI get a bunch of"Connection reset by server"errors.I'm not using AWS directly, I'm using the bedrock compatible proxy/passthrough endpoint of LiteLLM.
But it feels at least related.
This happens for Opus 4.6 and 4.8 for me (those are the ones I've tested -> it seems to have more to do with the provider than the model anyway..).
I also tried to "unset" the thinking mode. But that gives the same errors.
Using OpenCode 1.17.3 right now. But I've seen this happen on previous versions too.
mayshwartz2 commentedon Jul 16, 2026
hey @rekram1-node,
we are still experiencing it with 1.17.13 and sonnet 4.6 with bedrock - any updates on this?
nabilfreeman commentedon Jul 29, 2026
Same problem in Sonnet, Opus and Fable 5
dreamorosi commentedon Aug 6, 2026
Also experiencing this on 1.18.14 with Bedrock Sonnet 5 - unfortunately I can't share the session export
rekram1-node commentedon Aug 7, 2026
Okay looking into this so sorry lost track of this issue
rekram1-node commentedon Aug 7, 2026
This may have been fixed in 1.18.15 actually
opencode-agent commentedon Aug 7, 2026
This was addressed in the latest release by changing compaction requests so the conversation history is serialized into a single user message. This prevents preserved assistant
thinking/redacted_thinkingblocks from being modified or replayed as part of the compaction request.We also verified the post-compaction path with Amazon Bedrock Claude Opus 4.6 and thinking enabled, including retained recent turns, a tail beginning at an assistant-message boundary, and multiple messages sent after compaction. We could not reproduce the failure on the latest release.
Closing as resolved. If you continue to hit this on the latest version, please let us know with updated reproduction details and we can reopen the issue.