[Bug] Anthropic API Error: Cannot modify thinking blocks in assistant messages during compaction
Bug Description
why can't you continue ?
⎿ API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.7.content.128: 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_011CXBNbPcq4yPpsC5Qmror1"}
❯ /compact
⎿ Error: Error during compaction: Error: API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.7.content.128: 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_011CXBNbzJ9cRhFwCLr3exAu"}
Environment Info
- Platform: darwin
- Terminal: vscode
- Version: 2.1.9
- Feedback ID: ccbe12fd-adcc-47b2-affd-28c50b136023
Errors
[{"error":"Error: NON-FATAL: Lock acquisition failed for /Users/sael-you/.local/share/claude/versions/2.1.9 (expected in multi-process scenarios)\n at BER (/$bunfs/root/claude:3355:2091)\n at HFA (/$bunfs/root/claude:3355:1202)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-01-16T16:01:47.205Z"},{"error":"MaxFileReadTokenExceededError: File content (29980 tokens) exceeds maximum allowed tokens (25000). Please use offset and limit parameters to read specific portions of the file, or use the GrepTool to search for specific content.\n at dx_ (/$bunfs/root/claude:1571:13405)\n at async call (/$bunfs/root/claude:1580:1005)\n at async Xd7 (/$bunfs/root/claude:2717:19646)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-01-16T16:05:16.424Z"},{"error":"Error: 1P event logging: 16 events failed to export\n at queueFailedEvents (/$bunfs/root/claude:691:2081)\n at async doExport (/$bunfs/root/claude:691:1259)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-01-16T16:10:25.231Z"},{"error":"Error: {\"message\":\"Failed to export 16 events\",\"originalLine\":\"691\",\"originalColumn\":\"1338\",\"line\":\"691\",\"column\":\"1338\",\"sourceURL\":\"/$bunfs/root/claude\",\"stack\":\"Error: Failed to export 16 events\\n at doExport (/$bunfs/root/claude:691:1338)\\n at processTicksAndRejections (native:7:39)\",\"name\":\"Error\"}\n at error (/$bunfs/root/claude:2354:25029)\n at <anonymous> (/$bunfs/root/claude:685:36350)\n at tVD (/$bunfs/root/claude:685:36894)\n at <anonymous> (/$bunfs/root/claude:686:17366)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-01-16T16:10:25.231Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages.7.content.128: `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_011CXBMKDkSfvuEJ6LqaCAtP\"}\n at generate (/$bunfs/root/claude:939:2085)\n at makeRequest (/$bunfs/root/claude:956:5435)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-01-16T16:12:04.713Z"},{"error":"Error: API Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages.7.content.128: `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_011CXBMKDkSfvuEJ6LqaCAtP\"}\n at bXR (/$bunfs/root/claude:2442:600)\n at async j4B (
Note: Error logs were truncated.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗