feat: builtin agent delegate tool — spawn external agents for coding tasks #430

Open
opened 2026-05-23 09:51:11 +00:00 by xingyue · 0 comments
Owner

Background

The builtin agent has basic tools (read_file, write_file, run_command) but lacks the ability to delegate complex coding tasks to specialized agents like Cursor or Claude Code.

Proposal

Add a delegate tool to the builtin agent that spawns an agent CLI, sends it a prompt, and returns the result.

Tool Interface

name: delegate
parameters:
  agent: string       # "cursor-agent" | "claude" command name
  prompt: string      # task description  
  cwd: string | null  # working directory

Behavior

  1. Spawn the agent CLI as subprocess (e.g. cursor-agent -p <prompt> --trust --force)
  2. Capture stdout as result
  3. Return output text + git diff --stat so LLM knows what changed

Why CLI first, not ACP?

Direct CLI invocation works with cursor-agent and claude CLI immediately. ACP can be a follow-up.

Related

  • workflow-agent-hermes/src/acp-client.ts — ACP reference
  • Builtin toolkit: packages/workflow-agent-builtin/src/tools/
## Background The builtin agent has basic tools (read_file, write_file, run_command) but lacks the ability to delegate complex coding tasks to specialized agents like Cursor or Claude Code. ## Proposal Add a `delegate` tool to the builtin agent that spawns an agent CLI, sends it a prompt, and returns the result. ### Tool Interface ``` name: delegate parameters: agent: string # "cursor-agent" | "claude" command name prompt: string # task description cwd: string | null # working directory ``` ### Behavior 1. Spawn the agent CLI as subprocess (e.g. `cursor-agent -p <prompt> --trust --force`) 2. Capture stdout as result 3. Return output text + `git diff --stat` so LLM knows what changed ### Why CLI first, not ACP? Direct CLI invocation works with cursor-agent and claude CLI immediately. ACP can be a follow-up. ## Related - `workflow-agent-hermes/src/acp-client.ts` — ACP reference - Builtin toolkit: `packages/workflow-agent-builtin/src/tools/`
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: uncaged/workflow#430