Reuse canonical chat context
This commit is contained in:
@@ -83,6 +83,7 @@ pub(crate) struct App {
|
||||
pub(super) composer: String,
|
||||
pub(super) queued_inputs: VecDeque<String>,
|
||||
pub(super) conversation: Vec<ChatMessage>,
|
||||
active_turn: Option<generation::TurnSummary>,
|
||||
pub(super) a2ui: crate::a2ui::Store,
|
||||
pub(super) a2ui_history: Vec<crate::a2ui::Store>,
|
||||
pub(super) a2ui_history_index: Option<usize>,
|
||||
@@ -406,6 +407,7 @@ impl App {
|
||||
composer: String::new(),
|
||||
queued_inputs: VecDeque::new(),
|
||||
conversation: Vec::new(),
|
||||
active_turn: None,
|
||||
a2ui: crate::a2ui::Store::default(),
|
||||
a2ui_history: Vec::new(),
|
||||
a2ui_history_index: None,
|
||||
@@ -533,6 +535,7 @@ impl App {
|
||||
composer: String::new(),
|
||||
queued_inputs: VecDeque::new(),
|
||||
conversation: Vec::new(),
|
||||
active_turn: None,
|
||||
a2ui: crate::a2ui::Store::default(),
|
||||
a2ui_history: Vec::new(),
|
||||
a2ui_history_index: None,
|
||||
@@ -1479,6 +1482,7 @@ impl App {
|
||||
match loaded {
|
||||
Ok((messages, a2ui)) => {
|
||||
self.conversation = messages.into_iter().map(ChatMessage::from).collect();
|
||||
generation::promote_legacy_turn_summaries(&mut self.conversation);
|
||||
self.context_notice = None;
|
||||
self.clear_a2ui();
|
||||
let (history, active, errors) =
|
||||
@@ -2292,6 +2296,7 @@ mod tests {
|
||||
reasoning_complete: false,
|
||||
reasoning_open: true,
|
||||
content: String::new(),
|
||||
model_content: None,
|
||||
markdown: markdown::Content::new(),
|
||||
transcript: text_editor::Content::new(),
|
||||
a2ui_lines_processed: 0,
|
||||
@@ -2322,6 +2327,7 @@ mod tests {
|
||||
reasoning_complete: true,
|
||||
reasoning_open: false,
|
||||
content: content.into(),
|
||||
model_content: None,
|
||||
markdown: markdown::Content::new(),
|
||||
transcript: text_editor::Content::new(),
|
||||
a2ui_lines_processed: 0,
|
||||
|
||||
Reference in New Issue
Block a user