gemini-cli bug fix: tool-returned images never reached the model until this one-line patch

T1misageek · ghdev · 2026-10-01

A PR to google-gemini/gemini-cli fixes a bug where images returned by tools (e.g. screenshots read via readfile) never reached the model. stripToolCallIdPrefixes() rebuilt function responses from only name/response/id, dropping functionResponse.parts where multimodal output lives, so the model hallucinated image content. The fix spreads the original response and only rewrites id. Validation includes a unit test plus an end-to-end recipe: before, the model invented titles for an image titled "PLANET CARTOONIA"; after, 3/3 correct.

Original post →

More from coding & agent

coding & agent channel →