Gemini CLI fix stops tool execution after SIGINT/SIGTERM in headless environments
urielefrenvirtusa · ghdev · 2026-10-21
A P2 PR in google-gemini/gemini-cli (#29849) fixes cancellation handling in non-interactive/headless runs (Docker, CI, scripts).
- Root cause: cancellation listeners were only attached when process.stdin.isTTY was true, so OS signals never triggered the AbortController in non-TTY environments — the CLI could keep consuming delayed tool calls, execute shell side effects, and submit duplicate tool results after SIGINT/SIGTERM.
- Fix: replace setupStdinCancellation() with setupCancellation() that registers SIGINT/SIGTERM listeners regardless of TTY, handle UserCancelled in the stream loop to terminate immediately, guard tool scheduling with an abort check, and unify exit code 130 on cancellation.
- Fixes issue #28091; includes unit test, lint, and typecheck validation steps.
More from coding & agent
- Index Network open-sources Social Discovery Protocol: agents negotiate fit on your behalf — carsonfarmer · 2026-10-23
- Installed a formal-verification skill: it silently installed Java, MacBook runs 10 degrees hotter — zealcaiden · 2026-10-23
- OpenAI's Decisions API hits GA: near real-time routing up to 10x faster than GPT-6 Luna — OpenAIDevs · 2026-10-23
- Ruff author warns: upgrade Node/Bun now — --use-system-ca still accepts the eMudhra cert — charliermarsh · 2026-10-23
- Proof of Agent: paste one prompt and your AI mines, grades, and self-governs — adamamcbride · 2026-10-23
- DeepLearning.AI weekly: GPT-6.1 hits 97.9% byte parity on COBOL migration — DeepLearningAI · 2026-10-23