Gemini CLI Fix: Prevents Output Doubling on Invalid Truncation

Eswar809 · ghdev · 2026-08-24

Fixed a bug in Google Gemini CLI where formatTruncatedToolOutput would roughly double the output size when maxChars was 0 or negative. The logic now guards against invalid truncation budgets by returning the original content unchanged, preventing incorrect slice calculations. Unit tests have been updated to cover these edge cases.

Original post →

More from coding & agent

coding & agent channel →