agent: Restore last used agent session on startup (#36401)

Release Notes:

- N/A
This commit is contained in:
Bennet Bo Fenner 2025-08-18 12:22:00 +02:00 committed by GitHub
parent 2eadd5a396
commit 5591fc810e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 60 additions and 35 deletions

View file

@ -622,7 +622,10 @@ impl Thread {
) -> Result<mpsc::UnboundedReceiver<Result<AgentResponseEvent>>> {
self.cancel();
let model = self.model.clone().context("No language model configured")?;
let model = self
.model()
.cloned()
.context("No language model configured")?;
let (events_tx, events_rx) = mpsc::unbounded::<Result<AgentResponseEvent>>();
let event_stream = AgentResponseEventStream(events_tx);
let message_ix = self.messages.len().saturating_sub(1);