Gemini CLI fix: substring matching inlined unrequested binary files into model context
priyanshu1976 · ghdev · 2026-10-16
A PR to google-gemini/gemini-cli fixes how readmanyfiles decides whether an asset was "explicitly requested". The old logic used substring checks between raw include-pattern strings and file stems/extensions, so any textual overlap counted — inlining unrequested binaries as base64 into model context. E.g. include: ["/report/"] pulled in reports/report.png, and include: ["assets/", "src/logo.txt"] inlined assets/logo.png via the logo substring.
The fix requires both: the pattern actually matches the file via picomatch (nocase + dot, mirroring discovery glob options), and the pattern's last segment names the file's extension or name — broad wildcards like no longer opt binaries in. Case handling is now uniformly insensitive. Three new tests cover the regression scenarios; text-file handling and exclusions are unchanged.
More from coding & agent
- Local tool calling compared: how Gemma 4, Llama 3 and Mistral differ — leslysandra · 2026-10-16
- Teamily AI 2.0 tested: 3 agents research and draft LinkedIn posts autonomously — SimplyAnnisa · 2026-10-16
- Harness, a command center for coding agents, hits #2 on Product Hunt — dee_hw · 2026-10-16
- nanobot: a 4,000-line rewrite of openclaw, 99% smaller — mdancho84 · 2026-10-16
- Open-source Free WebAccess routes agent web search across vendors for $0 with auto-fallback — yangyi · 2026-10-16
- State of Agentic Coding podcast hosts Geoffrey Huntley on code mode and self-modifying harnesses — mitsuhiko · 2026-10-16