Skip to content

Loading search…

中文

agents

Hand parts of the task to sub-agents that work at the same time, each in a workspace of its own, and wait for their results.

  • Layer: base (optional: only where a configuration enables it)
  • Needs: –
  • Requires: –
  • Conflicts with: –
  • Never dropped: no
  • Mixin: skills.agents:Agents
  • Manifest: skills/agents/skill.toml
def delegate(task, workspace='new', budget=None, model=None, agent=None, multi_turn=False)

Start a sub-agent on task (what it is to do and what to report back); returns its id. workspace: “new” (a workspace of its own, of this one’s kind), “browser”, “desktop”, “apps” or “display” (a new one of that kind), or “share” (it takes over the windows this agent holds now and hands them back when its turn ends). budget: {“calls”, “cost”, “seconds”}, taken from this agent’s own (default: all that is left). model: another model of the same provider. agent: another harness’s agent (“claude-code”, “codex”) that does the task in its own bounded directory. multi_turn=True keeps a supported external agent available for send_agent within the original budget; cancel it when done.

def wait_agents(ids=None, timeout=None)

Wait until the turn of each sub-agent in ids (default: all this agent started) is over, at most timeout seconds; returns {id: {“status”, “result”, “model_calls”, “cost_usd”, “seconds”, “directory”, “files”}}, or None when the user paused this agent first.

def send_agent(agent, text)

Send sub-agent agent a message (more to do, or the answer to what it asked). One whose turn was over goes on with what it has, and the end of that turn reaches this agent as the end of its first did.

def cancel_agent(agent)

Stop sub-agent agent (and those it started); returns its report.

From the workspace prompt pack, with the core skills enabled:

delegate(task, workspace="new", budget=None, model=None, agent=None) start one; its
id. task: what to do and report, on its own (it does
not see your conversation). workspace "new" (your
kind) or an available workspace kind. budget {"calls",
"cost", "seconds"}. agent selects an installed agent
adapter; omit it to use this Harness.
wait_agents(ids=None, timeout=None) until each ends or asks: {id: {"status", "result",
"question", "model_calls", "cost_usd", "seconds",
"directory", "files"}}
send_agent(id, text) answer one, or give it more to do
cancel_agent(id) stop one; returns its report