v1.35.3 - Fix tool_result history context blowup
Fix: Base64 images in tool_result causing context truncation
Base64 images inside tool_result content (~1-2MB) were inflating token estimates to ~500K, causing the context manager to truncate away tool_use/tool_result messages entirely. The LLM lost all knowledge of generated images and file IDs on subsequent rounds.
Changes
- Strip tool_result images before truncation — base64 images are now removed from ALL tool_result content blocks before token estimation. The text block already has file_id/URL references.
- Recurse into tool_result content in
stripImagesFromMessage— previously only stripped top-level image blocks - External MCP stdio/SSE client support — new server_manager, standard_client, stdio_client
- SSE truncation — large tool_result SSE events truncated to 4000 chars (full data still goes to LLM)
- Clear API debug logging —
CLAUDE API REQUESTblock shows exact messages sent to Claude - Silenced noisy MCP resource logs — removed per-resource "unknown server_id" spam
- 40 new tests — 28 for ProcessMCPToolResult behavior matrix, 12 for tool_result image stripping