MCPcopy Create free account
hub / github.com/AI45Lab/Code / register_task

Function register_task

core/src/tools/builtin/mod.rs:90–105  ·  view source on GitHub ↗

Register the task delegation tools (task, parallel_task). Must be called after the registry is wrapped in Arc. Requires an LLM client and the workspace path so child agent loops can be spawned inline. Optionally accepts an MCP manager so child sessions inherit MCP tools.

(
    registry: &Arc<ToolRegistry>,
    llm_client: Arc<dyn crate::llm::LlmClient>,
    agent_registry: Arc<crate::subagent::AgentRegistry>,
    workspace: String,
)

Source from the content-addressed store, hash-verified

88/// and the workspace path so child agent loops can be spawned inline.
89/// Optionally accepts an MCP manager so child sessions inherit MCP tools.
90pub fn register_task(
91 registry: &Arc<ToolRegistry>,
92 llm_client: Arc<dyn crate::llm::LlmClient>,
93 agent_registry: Arc<crate::subagent::AgentRegistry>,
94 workspace: String,
95) {
96 register_task_with_mcp(
97 registry,
98 llm_client,
99 agent_registry,
100 workspace,
101 None,
102 None,
103 None,
104 );
105}
106
107/// Register the task delegation tools with optional MCP manager and parent context.
108///

Calls 1

register_task_with_mcpFunction · 0.85