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
- Start a long agent session (multi-file edits, tool calls, etc.)
- VS Code's automatic conversation compaction triggers
- Compaction strips or modifies
thinking / redacted_thinking blocks from prior assistant messages
- 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
- 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
- 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
- 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.
Summary
After conversation compaction occurs in a long agent session, the session crashes with HTTP 400:
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
"github.copilot.chat.agent.thinkingTool": falseSteps to Reproduce
thinking/redacted_thinkingblocks from prior assistant messagesExpected Behavior
One of the following should hold:
thinking/redacted_thinkingblocks verbatim — they cannot be touchedActual Behavior
Impact
thinkingTool: false, manual session breaks) are insufficient because:thinkingTool: falseonly prevents new thinking blocks — it does not protect against blocks already in historyRequested Actions
thinking/redacted_thinkingblocks — preserve them byte-for-byte or omit them in a valid way per Anthropic API specAdditional Notes
I am forced to manually implement a checkpoint escape protocol in my own
copilot-instructions.mdto 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.