Fix: Gemini CLI Multi-Turn History Corruption on Abort
amelidev · ghdev · 2026-08-14
This PR fixes a tricky issue in Gemini CLI where aborting a multi-turn prompt with tool calls left the session history in an incomplete, pending state. This caused the model to erroneously resume the cancelled task when the user sent a new, unrelated message.
The Fix: It introduces initial state tracking for history length and token counts when a new prompt starts. If the prompt execution is aborted or cancelled mid-stream, the conversational history and token baseline are fully rolled back to their pristine state before the prompt began. A unit test was also added to ensure correct rollback behavior.
More from coding & agent
- Devs say LLM coding mistakes are a different class: overcomplication, inferred limits, worse at higher reasoning — Mu5_ · 2026-10-16
- How do you debug bad agent runs when you already have tracing? — Sensitive-Parsnip-12 · 2026-10-16
- Where does pre-task context live for agents? Devs debate workflows beyond handoff — shishen2026 · 2026-10-16
- No-instruction autonomous agent wakes up, sets own goals, and tries hacking by default — sethlazar · 2026-10-16
- CODESTRUCT reframes codebases as AST action spaces to fix brittle LLM code agents — burkov · 2026-10-16
- Would you install another SDK for agent debugging on top of your tracing stack? — Sensitive-Parsnip-12 · 2026-10-16