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 23:00:13 +00:00
committed by GitHub
parent 3c430af31a
commit 5f7de2eb5d
+5 -3
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) {