MCPcopy Index your code
hub / github.com/AI45Lab/Code / execute_with_notification

Method execute_with_notification

core/src/session_lane_queue.rs:151–180  ·  view source on GitHub ↗

Execute internally with external notification (Hybrid mode)

(&self)

Source from the content-addressed store, hash-verified

149
150 /// Execute internally with external notification (Hybrid mode)
151 async fn execute_with_notification(&self) -> LaneResult<Value> {
152 let task = ExternalTask {
153 task_id: self.task_id.clone(),
154 session_id: self.session_id.clone(),
155 lane: self.lane,
156 command_type: self.inner.command_type().to_string(),
157 payload: self.inner.payload(),
158 timeout_ms: self.timeout_ms,
159 created_at: Some(Instant::now()),
160 };
161 let _ = self.event_tx.send(AgentEvent::ExternalTaskPending {
162 task_id: task.task_id.clone(),
163 session_id: task.session_id.clone(),
164 lane: task.lane,
165 command_type: task.command_type.clone(),
166 payload: task.payload.clone(),
167 timeout_ms: task.timeout_ms,
168 });
169 let result = self
170 .inner
171 .execute()
172 .await
173 .map_err(|e| LaneError::CommandError(e.to_string()));
174 let _ = self.event_tx.send(AgentEvent::ExternalTaskCompleted {
175 task_id: self.task_id.clone(),
176 session_id: self.session_id.clone(),
177 success: result.is_ok(),
178 });
179 result
180 }
181}
182
183#[async_trait]

Callers 1

executeMethod · 0.80

Calls 6

nowFunction · 0.85
cloneMethod · 0.45
command_typeMethod · 0.45
payloadMethod · 0.45
sendMethod · 0.45
executeMethod · 0.45

Tested by

no test coverage detected