GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Claude Opus 4.5 (latest) eventually fails: thinking block cannot be modified · Issue #13286 · anomalyco/opencode

Claude Opus 4.5 (latest) eventually fails: thinking block cannot be modified #13286

New issue
Copy link
New issue
Copy link
Closed
Closed
Claude Opus 4.5 (latest) eventually fails: thinking block cannot be modified#13286
Copy link
Assignees
kitlangton

Description

@Jonathanm10
Jonathanm10
opened on Feb 12, 2026
Issue body actions

Description

When using Claude Opus 4.5 (latest) from Anthropic in OpenCode, conversations eventually fail with a validation error indicating that previously returned thinking / redacted_thinking blocks were modified.

Exact error:

messages.7.content.9: `thinking` or `redacted_thinking` blocks in the latest assistant message cannot be modified. These blocks must remain as they were in the original response.

This appears to happen consistently after some conversation length/tool usage (not immediately on first turn).

Impact

  • Session becomes unrecoverable for that turn/model state
  • Prevents continued use of Opus 4.5 in longer real-world sessions

Steps to reproduce

  1. Configure OpenCode to use Anthropic Claude Opus 4.5 (latest)
  2. Start a normal coding session with multiple turns (including tool calls)
  3. Continue until context grows and OpenCode sends follow-up turns
  4. Observe Anthropic validation failure above

Expected behavior

OpenCode should preserve any previously returned thinking blocks exactly as required by Anthropic and continue the session without validation errors.

Actual behavior

Request eventually fails with:

... `thinking` or `redacted_thinking` blocks in the latest assistant message cannot be modified ...

Notes

  • Likely related to message reconstruction/compaction/replay logic for Anthropic thinking blocks.
  • Possibly related prior reports: Claude Models Thinking block error #10970 and Expected thinking or redacted_thinking but found tool_use #8010 (similar thinking-block ordering/validation failures), but this report is the explicit "cannot be modified" variant on latest Opus 4.5.

Environment

  • Provider: Anthropic
  • Model: Claude Opus 4.5 (latest)
  • OS / terminal / OpenCode version: not yet collected from reporter
Reacted by William Rory Kronmiller, Paul Zhang, ilyes, Mingye Lu, Tomas Pereira de Vasconcelos, Сашка724ая and Mike

Activity

  1. github-actions
    assigned
    thdxr
    on Feb 12, 2026
  2. github-actions commented on Feb 12, 2026

    @github-actions
    github-actionsBot
    on Feb 12, 2026 – with GitHub Actions
    Contributor
    More actions

    Thanks for the detailed report! This appears to be related to how thinking blocks are handled during message reconstruction/compaction with Anthropic's Opus 4.5 model.

    This is related to similar thinking block issues with Claude models:

    • Claude Models Thinking block error #10970: Claude Models Thinking block error
    • Expected thinking or redacted_thinking but found tool_use #8010: Expected thinking or redacted_thinking but found tool_use

    The specific "cannot be modified" validation error suggests this is happening during message replay/reconstruction when OpenCode resends previous assistant messages. This is distinct from the other thinking block ordering issues, but the root cause may be related to how thinking blocks are being preserved and replayed in conversation history.

  3. Jonathanm10 commented on Feb 12, 2026

    @Jonathanm10
    Jonathanm10
    on Feb 12, 2026
    Author
    More actions

    Adding reporter environment details:

    • OpenCode version: 1.1.60
    • OS: macOS 26.2 (25C56)
    • Provider/auth path: Anthropic OAuth subscription (direct Anthropic account auth)

    This is reproducible in real usage over longer multi-turn sessions with Claude Opus 4.5 (latest).

  4. shrimpwtf commented on Feb 16, 2026

    @shrimpwtf
    shrimpwtf
    on Feb 16, 2026
    More actions

    thinking or redacted_thinking blocks in the latest assistant message cannot be modified.

    getting very frequently

    Reacted by Sebastian Rojo, Mochamad Revanza Kurniawan, Scott Anderson, William Rory Kronmiller, Dan Piet, ilyes, Akash and Murat Bayraktar
    Reacted by Sebastian Rojo
  5. gnadaban commented on Feb 20, 2026

    @gnadaban
    gnadaban
    on Feb 20, 2026
    More actions

    Anyone running into this, there are now 2 pending PRs fixing this issue, it's only a matter of time hopefully. :)

    Reacted by Dan Piet
  6. tongsh6 commented on Feb 28, 2026

    @tongsh6
    tongsh6
    on Feb 28, 2026
    More actions

    I'm also experiencing this same issue.

    Error message:

    messages.5.content.51: `thinking` or `redacted_thinking` blocks in the latest assistant message cannot be modified. These blocks must remain as they were in the original response.
    

    This occurs during normal usage with extended thinking enabled. The conversation becomes unrecoverable once this error appears.

    Environment:

    • OS: Windows 11
    • Model: Claude Opus 4.6 (via Anthropic)

    +1 for a fix — this seems to be a persistent issue across multiple Claude model versions and is a significant blocker for longer sessions.

  7. pietdaniel commented on Feb 28, 2026

    @pietdaniel
    pietdaniel
    on Feb 28, 2026
    More actions

    Same Experience, this happens when I get to ~120k tokens and try to run a compaction.

    undefined: The model returned the following errors: messages.1.content.1: `thinking` or `redacted_thinking` blocks in the latest assistant message cannot be modified. These blocks must remain as they were in the original response.
    

    Current model information

    Session ID: ses_35b0c2b0bffeAhmbLv3c6TYj3J
    Created: 2/28/2026, 10:52:49 AM
    Updated: 2/28/2026, 10:53:20 AM


    User

    list your current model


    Assistant (Build · anthropic.claude-opus-4-6-v1 · 5.2s)

    Thinking:

    The user is asking about my current model. I already have this information from the system prompt - I'm powered by anthropic.claude-opus-4-6-v1 with the exact model ID amazon-bedrock/anthropic.claude-opus-4-6-v1.

    My current model is:

    • Model name: anthropic.claude-opus-4-6-v1
    • Exact model ID: amazon-bedrock/anthropic.claude-opus-4-6-v1

    User

    list the current machine specification you are running on


    Assistant (Build · anthropic.claude-opus-4-6-v1 · 7.1s)

    Based on the environment information available to me, here's what I know:

    • Platform: macOS (darwin)

    $ opencode --version 2>/dev/null || opencode version 2>/dev/null || which opencode 2>/dev/null
    1.2.10
    
  8. paul4156 commented on Mar 9, 2026

    @paul4156
    paul4156
    on Mar 9, 2026
    More actions

    Hitting this consistently with Claude Sonnet 4.6 + high thinking budget. Once thinking blocks accumulate in history, compaction fails and the session is dead. The only escape is starting a new session.

    A configurable compaction threshold (e.g. trigger at 50%) would help a lot — even with some context loss, getting a working session at 50% is far better than a broken one at 85%. Related: #11314.

  9. thdxr
    assigned
    kitlangton
    and unassigned
    thdxr
    on Apr 26, 2026
  10. rekram1-node commented on May 7, 2026

    @rekram1-node
    rekram1-node
    on May 7, 2026
    Member
    More actions

    Believe this was fixed if people continue having it just send me a session where u encountered it:

    opencode export > session.json (this is not /export this is a shell command to run)

  11. rekram1-node
    closed this as completedon May 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @kitlangton
    kitlangton

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.