Gemini CLI patch strips leaked thought blocks from history turns
DavidAPierce · ghdev · 2026-07-23
This PR fixes a Gemini CLI bug where thought: true parts could leak into getHistoryTurns when context management is disabled.
What changed
- Filters out all monologue/thought parts from history turns for Gemini 2.x and modern models.
- Adjusts content compilation so Gemini 2.x models use the correct modern feature format and avoid API 400 errors.
- Adds unit tests covering both a mocked gemini-2.5-pro model and a mocked gemini-3.1-pro-preview model.
Why it matters
Without this scrub, leaked thought blocks could produce duplicate reasoning segments or confuse later turns in the conversation.
More from coding & agent
- NVIDIA says Nemotron 3 Ultra hit 97.1% on agentic RTL chip-design tasks — NVIDIAAI · 2026-07-27
- Tokyo Agent Forge hackathon shipped production-ready AI agents in one day — DavidBennett__ · 2026-07-27
- Long-running agents will need immutable event logs, this thread argues — sebpaquet · 2026-07-27
- Agentic Data Science in Practice: Agents Write Code but Answer Wrong Questions — hugobowne · 2026-07-27
- A VS Code extension adds Markdown-style highlighting to Alchemy string templates — samgoodwin89 · 2026-07-27
- Claude’s Stripe MCP connector is being called unusable after repeated disconnects — evielync · 2026-07-27