File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
crates/chat-cli/src/cli/chat Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff 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 }
Original file line number Diff line number Diff 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 {
You can’t perform that action at this time.
0 commit comments