Gemini CLI PR fixes plan files wrongly rejected due to 1KB whitespace prefix

Web4everyone32 · ghdev · 2026-10-26

A community PR for google-gemini/gemini-cli fixes a Plan Mode edge case: the old logic sampled only the first 1KB to decide if a plan file was empty, so a valid plan starting with 1,024 spaces was wrongly rejected. The fix scans the file in bounded chunks until non-whitespace content or EOF, incrementally decodes UTF-8/UTF-16 with BOM preservation, keeps memory bounded, and reports unreadable plans as read failures instead of empty files. Regression tests cover the 1KB boundary, chunking, all five BOM encodings, and truncated code units.

Original post →

More from coding & agent

coding & agent channel →