Gemini CLI Fix: Prevents Output Inflation on Negative maxChars

Kanika0306 · ghdev · 2026-08-24

Fixes an output inflation bug in formatTruncatedToolOutput. When maxChars was negative, JavaScript's slice negative-index behavior caused the output to duplicate to approximately 2x the original size. The fix clamps maxChars using Math.max(0, maxChars) and guards against slice(-0) to prevent returning the full string.

Original post →

More from coding & agent

coding & agent channel →