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
- Warp's six non-engineering teams all run on Linear and Claude Code — mon__lim · 2026-09-11
- Is inference latency becoming the biggest bottleneck for production AI agents? — Euphoric_Sea632 · 2026-09-11
- Anthropic researcher: 99% of engineers now run swarms of 300+ self-improving agents — AlishaOutridge · 2026-09-11
- Gergely Orosz: Shipping 10x PRs With AI Agents, Sites Fill With Small Regressions — ducha_aiki · 2026-09-11
- Same Echo Maze prompt, three frontier models: all passed visually but shipped the same hidden bug — eyishazyer · 2026-09-11
- Astra storyboards plus Minimax H3 per-shot generation boost video success rates — Hailuo_AI · 2026-09-11