diff --git a/crates/chat-cli/src/cli/chat/conversation_state.rs b/crates/chat-cli/src/cli/chat/conversation_state.rs index 23d5fdb434..850eb3278e 100644 --- a/crates/chat-cli/src/cli/chat/conversation_state.rs +++ b/crates/chat-cli/src/cli/chat/conversation_state.rs @@ -514,8 +514,8 @@ impl ConversationState { .expect("unable to construct conversation state") } - pub async fn update_state(&mut self) { - let needs_update = self.tool_manager.has_new_stuff.load(Ordering::Acquire); + pub async fn update_state(&mut self, force_update: bool) { + let needs_update = self.tool_manager.has_new_stuff.load(Ordering::Acquire) || force_update; if !needs_update { return; } diff --git a/crates/chat-cli/src/cli/chat/mod.rs b/crates/chat-cli/src/cli/chat/mod.rs index 2fd1e5dbe7..44ee746696 100644 --- a/crates/chat-cli/src/cli/chat/mod.rs +++ b/crates/chat-cli/src/cli/chat/mod.rs @@ -572,7 +572,7 @@ impl ChatContext { cs.reload_serialized_state(Arc::clone(&ctx), Some(output.clone())).await; input = Some(input.unwrap_or("In a few words, summarize our conversation so far.".to_owned())); cs.tool_manager = tool_manager; - cs.enforce_tool_use_history_invariants(false); + cs.update_state(true).await; cs } else { ConversationState::new( @@ -816,7 +816,7 @@ impl ChatContext { debug!(?chat_state, "changing to state"); // Update conversation state with new tool information - self.conversation_state.update_state().await; + self.conversation_state.update_state(false).await; let result = match chat_state { ChatState::PromptUser {