gemini-cli PR Fixes Silent Lost Updates From Concurrent Tool File Writes
ranjan-del · ghdev · 2026-09-08
gemini-cli PR #29244 (priority/p1) exposes and fixes a subtle class of agent concurrency bugs: when parallel tool calls write the same path, two concurrent replace calls both read the original content and the second silently discards the first's edit — while both tool calls report success to the model. The PR fixes four races: (1) non-atomic writes (fs.writeFile truncates then streams, exposing 129 distinct partial states on a 64MB write) now go through a temp file + rename, copying file mode before renaming and retrying transient Windows EBUSY/EPERM; (2) lost updates in replace, caused by await points between read and write, fixed with an in-process per-path async mutex (utils/pathMutex.ts). Every race was reproduced on main first, each with a regression test.
More from coding & agent
- OpenAI opens up agent sandboxes: BYO or pick from Cloudflare, E2B, Modal, Vercel and more — threepointone · 2026-09-11
- SocialCrawl MCP lets agents search Reddit, YouTube, TikTok, X with one API key — dooddyman · 2026-09-11
- Astra builds a surprisingly polished Catan game in three.js, reusing past UI and 3D assets — FinanceYF5 · 2026-09-11
- Open-Source Tool Highlights the Exact PDF Paragraphs Behind AI Answers — Flat-Phone-1596 · 2026-09-11
- OpenAI Codex may issue another usage reset this weekend, says Codex lead resets happen — umesh_ai · 2026-09-11
- Dev swaps gemini-3.8 for gemini-3.5-flash-lite in his MCP harness at a fraction of cost — julianharris · 2026-09-11