Skip to content

[Bug] "thinking blocks in the latest assistant message cannot be modified": Error when context is over the limit #83

@jonasstabenow

Description

@jonasstabenow

Environment

  • OS: Linux RHEL9
  • Eclipse Version: 4.38
  • Plugin Version: 0.17 & 0.18
  • Model: Claude Opus 4.6 (likely affects any Anthropic model with extended thinking)

Bug description
When using MCP tools that produce large outputs (pushing context utilization to (way) over 100%), requests to Anthropic models fail with:

Sorry, an error occurred while generating a response. Details: unhandled status from server: 400
{"message":"messages.1.content.2: thinking or redacted_thinking blocks in the latest assistant message cannot be modified. These blocks must remain as t..."}

Request ID: xxx | GitHub Request ID: xxx

To Reproduce

  1. Start a Copilot chat session in agent mode
  2. Use an Anthropic model (I used Claude Opus 4.6)
  3. Invoke MCP tools that return large outputs (We have a (Bad) tool that can fill the context with a single call)
  4. Continue the conversation so the server needs to truncate history
  5. The 400 error appears and you cannot recover from it, the chat is broken

Expected behavior

  1. The session should never exceed context size by using a summarizing or compression feature.
  2. Dont cut thinking blocks in half (I suspect thats whats happening and causing the error, but not 100% sure)

Screenshots

Image Image

Workarounds

  • Try avoid filling the context
  • Dont use antrophic models

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions