Skip to content

Commit 63219e6

Browse files
committed
force updates conversation state on restart
1 parent 0f5a0cd commit 63219e6

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

crates/chat-cli/src/cli/chat/conversation_state.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -514,8 +514,8 @@ impl ConversationState {
514514
.expect("unable to construct conversation state")
515515
}
516516

517-
pub async fn update_state(&mut self) {
518-
let needs_update = self.tool_manager.has_new_stuff.load(Ordering::Acquire);
517+
pub async fn update_state(&mut self, force_update: bool) {
518+
let needs_update = self.tool_manager.has_new_stuff.load(Ordering::Acquire) || force_update;
519519
if !needs_update {
520520
return;
521521
}

crates/chat-cli/src/cli/chat/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -572,6 +572,7 @@ impl ChatContext {
572572
cs.reload_serialized_state(Arc::clone(&ctx), Some(output.clone())).await;
573573
input = Some(input.unwrap_or("In a few words, summarize our conversation so far.".to_owned()));
574574
cs.tool_manager = tool_manager;
575+
cs.update_state(true).await;
575576
cs.enforce_tool_use_history_invariants(false);
576577
cs
577578
} else {
@@ -816,7 +817,7 @@ impl ChatContext {
816817
debug!(?chat_state, "changing to state");
817818

818819
// Update conversation state with new tool information
819-
self.conversation_state.update_state().await;
820+
self.conversation_state.update_state(false).await;
820821

821822
let result = match chat_state {
822823
ChatState::PromptUser {

0 commit comments

Comments
 (0)