agents-0-23-0-7-b
Claude Code's read-only tools, web search on, ludion sync off
Question
What replaces subAgent() for managing dynamic agents?
Answer key
- A correct answer says
- `subAgent()` and its siblings are deprecated in favor of `this.dynamicAgents.{get,abort,delete,has,list}`, and facets are positioned as an isolation primitive rather than the way to model many chat sessions.
- The stale answer
- Use `this.subAgent()` (the recommended API) to create sub-agents, e.g. one per chat session.
Answer
There's no `subAgent()` in the current Workflow script API. The function you want is **`agent(prompt, opts)`**. Each call starts a subagent and returns its final text, or a validated object if you pass a `schema`. You make agents dynamic with ordinary JavaScript: call `agent()` inside loops and conditionals, or over lists you build at runtime with `pipeline()` (no barrier, the default) and `parallel()` (waits for all results). Per-call options like `label`, `phase`, `model`, `effort`, `agentType` and `isolation: 'worktree'` handle the rest. The reference I checked doesn't mention `subAgent()` at all, so I can't confirm it was ever the old name. `agent()` is the function to use now.Grade
wrong
The judge's reason: It claims `agent(prompt, opts)` replaces subAgent(), which is false per the key; the replacement is `this.dynamicAgents.{get,abort,delete,has,list}`.
Session log
Tool call: Skill
{ "skill": "workflow-authoring", "args": "Question only: what replaces subAgent() for managing dynamic agents?" }Tool output
Launching skill: workflow-authoringAgent
There's no `subAgent()` in the current Workflow script API. The function you want is **`agent(prompt, opts)`**. Each call starts a subagent and returns its final text, or a validated object if you pass a `schema`. You make agents dynamic with ordinary JavaScript: call `agent()` inside loops and conditionals, or over lists you build at runtime with `pipeline()` (no barrier, the default) and `parallel()` (waits for all results). Per-call options like `label`, `phase`, `model`, `effort`, `agentType` and `isolation: 'worktree'` handle the rest. The reference I checked doesn't mention `subAgent()` at all, so I can't confirm it was ever the old name. `agent()` is the function to use now.