[Bug] Anthropic API Error: Cannot modify thinking blocks during conversation compaction
Resolved 💬 3 comments Opened Dec 8, 2025 by 0xjan888 Closed Dec 9, 2025
Bug Description
- Compaction tries to summarize - The /compact command attempts to condense the conversation history to save context space
- API restriction - The Claude API has a strict rule: thinking blocks cannot be modified after they're created. They must stay exactly as they were.
- Conflict! - The compaction process tried to modify a message that contains thinking blocks, which the API rejected with a 400 error.
Error:
Error: Error during compaction: Error: API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.9.content.5: thinking or redacted_thinking
blocks in the latest assistant message cannot be modified. These blocks must remain as they were in the original response."},"request_id":"req_011CVuV4mBXpumyhqzBStUBi"}
Environment Info
- Platform: darwin
- Terminal: cursor
- Version: 2.0.61
- Feedback ID: 9dfaa425-912c-4e6e-8c01-bd1148768f2b
Errors
[]This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗