mirror of
https://github.com/zed-industries/zed.git
synced 2026-05-23 21:05:08 +00:00
Sometimes the action log would not auto-accept agent edits when commiting. Gpt-5.4 identified this race condition: This fixes a race where `keep_committed_edits` could run after `head_commit` changed but before the new git base text had been applied, leaving committed agent edits marked as unreviewed; `ActionLog` now waits for an explicit `BufferDiffEvent::BaseTextChanged` instead of inferring readiness from generic `DiffChanged` activity, so it only accepts edits after the diff base itself is actually updated. - `ReloadGitState` updates `head_commit` before `ReloadBufferDiffBases` finishes loading and applying the new HEAD text. - In that gap, an unrelated `DiffChanged` can fire from a normal diff recalculation. - The old logic treated that event as the commit signal and ran `keep_committed_edits` too early. - `keep_committed_edits` then read stale diff base text, so it failed to match the committed agent edits. - When the real base-text update arrived later, the HEAD had already been overwritten (`old_head`), and the edits stayed unreviewed. Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Closes #ISSUE Release Notes: - Fixed an issue where committing agent written code would sometimes not mark edits as accepted |
||
|---|---|---|
| .. | ||
| src | ||
| Cargo.toml | ||
| LICENSE-GPL | ||