Gemini CLI PR fixes parallel-agent file races with per-path mutexes and atomic writes
elberthc-byte · ghdev · 2026-09-25
A P1 PR merged into Google's Gemini CLI systematically fixes race conditions when parallel tool executions (notably parallel sub-agents) touch the same file: uncoordinated read-modify-write sequences caused silent lost updates, wrong diffs, and shadow Git .git/index.lock collisions.
Key changes:
- An in-process per-path async mutex (withPathLock) with canonicalized real-path keys and AbortSignal-aware queueing
- EditTool and WriteFileTool read-modify-write sections serialized per resolved path
- Atomic writes via unique sibling .tmp files plus fs.rename, preserving permissions and retrying Windows transient EBUSY/EPERM/EACCES errors
- Shadow Git snapshots serialized per project root to prevent index-lock collisions
More from coding & agent
- Micius-Flash: 27B Multimodal Model for Hardware and Semiconductor Agents — zhiman-ai · 2026-11-11
- Jane Street's AI Skill Is a Strict Socratic Tutor You Can Copy Today — omojumiller · 2026-11-11
- Designer builds 100k-site German heritage map with Claude, zero code written by hand — neutronenkind · 2026-11-11
- Matt Pocock: DDD, not agentic tricks, is what blows minds in his AI course — mattpocockuk · 2026-11-11
- AI agents run 24/7 for a month to rewrite Météo-France's AROME weather model — IgorCarron · 2026-11-11
- Prompting secret: ask the model to roleplay a legendary high-agency explorer — tokenbender · 2026-11-11