lens: attribute in-run file changes to the agent, not External; RunEnd event
This commit is contained in:
1 parent
c6c4add124
commit
ed9a9184d0
5 files changed
+50
-8
No files matched your search
@@ -417,6 +417,10 @@ impl Agent {
|
||||
/// An abort ends this run only; the next `run` starts un-aborted.
|
||||
pub async fn run(&mut self, prompt: impl Into<String>) -> Result<Message, Error> {
|
||||
let r = self.run_inner(prompt.into()).await;
|
||||
self.emit(Event::RunEnd {
|
||||
aborted: matches!(r, Err(Error::Aborted)),
|
||||
})
|
||||
.await;
|
||||
self.abort_tx
|
||||
.send_if_modified(|a| std::mem::replace(a, false));
|
||||
r
|
||||
|
||||
Reference in new issue
Block a user