acp: Have AcpThread handle all interrupting (#36417)

The view was cancelling the generation, but `AcpThread` already handles
that, so we removed that extra code and fixed a bug where an update from
the first user message would appear after the second one.

Release Notes:

- N/A

Co-authored-by: Danilo <danilo@zed.dev>
This commit is contained in:
Agus Zubiaga 2025-08-18 12:34:27 -03:00 committed by GitHub
parent 9b78c46902
commit 48fed866e6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 164 additions and 20 deletions

View file

@ -1200,17 +1200,21 @@ impl AcpThread {
} else {
None
};
self.push_entry(
AgentThreadEntry::UserMessage(UserMessage {
id: message_id.clone(),
content: block,
chunks: message,
checkpoint: None,
}),
cx,
);
self.run_turn(cx, async move |this, cx| {
this.update(cx, |this, cx| {
this.push_entry(
AgentThreadEntry::UserMessage(UserMessage {
id: message_id.clone(),
content: block,
chunks: message,
checkpoint: None,
}),
cx,
);
})
.ok();
let old_checkpoint = git_store
.update(cx, |git, cx| git.checkpoint(cx))?
.await