This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| """ | |
| fix-thinking-blocks.py — Fix Anthropic "thinking blocks cannot be modified" error | |
| TRIỆU CHỨNG: | |
| - User gửi message vào chat (Discord/Telegram/Webchat) nhưng assistant trả response rỗng | |
| - Stop reason = "error", content = [] | |
| - Error 400 từ Anthropic API với message: | |
| "messages.X.content.Y: `thinking` or `redacted_thinking` blocks in the | |
| latest assistant message cannot be modified. These blocks must remain |