zed/crates/action_log
Kirill Bulatov 31343566e7
Do not react on already observed buffer edits' versions (#46308)
If I apply

```diff
diff --git a/crates/action_log/src/action_log.rs b/crates/action_log/src/action_log.rs
index 404fb3616d..ece063c34f 100644
--- a/crates/action_log/src/action_log.rs
+++ b/crates/action_log/src/action_log.rs
@@ -223,6 +223,7 @@ impl ActionLog {
             futures::select_biased! {
                 buffer_update = buffer_updates.next() => {
                     if let Some((author, buffer_snapshot)) = buffer_update {
+                        dbg!(&author);
                         Self::track_edits(&this, &buffer, author, buffer_snapshot, cx).await?;
                     } else {
                         break;
```

on top of `main`, `User` and `Agent` will always interleave.

This happens because `action_log` does updates on `Entity<Buffer>` which
is a current editor's buffer, tracked, and updated by agent output (acp
or regular threads) — those updates come back as `BufferEvent::Edited`
event after each agent's edit and forces unnecessary computations.

Instead, update tracked buffer's version after each agent update report
to only react on one, `Agent`-authored, edit events.

Release Notes:

- N/A
2026-01-08 17:09:24 +00:00
..
src Do not react on already observed buffer edits' versions (#46308) 2026-01-08 17:09:24 +00:00
Cargo.toml Add agent metrics (#41991) 2025-11-07 10:07:57 +00:00
LICENSE-GPL Pull action_log into its own crate (#35959) 2025-08-10 21:57:55 +00:00