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
- 6 MCP servers ate 30k tokens before the first prompt: a Claude Code slimming recipe — for-entire-phonly · 2026-11-30
- Redditor ships 14-rule Lumen Anchor Protocol claiming math-anchored hallucination and jailbreak immunity — Teralitha · 2026-11-30
- Developer explains agent memory design: append-only storage plus quarantine to handle collisions — rchardkovacs · 2026-11-30
- WorkflowArena: 145 long-horizon tasks benchmark multi-agent orchestration across nine models — jiqizhixin · 2026-11-30
- VASP: visual-anchored agent tops scientific poster generation with 94.3 mAP figure extraction — Huihan Wang · 2026-11-30
- Dev shows agents auto-verifying and sending SAFE fundraising docs in parallel — Scobleizer · 2026-11-30