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

Method send_answer

src/crates/execution/agent-runtime/src/user_questions.rs:63–78  ·  view source on GitHub ↗
(&self, tool_id: &str, answers: Value)

Source from the content-addressed store, hash-verified

61 }
62
63 pub fn send_answer(&self, tool_id: &str, answers: Value) -> Result<(), String> {
64 info!("Sending user answer: tool_id={}", tool_id);
65
66 if let Some((_, sender)) = self.channels.remove(tool_id) {
67 let response = UserInputResponse { answers };
68 sender
69 .send(response)
70 .map_err(|_| format!("Channel closed, cannot send answer: {}", tool_id))?;
71 debug!("Answer sent: tool_id={}", tool_id);
72 Ok(())
73 } else {
74 let error_msg = format!("Waiting channel not found: {}", tool_id);
75 warn!("{}", error_msg);
76 Err(error_msg)
77 }
78 }
79
80 pub fn cancel(&self, tool_id: &str) -> bool {
81 if self.channels.remove(tool_id).is_some() {

Calls 2

removeMethod · 0.45
sendMethod · 0.45

Tested by

no test coverage detected