assistant2: Clear all collections when clearing the ThreadStore (#22743)

This PR adds some missing calls to clear the sub-collections in the
`ThreadStore` when we call `ThreadStore::drain` or `ThreadStore::clear`.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2025-01-06 18:00:13 -05:00 committed by GitHub
parent 3c430af31a
commit 5f7de2eb5d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -37,15 +37,17 @@ impl ContextStore {
}
pub fn drain(&mut self) -> Vec<Context> {
self.files.clear();
self.directories.clear();
self.context.drain(..).collect()
let context = self.context.drain(..).collect();
self.clear();
context
}
pub fn clear(&mut self) {
self.context.clear();
self.files.clear();
self.directories.clear();
self.threads.clear();
self.fetched_urls.clear();
}
pub fn insert_file(&mut self, buffer: &Buffer) {