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

Method handle_turn_failed

src/apps/cli/src/chat_state.rs:801–820  ·  view source on GitHub ↗

Handle dialog turn failure

(&mut self, error: &str)

Source from the content-addressed store, hash-verified

799
800 /// Handle dialog turn failure
801 pub fn handle_turn_failed(&mut self, error: &str) {
802 // Add error to the last assistant message
803 if let Some(last_msg) = self.messages.last_mut() {
804 if last_msg.role == MessageRole::Assistant {
805 last_msg.is_streaming = false;
806 last_msg.flow_items.push(FlowItem::Text {
807 content: format!("[Error: {}]", error),
808 is_streaming: false,
809 });
810 last_msg.version += 1;
811 }
812 }
813
814 self.current_turn_id = None;
815 self.current_flow_items.clear();
816 self.tool_index.clear();
817 self.is_processing = false;
818 self.permission_prompt = None;
819 self.question_prompt = None;
820 }
821
822 /// Handle dialog turn cancellation
823 pub fn handle_turn_cancelled(&mut self) {

Callers 1

runMethod · 0.45

Calls 2

pushMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected