[Bug] Anthropic API Error: Cannot modify thinking blocks in assistant message during compaction
Resolved 💬 3 comments Opened Dec 7, 2025 by MagicalLeo Closed Dec 9, 2025
Bug Description
Error: Error during compaction: Error: API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.1.content.21: 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_011CVsDYuaxkCiPJ1Tpkois3"}
Environment Info
- Platform: linux
- Terminal: gnome-terminal
- Version: 2.0.59
- Feedback ID: 9b082fcf-23ca-4bc7-94dd-955cb5c9e582
Errors
[{"error":"Error\n at PS (/$bunfs/root/claude:173:1143)\n at <anonymous> (/$bunfs/root/claude:174:10086)\n at emit (node:events:92:22)\n at endReadableNT (internal:streams/readable:862:50)\n at processTicksAndRejections (native:7:39)\n at request (/$bunfs/root/claude:176:2147)\n at processTicksAndRejections (native:7:39)","timestamp":"2025-12-06T04:48:11.714Z"},{"error":"Error\n at PS (/$bunfs/root/claude:173:1143)\n at <anonymous> (/$bunfs/root/claude:174:10086)\n at emit (node:events:92:22)\n at endReadableNT (internal:streams/readable:862:50)\n at processTicksAndRejections (native:7:39)\n at request (/$bunfs/root/claude:176:2147)\n at processTicksAndRejections (native:7:39)","timestamp":"2025-12-06T04:48:11.741Z"},{"error":"Error\n at PS (/$bunfs/root/claude:173:1143)\n at <anonymous> (/$bunfs/root/claude:174:10086)\n at emit (node:events:92:22)\n at endReadableNT (internal:streams/readable:862:50)\n at processTicksAndRejections (native:7:39)\n at request (/$bunfs/root/claude:176:2147)\n at processTicksAndRejections (native:7:39)","timestamp":"2025-12-06T04:48:12.032Z"},{"error":"Error: Error parsing line in /home/codebat/.claude/projects/-home-codebat-work-project-Confidential-Computing-Confidential-Computing/35b402c8-cb97-4c76-9c93-f08561c9bda8.jsonl: SyntaxError: JSON Parse error: Expected '}'\n at <anonymous> (/$bunfs/root/claude:192:84)\n at map (native:1:11)\n at ha (/$bunfs/root/claude:192:29)\n at async <anonymous> (/$bunfs/root/claude:4299:1530)\n at async <anonymous> (/$bunfs/root/claude:4299:1248)\n at async getAllTranscripts (/$bunfs/root/claude:4299:439)\n at async PAB (/$bunfs/root/claude:4300:2237)\n at async EO (/$bunfs/root/claude:4300:4122)\n at async i0D (/$bunfs/root/claude:4300:5982)\n at async jl (/$bunfs/root/claude:1838:14480)\n at async <anonymous> (/$bunfs/root/claude:4607:6124)\n at processTicksAndRejections (native:7:39)","timestamp":"2025-12-06T04:48:12.135Z"},{"error":"Error\n at PS (/$bunfs/root/claude:173:1143)\n at <anonymous> (/$bunfs/root/claude:174:10086)\n at emit (node:events:92:22)\n at endReadableNT (internal:streams/readable:862:50)\n at processTicksAndRejections (native:7:39)\n at request (/$bunfs/root/claude:176:2147)\n at processTicksAndRejections (native:7:39)","timestamp":"2025-12-06T04:48:12.739Z"},{"error":"Error: Request was aborted.\n at _createMessage (/$bunfs/root/claude:112:3151)\n at processTicksAndRejections (native:7:39)","timestamp":"2025-12-06T05:13:00.169Z"},{"error":"MaxFileReadTokenExceededError: File content (34798 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 xlI (/$bunfs/root/claude:1374:10588)\n at async call (/$bunfs/root/claude:1383:972)\n at async <anonymous> (/$bunfs/root/claude:1595:1512)\n at processTicksAndRejections (native:7:39)","timestamp":"2025-12-06T15:41:54.055Z"},{"error":"Error: 429 {\"type\":\"error\",\"error\":{\"type\":\"rate_limit_error\",\"message\":\"This request would exceed your account's rate limit. Please try again later.\"},\"request_id\":\"req_011CVqhqbieodKNPXEHXdRT1\"}\n at generate (/$bunfs/root/claude:108:10575)\n at makeRequest (/$bunfs/root/claude:1216:5434)\n at processTicksAndRejections (native:7:39)","timestamp":"2025-12-06T15:54:52.493Z"},{"error":"Error: Request was aborted.\n at makeRequest (/$bunfs/root/claude:1216:3740)\n at processTicksAndRejections (native:7:39)","timestamp":"2025-12-07T04:44:56.941Z"},{"error":"Error: EISDIR: illegal operation on a directory, read\n at readFileSync (unknown)\n at readFileSync (/$bunfs/root/claude:12:370)\n at klI (/$bunfs/root/claude:4300:17669)\n at call (/$bunfs/root/claude:1383:912)\n at call (/$bunfs/root/claude:1379:5711)\n at af9 (/$bunfs/root/claude:2955:17002)\n at processTicksAndRejections (native:7:39)","timestamp":"2025-12-07T04:45:23.639Z"},{"error":"MaxFileReadTokenExceededError: File content (49233 tokens) exceeds maximum allowed tokens (25000). Plea
Note: Error logs were truncated.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗