Session bricking due to invalid base64 in MCP tool results
Session bricking due to invalid base64 in MCP tool results: a task in LegoFlow-SWE (Harbor dataset). When an MCP tool returns image or audio data, it is sometimes sent as a base64‑encoded string and sometimes as raw binary bytes. The current handling can produce data that is either doubly‑encoded…
The task
When an MCP tool returns image or audio data, it is sometimes sent as a base64‑encoded string and sometimes as raw binary bytes. The current handling can produce data that is either doubly‑encoded or contains non‑ASCII bytes, which the Anthropic API rejects with a 400 error:
Part of Lego-X/LegoFlow-SWE.