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

Method execute

core/src/tools/task.rs:269–278  ·  view source on GitHub ↗

Execute a task by spawning an isolated child AgentLoop. `parent_session_id` flows into the emitted `SubagentStart`/`SubagentEnd` events so dashboards can associate child runs with the parent session.

(
        &self,
        params: TaskParams,
        event_tx: Option<broadcast::Sender<AgentEvent>>,
        parent_session_id: Option<&str>,
    )

Source from the content-addressed store, hash-verified

267 /// `parent_session_id` flows into the emitted `SubagentStart`/`SubagentEnd`
268 /// events so dashboards can associate child runs with the parent session.
269 pub async fn execute(
270 &self,
271 params: TaskParams,
272 event_tx: Option<broadcast::Sender<AgentEvent>>,
273 parent_session_id: Option<&str>,
274 ) -> Result<TaskResult> {
275 let task_id = format!("task-{}", uuid::Uuid::new_v4());
276 self.execute_with_task_id(task_id, params, event_tx, parent_session_id, true)
277 .await
278 }
279
280 /// Execute a task using a caller-supplied task id. Used by `execute_background`
281 /// so the synchronously-returned task id matches the one in lifecycle events.

Calls 10

execute_with_task_idMethod · 0.80
contextMethod · 0.80
execute_parallelMethod · 0.80
allMethod · 0.80
cloneMethod · 0.45
execute_backgroundMethod · 0.45
with_metadataMethod · 0.45
is_emptyMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected