Skip to content

[Copilot Chat Bug] HTTP 400 "thinking blocks cannot be modified" after conversation compaction — paid tokens wasted, session unrecoverable #317608

@JUN-WEBLISS

Description

@JUN-WEBLISS

Summary

After conversation compaction occurs in a long agent session, the session crashes with HTTP 400:

thinking or redacted_thinking blocks cannot be modified
messages.N.content.N: input is invalid

This completely destroys the active session and all work-in-progress is lost. As a paid subscriber, this is unacceptable — I am paying for tokens and getting nothing in return when this error strikes.


Environment

  • VS Code version: 1.120+ (GitHub Copilot Chat extension, latest)
  • Model: Claude Sonnet 4.6 (via GitHub Copilot)
  • OS: Windows 11
  • Setting applied: "github.copilot.chat.agent.thinkingTool": false

Steps to Reproduce

  1. Start a long agent session (multi-file edits, tool calls, etc.)
  2. VS Code's automatic conversation compaction triggers
  3. Compaction strips or modifies thinking / redacted_thinking blocks from prior assistant messages
  4. On next tool call or agent turn, Anthropic's API rejects the modified message history with HTTP 400

Expected Behavior

One of the following should hold:

  • Conversation compaction must preserve thinking / redacted_thinking blocks verbatim — they cannot be touched
  • OR the compaction should gracefully exclude those blocks without altering them, in a way the API accepts
  • OR if compaction is impossible without breaking the conversation, the agent should warn the user before proceeding

Actual Behavior

  • No warning is given
  • Compaction silently corrupts the message history
  • The next agent turn crashes with HTTP 400
  • All context, in-progress work, and paid token investment in that session is lost
  • There is no retry mechanism — the session is permanently broken

Impact

  • Paid tokens are burned with zero output — this is a billing integrity issue
  • Long agent sessions (the primary use case for GitHub Copilot Pro/Max subscribers) are fundamentally unreliable
  • Workarounds (e.g., thinkingTool: false, manual session breaks) are insufficient because:
    • thinkingTool: false only prevents new thinking blocks — it does not protect against blocks already in history
    • If the setting was not active from the very first turn, the session remains vulnerable

Requested Actions

  1. Urgent fix: Ensure conversation compaction never modifies thinking / redacted_thinking blocks — preserve them byte-for-byte or omit them in a valid way per Anthropic API spec
  2. Billing guarantee: When a session is crashed by a Copilot-internal bug (not user error), tokens consumed in that session should not count against the user's quota
  3. User notification: If a session cannot be safely compacted, notify the user before compaction rather than crashing mid-session

Additional Notes

I am forced to manually implement a checkpoint escape protocol in my own copilot-instructions.md to proactively bail out of sessions before this error occurs. The fact that users need self-documented escape hatches for a first-party tool reliability bug is not acceptable for a paid product.

Please treat this as a P0 reliability bug. Long-running agent sessions are the primary selling point of Copilot's premium tiers. If they cannot be trusted, the product's core value proposition is broken.

Metadata

Metadata

Assignees

Labels

No labels
No labels

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