feat: renamed subagent handoff flow to use yield instead of submit_result

- Renamed subagent completion flow from `submit_result` to `yield` across SDK tools, prompts, and docs.
- Updated executor/task handling to require and parse `yield` calls, replacing legacy submit-result extraction and state flags.
- Added `subagent-yield-reminder` and updated system prompts to require `yield` with `result.data` or `result.error`.
- Renamed hidden-tool and registration plumbing to `yield`, including discovery helpers and renderer/test surface.
This commit is contained in:
can1357
2026-04-26 00:29:52 +02:00
parent 6bd4cf24fd
commit ecd1554eba
30 changed files with 200 additions and 221 deletions
+3 -3
View File
@@ -228,12 +228,12 @@ Related APIs:
- Built-ins come from `createTools(...)` and `BUILTIN_TOOLS`.
- `toolNames` acts as an allowlist for built-ins.
- `customTools` and extension-registered tools are still included.
- Hidden tools (for example `submit_result`) are opt-in unless required by options.
- Hidden tools (for example `yield`) are opt-in unless required by options.
```ts
const { session } = await createAgentSession({
toolNames: ["read", "grep", "find", "write"],
requireSubmitResultTool: true,
requireYieldTool: true,
});
```
@@ -274,7 +274,7 @@ Use these when you want partial control without recreating internal discovery lo
For SDK consumers building orchestrators (similar to task executor flow):
- `outputSchema`: passes structured output expectation into tool context
- `requireSubmitResultTool`: forces `submit_result` tool inclusion
- `requireYieldTool`: forces `yield` tool inclusion
- `taskDepth`: recursion-depth context for nested task sessions
- `parentTaskPrefix`: artifact naming prefix for nested task outputs
+1 -1
View File
@@ -31,7 +31,7 @@ Task agents normalize into `AgentDefinition` (`src/task/types.ts`):
Parsing comes from frontmatter via `parseAgentFields()` (`src/discovery/helpers.ts`):
- missing `name` or `description` => invalid (`null`), caller treats as parse failure
- `tools` accepts CSV or array; if provided, `submit_result` is auto-added
- `tools` accepts CSV or array; if provided, `yield` is auto-added
- `spawns` accepts `*`, CSV, or array
- backward-compat behavior: if `spawns` missing but `tools` includes `task`, `spawns` becomes `*`
- `output` is passed through as opaque schema data