MCPcopy Create free account
hub / github.com/GCWing/BitFun / handle_turn_cancelled

Method handle_turn_cancelled

src/apps/cli/src/chat_state.rs:823–841  ·  view source on GitHub ↗

Handle dialog turn cancellation

(&mut self)

Source from the content-addressed store, hash-verified

821
822 /// Handle dialog turn cancellation
823 pub fn handle_turn_cancelled(&mut self) {
824 if let Some(last_msg) = self.messages.last_mut() {
825 if last_msg.role == MessageRole::Assistant {
826 last_msg.is_streaming = false;
827 last_msg.flow_items.push(FlowItem::Text {
828 content: "[Cancelled]".to_string(),
829 is_streaming: false,
830 });
831 last_msg.version += 1;
832 }
833 }
834
835 self.current_turn_id = None;
836 self.current_flow_items.clear();
837 self.tool_index.clear();
838 self.is_processing = false;
839 self.permission_prompt = None;
840 self.question_prompt = None;
841 }
842
843 /// Handle token usage update
844 pub fn handle_token_usage(&mut self, total_tokens: usize) {

Callers 1

runMethod · 0.45

Calls 2

pushMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected