Gemini CLI PR blocks mutating tool calls at scheduler layer to enforce user 'hold' directives
dylanyunlon · ghdev · 2026-09-18
A P1-sized PR (#29394) on google-gemini/gemini-cli addresses an aggressive action-bias: even when users say 'wait', 'explain first' or 'don't apply fixes yet', the agent still fires destructive tool calls (replace, writefile, runshellcommand). Prompt-level instructions alone fail because RLHF completion bias overwhelms attention on negative constraints.
The fix enforces holds programmatically at the scheduler layer:
- Directive detection service: 14 regex patterns across 4 directive types (EXPLICITWAIT, EXPLAINONLY, NOCHANGESYET, REVIEWFIRST), with negation guards against false positives and confidence scores of 0.8–0.95
- Hold directive guard: blocks only mutating tools (writefile, replace, runshellcommand, writetodos, invokeagent); read-only tools like readfile, grep, glob and websearch stay available for continued investigation
- Blocked calls return a structured [HOLD DIRECTIVE ACTIVE] error; both headless execution paths are covered and the system prompt documents the enforcement
More from coding & agent
- Free course covers the 4 hard problems of production generative media agents — Al_Grigor · 2026-11-04
- Quota reset night: Codex back to 100% while Claude shows just 10% left — rudrank · 2026-11-04
- Self-improving software is inevitable: closing the agent-observability loop — bibryam · 2026-11-04
- Building a 7-GPU 132GB VRAM local inference rig: consolidate on EPYC or split across two systems? — infectiousstupidity · 2026-11-04
- Founder of 50-person, 12-country team says he talks to AI agents more than humans — Scobleizer · 2026-11-04
- Pi launches a minimal agent harness; Zammoth adds AI engineer to Mac music app — solyarisoftware · 2026-11-04