Gemini CLI PR fixes session context poisoning and infinite loops from interrupted agentic turns

dylanyunlon · ghdev · 2026-09-18

A P2 PR in google-gemini/gemini-cli exposes a subtle agent engineering pitfall: when the agentic loop is interrupted (SIGINT, timeout, aborted tool call), the CLI injects a synthetic turn reading [The previous response was interrupted before it completed.]. Gemini later parrots this string back as an expected completion pattern, poisoning session history and blocking tool execution until reset.

The fix applies defense in depth:

Key takeaway for agent builders: any synthetic text injected into chat history can be learned and echoed by the model.

Original post →

More from coding & agent

coding & agent channel →