@narumitw/pi-subagents 0.25.0 → 0.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +91 -51
- package/package.json +1 -1
- package/src/agents.ts +3 -0
- package/src/config-ui.ts +566 -205
- package/src/in-process-transport.ts +15 -10
- package/src/persistence.ts +4 -1
- package/src/registry.ts +33 -15
- package/src/settings.ts +113 -0
- package/src/stateful.ts +401 -106
- package/src/subagents.ts +18 -18
- package/src/subprocess-transport.ts +10 -9
package/README.md
CHANGED
|
@@ -4,22 +4,22 @@
|
|
|
4
4
|
|
|
5
5
|
`@narumitw/pi-subagents` is a native [Pi coding agent](https://pi.dev) extension for delegating work to specialized agents. The batch `subagent` tool keeps isolated Pi subprocesses, while addressable lifecycle tools can run reusable agents either as subprocess-backed logical sessions or as public-SDK in-process child sessions.
|
|
6
6
|
|
|
7
|
-
Use it to split independent research, planning, implementation, and review work across focused workers.
|
|
7
|
+
Use it to split independent research, planning, implementation, and review work across focused workers. Under the default next-turn delivery policy, background delegation is for work the current response does not depend on. Opt-in auto-resume also supports final-answer-dependent background work by requesting a synthesis turn after completion.
|
|
8
8
|
|
|
9
9
|
## ✨ Features
|
|
10
10
|
|
|
11
11
|
- Registers a `subagent` tool for single-agent, parallel, fan-in, and chained delegation.
|
|
12
12
|
- Keeps batch workers isolated in `pi --mode json -p --no-session` subprocesses.
|
|
13
|
-
- Registers detached stateful lifecycle tools by default;
|
|
13
|
+
- Registers detached stateful lifecycle tools by default; completion can stay queued for the next turn or opt into an idle root synthesis turn.
|
|
14
14
|
- Supports an opt-in public-SDK `in-process` stateful transport with one reusable child `AgentSession` per `agentId`.
|
|
15
15
|
- Supports built-in `scout`, `planner`, `reviewer`, and `worker` agents.
|
|
16
16
|
- Loads custom user agents from `~/.pi/agent/agents/*.md`.
|
|
17
17
|
- Optionally loads project agents from `.pi/agents/*.md` with confirmation.
|
|
18
|
-
- Provides `/subagents
|
|
19
|
-
- Supports per-task `cwd`, hard subprocess `timeoutMs`, `thinkingLevel`, abort propagation, and streaming progress.
|
|
18
|
+
- Provides a current-session-first `/subagents` manager, direct `settings|status|help` routes, and compatibility aliases for agent tools and retained agents.
|
|
19
|
+
- Supports per-task `cwd`, hard subprocess `timeoutMs`, task-selected `thinkingLevel`, abort propagation, and streaming progress.
|
|
20
20
|
- Bounds JSON lines, captured messages, stderr, final output, chain substitution, and fan-in context.
|
|
21
21
|
- Enforces a recursion-depth guard and deterministic process-group termination.
|
|
22
|
-
- Provides addressable stateful agents with follow-up,
|
|
22
|
+
- Provides addressable stateful agents with follow-up, mailbox, list, interrupt, close, context selection, and persistence.
|
|
23
23
|
- Publishes transient runtime status through Pi's generic extension status API while subagents are running.
|
|
24
24
|
- Returns complete bounded worker output in tool details and a concise result for the main agent.
|
|
25
25
|
|
|
@@ -43,17 +43,19 @@ pi -e ./extensions/pi-subagents
|
|
|
43
43
|
|
|
44
44
|
## 🛠️ Pi tool
|
|
45
45
|
|
|
46
|
-
`pi-subagents` registers
|
|
46
|
+
`pi-subagents` always registers the primary batch tool and registers the stateful lifecycle tools unless `stateful.enabled` is `false`:
|
|
47
47
|
|
|
48
|
-
- `subagent` — delegate blocking single, parallel, fan-in, or chained batch work.
|
|
49
|
-
- `subagent_spawn` and related lifecycle tools — start reusable detached work, return immediately, and receive bounded completion messages automatically.
|
|
48
|
+
- `subagent` — delegate blocking single, parallel, fan-in, or chained batch work. The main agent cannot process queued steering until the call returns.
|
|
49
|
+
- `subagent_spawn` and related lifecycle tools — when enabled, start reusable detached work, return immediately, and receive bounded completion messages automatically.
|
|
50
50
|
|
|
51
51
|
Choose the API by lifecycle:
|
|
52
52
|
|
|
53
53
|
| Need | Use |
|
|
54
54
|
| --- | --- |
|
|
55
|
-
|
|
|
56
|
-
|
|
|
55
|
+
| A delegated result is required before the root's next action under default next-turn delivery | One blocking `subagent` call (`tasks` for synchronous parallel work) |
|
|
56
|
+
| Broad research/review the current response does not depend on | Prefer one `subagent_spawn` covering related branches, when lifecycle tools are enabled |
|
|
57
|
+
| Final-answer-dependent broad work with `completionDelivery: "auto-resume"` | Prefer one `subagent_spawn`; completion requests a synthesis turn |
|
|
58
|
+
| Reusable history, follow-ups, or mailboxes | `subagent_spawn` and lifecycle tools, when enabled |
|
|
57
59
|
| One simple or critical-path action the root can perform directly | No subagent |
|
|
58
60
|
|
|
59
61
|
Execution modes:
|
|
@@ -67,31 +69,35 @@ Common controls:
|
|
|
67
69
|
|
|
68
70
|
- `cwd` — run a job from a different working directory.
|
|
69
71
|
- `timeoutMs` — set a hard subprocess timeout.
|
|
70
|
-
- `thinkingLevel` — request `off`, `minimal`, `low`, `medium`, `high`, `xhigh`, or `max` thinking for the spawned Pi process.
|
|
72
|
+
- `thinkingLevel` — request `off`, `minimal`, `low`, `medium`, `high`, `xhigh`, or `max` thinking for the spawned Pi process or in-process child.
|
|
73
|
+
|
|
74
|
+
For `subagent_spawn`, the root agent selects the lowest thinking level sufficient for the delegated task. This is a tool-argument decision made from the task already in context; `pi-subagents` does not run a string heuristic or an extra classifier model call.
|
|
71
75
|
|
|
72
76
|
## 🧭 Proactive use
|
|
73
77
|
|
|
74
|
-
The `subagent` tool advertises
|
|
75
|
-
|
|
78
|
+
The always-available `subagent` tool advertises only blocking guidance. When stateful lifecycle tools
|
|
79
|
+
are registered, `subagent_spawn` adds detached guidance for the active completion-delivery policy.
|
|
80
|
+
Changing the policy through `/subagents settings` refreshes that guidance immediately.
|
|
76
81
|
|
|
77
82
|
Count-selection guidance:
|
|
78
83
|
|
|
79
84
|
- Use **no subagent** for simple answers, quick targeted edits, latency-sensitive one-step work, or
|
|
80
|
-
|
|
81
|
-
-
|
|
82
|
-
|
|
83
|
-
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
85
|
+
critical-path work the main agent can perform directly.
|
|
86
|
+
- `subagent` is deliberately blocking: while it runs, the main agent cannot answer queued steering.
|
|
87
|
+
Use it when delegated outputs are required before the next root action and waiting is intentional.
|
|
88
|
+
- With default `completionDelivery: "next-turn"`, prefer **one detached `subagent_spawn`** for broad
|
|
89
|
+
research or review only when the current response does not depend on its result. Keep
|
|
90
|
+
final-answer-dependent delegated work on the blocking path because an idle root is not awakened.
|
|
91
|
+
- With `completionDelivery: "auto-resume"`, prefer one detached `subagent_spawn` for broad related
|
|
92
|
+
research or review even when the final answer depends on it; completion requests a later synthesis
|
|
93
|
+
turn. Do not choose blocking parallel fan-out merely to keep delegation in one turn.
|
|
94
|
+
- Use detached `subagent_spawn` only when lifecycle tools are enabled and a bounded independent task
|
|
95
|
+
has a concrete isolation or specialization benefit. After spawning, do useful non-overlapping work
|
|
96
|
+
immediately. Do not poll lifecycle tools for progress or duplicate the delegated work.
|
|
97
|
+
- Add another detached agent only for truly independent work with safe workspace concurrency. If
|
|
98
|
+
synchronous parallel or fan-in output is genuinely required, keep blocking `subagent` tasks
|
|
99
|
+
independent, stay within the hard max of 8, and do not parallelize implementation that may edit
|
|
100
|
+
the same files or shared state.
|
|
95
101
|
- Do not use project-local agents unless the user explicitly opts into them with
|
|
96
102
|
`agentScope: "project"` or `"both"`; keep confirmation enabled for untrusted repositories.
|
|
97
103
|
|
|
@@ -103,16 +109,17 @@ No subagent for a known-file edit:
|
|
|
103
109
|
Rename one symbol in src/foo.ts.
|
|
104
110
|
```
|
|
105
111
|
|
|
106
|
-
One
|
|
112
|
+
One detached agent for a broad asynchronous review that the current response does not require, or when auto-resume is enabled (call `subagent_spawn`):
|
|
107
113
|
|
|
108
114
|
```json
|
|
109
115
|
{
|
|
110
116
|
"agent": "reviewer",
|
|
111
|
-
"task": "Review
|
|
117
|
+
"task": "Review source, tests, and integration risks for the current changes. Do not edit files. Report PASS/FAIL/PARTIAL with evidence."
|
|
112
118
|
}
|
|
113
119
|
```
|
|
114
120
|
|
|
115
|
-
|
|
121
|
+
A blocking fan-out is reserved for output that must be synthesized before the root continues (call
|
|
122
|
+
`subagent`):
|
|
116
123
|
|
|
117
124
|
```json
|
|
118
125
|
{
|
|
@@ -124,10 +131,6 @@ Two to four parallel subagents for broad independent reconnaissance:
|
|
|
124
131
|
{
|
|
125
132
|
"agent": "scout",
|
|
126
133
|
"task": "Research auth-related tests. Report coverage gaps. Do not edit files."
|
|
127
|
-
},
|
|
128
|
-
{
|
|
129
|
-
"agent": "scout",
|
|
130
|
-
"task": "Research API entry points that depend on auth. Report integration risks. Do not edit files."
|
|
131
134
|
}
|
|
132
135
|
],
|
|
133
136
|
"aggregator": {
|
|
@@ -137,7 +140,11 @@ Two to four parallel subagents for broad independent reconnaissance:
|
|
|
137
140
|
}
|
|
138
141
|
```
|
|
139
142
|
|
|
140
|
-
## 🚀
|
|
143
|
+
## 🚀 Blocking batch examples
|
|
144
|
+
|
|
145
|
+
Every example in this section calls `subagent` and keeps the main agent unavailable until the batch
|
|
146
|
+
finishes. Use `subagent_spawn` instead when the work can complete asynchronously and its configured
|
|
147
|
+
completion policy supports when synthesis is needed.
|
|
141
148
|
|
|
142
149
|
Run one read-only reconnaissance agent:
|
|
143
150
|
|
|
@@ -202,22 +209,30 @@ Run a chain where each step receives the previous output:
|
|
|
202
209
|
|
|
203
210
|
## 🔁 Stateful agents
|
|
204
211
|
|
|
205
|
-
Stateful lifecycle tools are available by default. `subagent_spawn` is detached: it schedules work, returns immediately with an opaque `agentId`, and later injects
|
|
212
|
+
Stateful lifecycle tools are available by default. `subagent_spawn` is detached: it schedules work, returns immediately with an opaque `agentId`, and later injects a bounded `pi-subagent-completion` custom message. Completions that settle in the same dispatch window are batched, and the broker allows at most one in-flight root wake until that parent turn starts.
|
|
213
|
+
|
|
214
|
+
Detached work follows a non-polling policy. With default `next-turn` delivery, prefer one bounded `subagent_spawn` for related asynchronous research or review only when the current response does not depend on its result; if it does, use blocking `subagent`. With opt-in `auto-resume`, detached broad work may be final-answer-dependent because completion requests a synthesis turn after the root settles. In either mode, do useful non-overlapping main-agent work immediately, do not poll `subagent_list` or `subagent_messages`, and do not duplicate delegated work. Add another detached agent only for truly independent work with safe workspace concurrency. Detached lifecycle work intentionally has no `subagent_wait` tool.
|
|
206
215
|
|
|
207
|
-
|
|
216
|
+
A detached agent additionally needs a concrete isolation or specialization benefit such as independent review, bounded context/output, a distinct model/tool profile, or workspace isolation. Simple work that the main agent can perform directly should not be delegated.
|
|
208
217
|
|
|
209
|
-
|
|
218
|
+
`stateful.completionDelivery` controls settled completion delivery:
|
|
210
219
|
|
|
211
|
-
|
|
220
|
+
- `"next-turn"` (default) preserves the previous behavior: use `deliverAs: "steer"` with `triggerTurn: false`. An active root can consume completion naturally; an idle root is not awakened.
|
|
221
|
+
- `"auto-resume"` holds completion while the root is active, then requests one synthesis turn after the parent settles when no user or extension messages are already pending. Simultaneous completions share that turn, active work is not interrupted, and pending input suppresses the autonomous wake.
|
|
222
|
+
|
|
223
|
+
Auto-resume is best-effort because Pi's custom-message API is fire-and-forget. Session-generation checks, shutdown cleanup, batching, and the in-flight wake guard prevent stale or duplicate scheduling pressure, but they do not make completion delivery durable across process exit.
|
|
212
224
|
|
|
213
225
|
The default `subprocess` transport preserves compatibility: each turn starts a fresh isolated `pi --mode json -p --no-session` child and receives sanitized, bounded history. Set `transport` to `in-process` to retain one public Pi SDK `AgentSession` per stateful `agentId`, avoiding repeated process startup while preserving native child history in memory.
|
|
214
226
|
|
|
215
|
-
|
|
227
|
+
Run `/subagents` in TUI mode to open the primary manager. It separates current-session lifecycle state, transport, completion delivery, and active/retained counts from user settings that persist across sessions. Its actions open completion settings, per-agent tool settings, current-session agent inspection/clear, status, and help. Escape returns from a nested screen to a newly refreshed manager and then closes it.
|
|
228
|
+
|
|
229
|
+
The direct routes remain predictable: `/subagents settings` changes user completion delivery and applies it immediately, including refreshing the model-facing spawn guidance; `/subagents status` reports current-session runtime values separately from the configured value, source, and path; `/subagents help` summarizes commands and compatibility routes. In RPC mode, bare `/subagents` emits the same bounded status through Pi's notification protocol instead of opening a custom TUI. JSON and print modes do not emit ad hoc command output. Manual edits use `~/.pi/agent/pi-subagents.json` and take effect after reloading Pi:
|
|
216
230
|
|
|
217
231
|
```json
|
|
218
232
|
{
|
|
219
233
|
"stateful": {
|
|
220
234
|
"transport": "in-process",
|
|
235
|
+
"completionDelivery": "auto-resume",
|
|
221
236
|
"maxAgents": 16,
|
|
222
237
|
"maxActiveTurns": 4,
|
|
223
238
|
"maxDepth": 3,
|
|
@@ -231,20 +246,31 @@ Configure the runtime in `~/.pi/agent/pi-subagents.json`, then reload Pi:
|
|
|
231
246
|
}
|
|
232
247
|
```
|
|
233
248
|
|
|
234
|
-
Set `"enabled": false` to remove all stateful lifecycle tools. Otherwise, the extension registers:
|
|
249
|
+
The settings UI patches the raw JSON atomically and preserves unknown fields; it refuses to overwrite malformed or invalid settings. Set `"enabled": false` to remove all stateful lifecycle tools. Otherwise, the extension registers:
|
|
235
250
|
|
|
236
251
|
| Tool | Purpose |
|
|
237
252
|
| --- | --- |
|
|
238
|
-
| `subagent_spawn` | Start detached work, return an opaque `agentId` immediately, and deliver completion asynchronously. |
|
|
253
|
+
| `subagent_spawn` | Start detached work with an optional task-selected thinking level, return an opaque `agentId` immediately, and deliver completion asynchronously. |
|
|
239
254
|
| `subagent_send` | Send follow-up work to a reusable agent; shared-workspace write conflicts are guarded unless explicitly overridden. |
|
|
240
255
|
| `subagent_message` | Queue a bounded mailbox message without starting a turn; sender IDs must be `root` or an agent in the same tree. |
|
|
241
256
|
| `subagent_messages` | Read and optionally acknowledge unread mailbox messages. |
|
|
242
|
-
| `subagent_wait` | Wait sparingly when the immediate next critical-path step is blocked on a result; timeout does not terminate the agent, and parent abort/user steering cancels only the wait. Already-terminal agents return immediately. |
|
|
243
257
|
| `subagent_list` | List retained agents and lifecycle states. |
|
|
244
258
|
| `subagent_interrupt` | Abort the current turn while retaining its identity and history. |
|
|
245
259
|
| `subagent_close` | Abort if necessary, close the agent, and remove it from retained persistence. |
|
|
246
260
|
|
|
247
|
-
Use `/subagents
|
|
261
|
+
Use the **Current-session agents** action in `/subagents` to inspect the indented agent tree, lifecycle state, unread count, and available actions, or to confirm clearing retained agents. `/subagents:agents list|clear` remains the compatibility command for the same current-session operations. Active turns are FIFO-limited by `maxActiveTurns`; excess retained work remains in `starting` state until a slot is available. `maxAgents` separately bounds running, queued, and idle records. `parentId` creates a bounded child relationship; subtree interrupt and close operate child-first.
|
|
262
|
+
|
|
263
|
+
A spawn can request a thinking level explicitly:
|
|
264
|
+
|
|
265
|
+
```json
|
|
266
|
+
{
|
|
267
|
+
"agent": "reviewer",
|
|
268
|
+
"task": "Analyze the cross-package concurrency failure and identify the safest fix",
|
|
269
|
+
"thinkingLevel": "high"
|
|
270
|
+
}
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
The requested level is stored with the stateful agent and remains in effect for all follow-ups and after persisted restore. `subagent_send` does not provide a per-turn thinking override; create a new agent when a later task needs a different level.
|
|
248
274
|
|
|
249
275
|
`subagent_spawn.context` accepts:
|
|
250
276
|
|
|
@@ -269,7 +295,7 @@ Stateful execution uses a transport boundary:
|
|
|
269
295
|
|
|
270
296
|
No private Pi imports, runtime casts, or `ExtensionAPI` monkey-patching are used. Approval policy, sandbox profile, provider-header hooks, extension state, global scheduling, and parent/child transcript switching are not inherited or provided by the in-process transport.
|
|
271
297
|
|
|
272
|
-
Write-capable agents share the workspace by default. Concurrent write-capable starts in the same cwd are rejected unless `allowConcurrentWrites` is explicitly set. Classification is intentionally conservative: an agent with `bash`, `write`, or `edit` is write-capable even when its task prompt says “read only,” because prompt wording is not a filesystem sandbox.
|
|
298
|
+
Write-capable agents share the workspace by default. Concurrent write-capable starts in the same cwd are rejected unless `allowConcurrentWrites` is explicitly set. Classification is intentionally conservative: an agent with `bash`, `write`, or `edit` is write-capable even when its task prompt says “read only,” because prompt wording is not a filesystem sandbox. Prefer one detached agent when asynchronous work can be combined. If concurrent work is genuinely required, use the blocking batch only when synchronous outputs justify making the root unavailable, explicitly accept safe detached overlap with `allowConcurrentWrites`, or use isolated worktrees when repository isolation is needed.
|
|
273
299
|
|
|
274
300
|
Set `workspaceMode: "worktree"` to opt into a disposable detached Git worktree; this requires a clean repository and the worktree is removed on close or session shutdown. Isolated worktree agents are intentionally not restored after shutdown.
|
|
275
301
|
|
|
@@ -284,7 +310,7 @@ Existing `subagent` requests remain unchanged:
|
|
|
284
310
|
| Parallel | Input order, with at most four active children. | Collects all task results; partial worker failure is reported in summaries but does not discard successful results. |
|
|
285
311
|
| Parallel + aggregator | Source input order, then aggregator. | The aggregator runs with both successful outputs and failure descriptions; aggregator failure marks the tool result as an error. |
|
|
286
312
|
|
|
287
|
-
Timeout precedence remains: task/step/aggregator → call → agent setting → `PI_SUBAGENT_TIMEOUT_MS` → 600000 ms.
|
|
313
|
+
Timeout precedence remains: task/step/aggregator → call → agent setting → `PI_SUBAGENT_TIMEOUT_MS` → 600000 ms. Blocking thinking precedence remains: task/step/aggregator → call → agent setting → child default. Stateful spawn thinking precedence is: `subagent_spawn.thinkingLevel` → agent setting → transport fallback. Project-agent resolution and confirmation behavior is unchanged.
|
|
288
314
|
|
|
289
315
|
## 🤖 Built-in agents
|
|
290
316
|
|
|
@@ -304,8 +330,7 @@ Built-in agents inherit the active/default Pi model instead of forcing a provide
|
|
|
304
330
|
|
|
305
331
|
## ⚙️ Configure agent tools
|
|
306
332
|
|
|
307
|
-
|
|
308
|
-
The command stores settings in `~/.pi/agent/pi-subagents.json`.
|
|
333
|
+
Open `/subagents` and choose **Agent tool settings** in an interactive Pi session to edit the tools each subagent may use. `/subagents:config` remains a documented compatibility route to the same screen. These are user settings stored in `~/.pi/agent/pi-subagents.json` and affect future sessions.
|
|
309
334
|
|
|
310
335
|
Compatibility: a valid legacy `pi-subagents-config.json` is migrated automatically to `pi-subagents.json`. If both files exist, the new filename takes precedence.
|
|
311
336
|
|
|
@@ -385,9 +410,24 @@ Each subprocess has a hard timeout to avoid runaway workers.
|
|
|
385
410
|
- Set `timeoutMs` on a task, chain step, or aggregator to override it locally.
|
|
386
411
|
- If omitted, the default is `PI_SUBAGENT_TIMEOUT_MS`, or `600000` milliseconds (10 minutes) when unset.
|
|
387
412
|
|
|
388
|
-
Set `thinkingLevel` to
|
|
413
|
+
Set `thinkingLevel` to request one of Pi's supported levels: `off`, `minimal`, `low`, `medium`, `high`, `xhigh`, or `max`. Blocking subprocess calls pass the resolved value through `--thinking <level>`.
|
|
414
|
+
|
|
415
|
+
For `subagent_spawn`, the root agent should choose the lowest sufficient level:
|
|
416
|
+
|
|
417
|
+
| Level | Appropriate delegated work |
|
|
418
|
+
| --- | --- |
|
|
419
|
+
| `off` / `minimal` | Extraction, formatting, or mechanical work requiring almost no reasoning. |
|
|
420
|
+
| `low` | Straightforward, bounded tasks with direct steps. |
|
|
421
|
+
| `medium` | Ordinary multi-step research or implementation. |
|
|
422
|
+
| `high` | Complex debugging, design, review, or cross-file analysis. |
|
|
423
|
+
| `xhigh` | Highly ambiguous, cross-system, or high-risk analysis. |
|
|
424
|
+
| `max` | Exceptional hardest tasks where quality clearly outweighs latency and cost. |
|
|
425
|
+
|
|
426
|
+
Blocking thinking precedence is: task/chain step/aggregator `thinkingLevel` → top-level `thinkingLevel` → agent default from config or frontmatter → Pi subprocess default.
|
|
427
|
+
|
|
428
|
+
Stateful spawn precedence is: `subagent_spawn.thinkingLevel` → agent default from config or frontmatter → transport fallback. The subprocess transport then uses spawned Pi model/default resolution. The in-process transport uses a configured model thinking suffix and then the parent thinking snapshot captured when the child is created. An explicit spawn value is retained for the agent lifecycle and wins over all of those fallbacks.
|
|
389
429
|
|
|
390
|
-
|
|
430
|
+
Omit `thinkingLevel` to preserve existing behavior. Reported stateful details show the requested level, not a guarantee of the provider's effective value. Pi still owns model capability clamping; `pi-subagents` does not duplicate capability detection.
|
|
391
431
|
|
|
392
432
|
On timeout, the extension sends process-group `SIGTERM`, escalates to `SIGKILL` after a five-second grace period if the process has not actually closed, and returns partial bounded messages or stderr collected so far. Parent abort uses the same cleanup path and preserves a structured result.
|
|
393
433
|
|
package/package.json
CHANGED
package/src/agents.ts
CHANGED
|
@@ -47,9 +47,12 @@ export interface SubagentAgentConfig {
|
|
|
47
47
|
|
|
48
48
|
export type SubagentTransportKind = "subprocess" | "in-process";
|
|
49
49
|
|
|
50
|
+
export type CompletionDelivery = "next-turn" | "auto-resume";
|
|
51
|
+
|
|
50
52
|
export interface SubagentRuntimeSettings {
|
|
51
53
|
enabled?: boolean;
|
|
52
54
|
transport?: SubagentTransportKind;
|
|
55
|
+
completionDelivery?: CompletionDelivery;
|
|
53
56
|
maxAgents?: number;
|
|
54
57
|
maxActiveTurns?: number;
|
|
55
58
|
maxDepth?: number;
|