Compare commits

...

4 Commits

Author SHA1 Message Date
Ahmed Ibrahim
2406972ecf lint 2025-07-10 15:53:02 -07:00
Ahmed Ibrahim
3e9955e41a name issue 2025-07-10 15:50:35 -07:00
Ahmed Ibrahim
7a75998708 name issue 2025-07-10 15:49:54 -07:00
Ahmed Ibrahim
6555aa881d delete history 2025-07-10 15:48:01 -07:00
3 changed files with 18 additions and 0 deletions

View File

@@ -782,6 +782,16 @@ async fn submission_loop(
}
});
}
Op::ClearHistory => {
if let Some(sess) = sess.as_ref() {
let mut state = sess.state.lock().unwrap();
if let Some(transcript) = state.zdr_transcript.as_mut() {
transcript.clear();
}
state.previous_response_id = None;
}
}
}
}
debug!("Agent loop exited");

View File

@@ -22,6 +22,11 @@ impl ConversationHistory {
self.items.clone()
}
/// clears the conversation history.
pub(crate) fn clear(&mut self) {
self.items.clear();
}
/// `items` is ordered from oldest to newest.
pub(crate) fn record_items<I>(&mut self, items: I)
where

View File

@@ -108,6 +108,9 @@ pub enum Op {
/// Request a single history entry identified by `log_id` + `offset`.
GetHistoryEntryRequest { offset: usize, log_id: u64 },
/// Clear the message history.
ClearHistory,
}
/// Determines the conditions under which the user is consulted to approve