@ferris1225/pi-subagents 4.3.30 → 4.3.32

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 CHANGED
@@ -8,88 +8,22 @@
8
8
 
9
9
  On-demand delegation for [pi](https://github.com/earendil-works/pi): a lightweight
10
10
  reader and an implementer, durable threads, and Git worktree isolation. Main
11
- uses a subagent when the work can run independently in parallel, the boundary
12
- is clear, and delegation will actually reduce cost or improve completion quality.
11
+ delegates whenever the work has independent parts or a bounded job can be briefed
12
+ self-contained — parallel phases usually beat a serialized main.
13
13
 
14
14
  ## What's new
15
15
 
16
- **4.3.30** — pi's own footer is back: the per-model cost footer is removed, so
17
- pi's built-in consumption line shows unchanged. On a fresh install pi-subagents
18
- announces `/subagents-setup` and asks whether to configure now; the wizard then
19
- asks each role's model and immediately its thinking level.
20
-
21
- **4.3.29** — the retired `steward` and `sentinel` roles lose their leftover
22
- routing rules: a custom file with either name is now an ordinary custom role.
23
-
24
- **4.3.28** — a child's final answer is delivered whole even when it spans
25
- several text blocks, child stderr is kept to a bounded tail with one-line error
26
- toasts, and model handoffs keep a multi-line objective intact. Streaming
27
- activity no longer re-renders the widget per token, and the durable manifest is
28
- no longer rewritten on every child turn.
29
-
30
- **4.3.26** — scout is search-only, completions stop double-delivering, and
31
- progress no longer routes through files. Scout's role is now exactly code and
32
- documentation search plus web lookup; it has no shell, and work that needs
33
- execution stays in main. A result that exceeds the inline limit is no longer
34
- dumped truncated into the completion: none of it is inlined, and the notice
35
- points at the full Markdown artifact, so the content enters the main context
36
- exactly once. `subagent_status` answers progress with an activity trail
37
- (what each run has been doing) instead of child session paths, and the
38
- advisory `subagent_risk` tool is gone. Development dependencies track Pi 1.3.0.
39
-
40
- **4.3.24** — the per-model cost footer drops the live `tok/s` throughput
41
- figure: measured rates could not be trusted across providers, so the footer
42
- sticks to what pi reports exactly — per-model token flow, cost, context share,
43
- and thinking level.
44
-
45
- **4.3.23** — Pi 1.0.3. Development dependencies track that release. A stored
46
- agent model that still names `azure-openai-responses/<id>` keeps working: it
47
- follows the live catalog, and is saved as `azure/<id>` once that is the id Pi
48
- reports.
49
-
50
- **4.3.22** — use a subagent when the work can run independently in parallel, its
51
- boundary is clear, and delegation will actually reduce cost or improve
52
- completion quality. Role choice stays with scout and artisan.
53
-
54
- **4.3.21** — two built-in roles. `scout` is the lightweight read-only researcher
55
- and `artisan` implements one substantial change. Steward and sentinel are no
56
- longer shipped. Role prompts follow the GPT-6 Astra guidance: the brief wins,
57
- authorized work runs through, and checks stay proportional. Main prefers scout
58
- and artisan when a fresh context or a parallel phase helps, and does not open
59
- extra phases to fill free slots.
60
-
61
- **4.3.20** — Pi 1.0 prompt sections and tool exposure. The delegation contract
62
- is a `<subagents>` section, and live leases are a separate `<subagent_leases>`
63
- section, so an unchanged turn keeps the cached system prefix. Orchestration
64
- tools stay declared to the model and cannot be called from codemode scripts.
65
- Dispatch and stop run sequentially so one assistant message cannot race
66
- admission. Child processes still force provider `maxRetries: 0`, using the
67
- 1.0 registration that requires an `api`.
68
-
69
- **4.3.19** — session-start restore and recovery notices stay inside the current
70
- project. A second pi window no longer surfaces another checkout's retained
71
- worktree or restores (and would otherwise stop) that project's interrupted runs.
72
-
73
- **4.3.18** — main-first delegation: keep known-context local changes in main,
74
- use cleanup and review roles only where they add value, and configure process
75
- capacity with `maxConcurrentAgents`. See [Evaluate delegation](#evaluate-delegation)
76
- to compare quality, elapsed time, and complete task cost on your own workload.
77
-
78
- **4.3.15** — fix the cost footer crash after `/reload`, `/new`, `/resume`, or
79
- `/fork`: each footer now reads only its own session's live context, never an
80
- event context retained from the previous session.
81
-
82
- **4.3.13** — the footer is reserved for the per-model cost tally: the
83
- `subagents N running` activity-count line is gone, leaving the widget,
84
- completion notifications, and `subagent_status` for live progress.
85
-
86
- **4.3.12** — per-model accounting: the main window's consumption line becomes a
87
- per-model cost footer (token flow, cost, context share, and live `tok/s` per
88
- `provider/model`), awaited children's usage is no longer folded into the parent
89
- session total, and parallel completion totals are grouped per model instead of
90
- summed across them.
91
-
92
- See [CHANGELOG.md](./CHANGELOG.md).
16
+ **4.3.32** — codemode-aware, tool-agnostic role policy and a minimal config.
17
+ `scout` keeps every active tool the host proves read-only and can never keep a
18
+ tool that reaches other tools, such as `codemode`, while `artisan` inherits the
19
+ session's live surface, codemode included, so a code-mode host works unchanged.
20
+ The two roles ship as code, are always enabled, and custom `agent.md` discovery
21
+ is gone; `/subagents-setup` now only picks a model and thinking level per role,
22
+ and the config file keeps just `agentModels` and `agentThinkingLevels`. The
23
+ delegation contract defaults to delegating independent or self-contained work.
24
+
25
+ See [CHANGELOG.md](./CHANGELOG.md) for earlier releases; every published version
26
+ is preserved as a GitHub Release.
93
27
 
94
28
  ## Contents
95
29
 
@@ -103,10 +37,8 @@ See [CHANGELOG.md](./CHANGELOG.md).
103
37
  - [Models, thinking, and tools](#models-thinking-and-tools)
104
38
  - [Configuration](#configuration)
105
39
  - [Evaluate delegation](#evaluate-delegation)
106
- - [Custom agents](#custom-agents)
107
40
  - [Storage and cleanup](#storage-and-cleanup)
108
41
  - [Development](#development)
109
- - [Changelog](#changelog)
110
42
  - [Release](#release)
111
43
 
112
44
  ## Why
@@ -116,9 +48,11 @@ at "spawn a child with a prompt" and leave the hard parts — when to delegate,
116
48
  wide to fan out, what happens when a model dies, how results come
117
49
  back — with you. This extension owns them:
118
50
 
119
- - Main uses a subagent when the work can run independently in parallel, its
120
- boundary is clear, and delegation will actually reduce cost or improve
121
- completion quality. `scout` covers read-only code, documentation, and web
51
+ - Main delegates whenever the work has independent parts or a bounded job can be
52
+ briefed self-contained — parallel phases usually beat a serialized main, and
53
+ broad or unfamiliar lookups go to a child instead of the same searches run
54
+ serially.
55
+ `scout` covers read-only code, documentation, and web
122
56
  lookup only — it has no shell, so work that needs execution stays in main;
123
57
  `artisan` covers one substantial change. A small edit already understood in
124
58
  the current context stays in main, and a free process slot is not a reason
@@ -150,14 +84,11 @@ pi install npm:@ferris1225/pi-subagents
150
84
 
151
85
  Pi's extension list shows `@ferris1225/pi-subagents` without an internal source-path suffix.
152
86
 
153
- Open pi and run `/subagents-setup`. The original menu flow lets you enable or
154
- disable roles, configure one role's model and thinking level, or run the full setup
155
- again. Each screen uses the usual arrow-key/Enter/Esc navigation, and model lists
156
- remain searchable. A fresh install announces the command at session start and
157
- offers to open the wizard right away; the full setup asks each enabled role's
158
- model, then its thinking level. Fresh installs select both roles. A newly shipped
159
- built-in is surfaced once without being re-enabled after you deliberately turn it
160
- off. Then ask for work:
87
+ A fresh install writes a default config at session start — both roles enabled,
88
+ both following the main model — and announces `/subagents-setup` once; the file
89
+ itself is the marker, so later sessions stay silent. Run `/subagents-setup` to
90
+ pick a model and thinking level per role — that is the entire configuration
91
+ surface. Then ask for work:
161
92
 
162
93
  ```text
163
94
  Map how authentication works, fix the refresh race, and run the tests.
@@ -179,9 +110,8 @@ tests, docs, and local cleanup, and reports a disproved premise or a scope/appro
179
110
  blocker with evidence. Handoffs lead with the outcome and report checks as
180
111
  `command → result`.
181
112
 
182
- Custom roles join them with a Markdown file (see [Custom agents](#custom-agents)).
183
- Enabled roles form the available catalog. Two enabled roles do not require two
184
- children on every task.
113
+ The catalog is fixed: `scout` and `artisan` are always enabled, and there are no
114
+ custom role files. Two roles do not require two children on every task.
185
115
 
186
116
  Every child is a leaf pi process with its own context window and no memory of your
187
117
  conversation. It still loads normal Pi context, including applicable project
@@ -193,9 +123,7 @@ material assumptions or blockers.
193
123
 
194
124
  Children run the official `pi --mode rpc` server, using Pi's exported command/response
195
125
  types and its own session persistence. There is no separate subagent protocol. The
196
- host transport remains local. Pi's `RpcClient` still spawns its own `node`
197
- process, signals only that process, and does not provide process-tree shutdown,
198
- bounded abort coordination, or cancellation of child extension dialogs.
126
+ host transport remains local.
199
127
 
200
128
  ## Dispatching work
201
129
 
@@ -230,24 +158,18 @@ subagent({
230
158
  });
231
159
  ```
232
160
 
233
- Main uses a subagent when the work can run independently in parallel, its
234
- boundary is clear, and delegation will actually reduce cost or improve
235
- completion quality. It puts those independent phases in one `tasks` array and
236
- keeps a small, already-understood edit itself. A free process slot is not a
237
- reason to invent another phase. The runtime paces
238
- execution: `maxConcurrentAgents: 0` (the default) keeps automatic capacity at half
239
- the machine's cores, bounded to 4–6 child processes. Set `maxConcurrentAgents` to
240
- 1–6 for an explicit capacity. Wider batches queue and start as slots free.
241
- This setting limits simultaneous processes, not total tasks or total token cost.
161
+ Independent phases go in one `tasks` array. The runtime paces execution at half
162
+ the machine's cores, bounded to 4–6 simultaneous child processes; wider batches
163
+ queue and start as slots free. The limit paces processes, not total tasks or
164
+ total token cost.
242
165
 
243
166
  A run leases its stable, single-line `phaseId` in the resolved working directory.
244
167
  Rewording the task with the same `phaseId` is rejected and names the existing run.
245
168
  Completed and failed phases stay owned for the current session, even without a retained
246
169
  session file. Calls that omit `phaseId` keep exact normalized task+cwd matching; equal
247
- task text with different phase ids is
248
- still rejected by that fallback. Matching is deterministic, never fuzzy, embedding-based,
249
- or inferred from natural language. Active leases win over matching settled threads when
250
- the runtime chooses which owner to report.
170
+ task text with different phase ids is still rejected by that fallback. Matching is
171
+ deterministic, never fuzzy, embedding-based, or inferred from natural language. Active
172
+ leases win over matching settled threads when the runtime chooses which owner to report.
251
173
 
252
174
  Because queueing is pacing rather than refusal, it is always reported as such.
253
175
  Dispatch confirmations name each waiting run's real reason — waiting for a free
@@ -265,11 +187,10 @@ only when the phases are independent. Never overlap writers or duplicate an owne
265
187
  phase, and do not split one tightly coupled change across children.
266
188
 
267
189
  Verification follows the change and required project gates. Tests should catch
268
- meaningful failures, not mirror reversible, low-impact edits; there is no blanket
269
- requirement to mutate code or demonstrate a red/green cycle for every test. Fix
270
- failures caused by the change, then repeat or broaden checks only for new edits,
271
- failures, or unresolved concerns. Main owns architecture, the integrated diff,
272
- the final gate, and release; children never bump versions, commit, push, or publish.
190
+ meaningful failures, not mirror reversible, low-impact edits. Fix failures caused
191
+ by the change, then repeat or broaden checks only for new edits, failures, or
192
+ unresolved concerns. Main owns architecture, the integrated diff, the final gate,
193
+ and release; children never bump versions, commit, push, or publish.
273
194
 
274
195
  These defaults follow [OpenAI's GPT-6 Astra model guidance](https://developers.openai.com/api/docs/guides/latest-model?model=gpt-6-astra)
275
196
  and [Eric Provencher's skills and prompts guidance](https://x.com/pvncher/status/2095991462416490862).
@@ -299,8 +220,8 @@ launch receipt say `independence not verified`; that means the contract lacked e
299
220
  metadata, not that overlap was proved safe. Single calls never make a batch-independence
300
221
  claim. The existing shared-checkout writer lane remains the final serialization boundary.
301
222
 
302
- - Single tasks use your checkout. Parallel write-capable agents (`artisan` and
303
- custom writers) default to a detached Git worktree, so parallel writers run at
223
+ - Single tasks use your checkout. Parallel write-capable agents (`artisan`)
224
+ default to a detached Git worktree, so parallel writers run at
304
225
  the same time. Worktree mode needs a committed `HEAD`. Read-only roles such as
305
226
  scout stay on the shared checkout, and an explicit `isolation: worktree` for a
306
227
  read-only role is rejected.
@@ -309,9 +230,6 @@ claim. The existing shared-checkout writer lane remains the final serialization
309
230
  Child tools, network access, and environment access retain the Pi process's privileges.
310
231
  Third-party Pi packages execute as trusted code and must be reviewed accordingly.
311
232
 
312
- - A role file can pin its own default with `isolation: worktree` or
313
- `isolation: shared` in the frontmatter. Precedence is an explicit per-dispatch
314
- `isolation`, then the role's declaration, then the parallel write default.
315
233
  - An isolated run's tracked, deleted, untracked, and binary changes integrate
316
234
  back exactly once, after the child settles. Nothing is staged and your index is
317
235
  untouched.
@@ -352,20 +270,19 @@ child to finish. The model-facing answer is the progress view: state, elapsed ti
352
270
  and an activity trail of what the run has been doing (for example
353
271
  `activity: read src/config.ts · grep "cacheKey" · thinking`), plus failure
354
272
  diagnostics and any actionable paths (a truncated run's full-result file, retained
355
- worktree/patch artifacts). Child session directories are not dangled in front of
356
- the model; they stay in the structured details. States
357
- distinguish `queued`, `running`, `interrupting`, `settling` (Git finalization),
358
- `completed`, `failed`, `stopped`, and `interrupted` (recovered unfinished work).
359
- Queued runs report their actual wait reason. Settled runs remain queryable in the
360
- current parent session even after their transient widget rows disappear.
361
-
362
- The tool returns these facts in Pi's existing structured `details.runs` field.
363
- An individual run's failure does not make a successful status lookup a tool error;
364
- an unknown `id` does. This is runtime-authored data, not a requirement for children
365
- to generate strict JSON. Agent-written reports remain evidence to verify.
273
+ worktree/patch artifacts). States distinguish `queued`, `running`, `interrupting`,
274
+ `settling` (Git finalization), `completed`, `failed`, `stopped`, and `interrupted`
275
+ (recovered unfinished work). Queued runs report their actual wait reason. Settled
276
+ runs remain queryable in the current parent session even after their transient
277
+ widget rows disappear.
278
+
279
+ The tool returns these facts in Pi's structured `details.runs` field. An individual
280
+ run's failure does not make a successful status lookup a tool error; an unknown `id`
281
+ does. This is runtime-authored data, not a requirement for children to generate
282
+ strict JSON. Agent-written reports remain evidence to verify.
366
283
 
367
284
  A background dispatch returns a launch receipt, then its completion arrives at
368
- the next safe parent boundary—after current tool calls and before the next model
285
+ the next safe parent boundary — after current tool calls and before the next model
369
286
  call. `wait: true` instead holds the dispatch until its new runs settle, which is
370
287
  useful for one-shot `pi -p` sessions or an immediate dependency. Each run has one
371
288
  delivery route; aborting the waiting parent turn transfers delivery to the
@@ -380,26 +297,23 @@ manual recovery after reload or crash. Missing session files no longer discard
380
297
  isolated edits. Restore for this checkout runs at session start; lookup tools,
381
298
  prompt injection, and fresh dispatch wait for that pass so an existing id cannot
382
299
  be reported missing or reused. A sibling window in another project leaves those
383
- records untouched. Missing recorded worktrees surface as failures without discarding the
384
- remaining recovery evidence.
300
+ records untouched. Missing recorded worktrees surface as failures without
301
+ discarding the remaining recovery evidence.
385
302
 
386
- Canonical managed-path and repository validation remains in place. Invalid records
387
- are dropped without following or deleting their targets. Recovery-owned worktrees
388
- and patches stay protected from startup sweeps and project-root retention.
389
- Completed/failed runs drop their durable thread record; after reload, inspect their
390
- delivered result instead of expecting them in the current-session status list.
303
+ Invalid durable records are dropped without following or deleting their targets.
304
+ Recovery-owned worktrees and patches stay protected from startup sweeps and
305
+ project-root retention. Completed/failed runs drop their durable thread record;
306
+ after reload, inspect their delivered result instead of expecting them in the
307
+ current-session status list.
391
308
 
392
309
  ## Live status and results
393
310
 
394
311
  The TUI widget renders one line per active run in fixed identity columns —
395
- status icon, right-aligned `#id`, padded agent name, then the task label — so
396
- every label starts at the same column, with the live activity dimmed after
397
- `↳` on its own line and the rest of the telemetry flowing inline after ` · `: the
398
- worktree badge, wait state, token flow in pi's footer vocabulary (`↑` input, `↓`
399
- output, `R`/`W` cache read/write), cost, full `provider/model`, current effective
400
- `think:<level>`, and seconds-precision elapsed. A live run renders
401
- two lines: what it is — agent, task, usage, model, thinking, elapsed —
402
- and, dim under the label column, what it is doing right now:
312
+ status icon, right-aligned `#id`, padded agent name, then the task label — with
313
+ the live activity dimmed after `↳` on its own line and the rest of the telemetry
314
+ inline after ` · `: the worktree badge, wait state, token flow in pi's footer
315
+ vocabulary (`↑` input, `↓` output, `R`/`W` cache read/write), cost, full
316
+ `provider/model`, current effective `think:<level>`, and seconds-precision elapsed:
403
317
 
404
318
  ```text
405
319
  ● #12 artisan src/cache.ts · worktree:a91f3c · ↑5.2k ↓41.0k R210.0k W6.1k $1.9400 · think:high · 12m06s
@@ -414,18 +328,16 @@ Telemetry drops leftmost-first when a row runs out of width (badge, wait state,
414
328
  usage, model, thinking) while elapsed survives every width. Queued rows state
415
329
  what they actually wait for — `queued` for a free process slot, `repo lane`
416
330
  for shared-checkout write serialization, or `starting`. The widget is
417
- capped at ten lines: when many runs are live, extra runs collapse into a
418
- `… +N more` marker so the editor keeps its space.
331
+ capped at ten lines: extra runs collapse into a `… +N more` marker.
419
332
 
420
333
  Completions resume the main agent on their own, with a compact block of at most 40
421
334
  lines by default. Longer output (or lines wider than 200 characters) is not inlined
422
- at all: the notice states the true size — `137 lines`, or a 200-character clip when
423
- a short result has a long line — and points at the unchanged Markdown artifact
335
+ at all: the notice states the true size and points at the unchanged Markdown artifact
424
336
  holding the full output, and main is told to read that file. The content therefore
425
337
  enters the main context exactly once, never first as a truncated copy the model
426
- cannot trust and then again as the file read. Roles write result-only handoffs — outcome, paths,
427
- verification, unresolved blockers — and the main agent is told to add its
428
- conclusion rather than restate what you already read. A failed run adds its
338
+ cannot trust and then again as the file read. Roles write result-only handoffs —
339
+ outcome, paths, verification, unresolved blockers — and the main agent is told to
340
+ add its conclusion rather than restate what you already read. A failed run adds its
429
341
  failed-tool diagnostics.
430
342
 
431
343
  Delivery is held while a context compaction is in flight and released once it
@@ -433,11 +345,9 @@ settles — on failure and abort too — so a result a child spent minutes produ
433
345
  is never swallowed by the summary that replaces the history.
434
346
 
435
347
  A `wait: true` dispatch streams its progress onto the tool card while it waits.
436
- Usage is no longer attached to the tool result: pi folds tool-result usage into
437
- one session total, which merged every model's spend into the main window's
438
- consumption line. Instead, each child reports its usage per run — with its full
439
- `provider/model` ref — when it settles, and a parallel group's totals
440
- are grouped per model, never summed across them:
348
+ Each child reports its usage per run — with its full `provider/model` ref — when it
349
+ settles, and a parallel group's totals are grouped per model, never summed across
350
+ them:
441
351
 
442
352
  ```text
443
353
  Totals: 3 runs · zhipu/glm-4.7: ↓300 $0.0500 · anthropic/claude-sonnet-4: ↓4.0k $1.5000
@@ -455,29 +365,34 @@ session** continues on the main model, so finished searches, reads, and edits
455
365
  survive. Ordinary task failures do not trigger a handoff.
456
366
 
457
367
  Thinking is a **role default** — scout `low`, artisan `high` — clamped to what
458
- the effective model supports. Custom roles default to `medium`. `/subagents-setup` →
459
- _Configure an agent_ lists only the levels that model supports and marks the role
368
+ the effective model supports. The `/subagents-setup` thinking picker lists only
369
+ the levels that model supports and marks the role
460
370
  default; selecting it clears the stored override. There is no
461
- Auto choice, no per-dispatch `thinking` flag, and
462
- no `thinking` field in agent Markdown. Precedence: your setup override > the
371
+ Auto choice and no per-dispatch `thinking` flag. Precedence: your setup override > the
463
372
  role default, then the model clamp. There is no separate vision mode — assign
464
373
  a multimodal model and name the image paths in the task.
465
374
 
466
- Every dispatch, startup retry, and model fallback snapshots the parent's active tools,
467
- and all `subagent*` tools are removed so children remain leaves. A role without
468
- an explicit list inherits that snapshot; an explicit list is a strict
469
- intersection, so active extension tools are available only when named. A declared
470
- shell slot follows the parent's active shell on non-scout roles.
471
-
472
- `scout` is a hard read-only boundary even when a project override omits or
473
- overstates its tool list. Its known-safe set includes `read`, `grep`, `find`,
474
- `ls`, `anchor_grep`, the web-retrieval pairs `web_search`/`fetch_content` and
475
- `anysearch`/`anysearch_extract`; tools not installed or
476
- active in Main are simply omitted. Scout
477
- receives no shell, local mutation tool, or unknown custom tool. Unknown tools
478
- declared by other roles are conservatively treated as write-capable when
479
- isolation is chosen. An empty resolved snapshot starts the child with
480
- `--no-tools`.
375
+ Every dispatch, startup retry, and model fallback snapshots the parent's live
376
+ tools, and all `subagent*` tools are removed so children remain leaves. A broad
377
+ role inherits that snapshot — including `codemode` when the session runs it — so
378
+ a code-mode parent produces code-mode children under the same `codemode.mode`.
379
+ An explicit resolved list that names no MCP tool also excludes MCP tools it does
380
+ not name.
381
+
382
+ Neither role names extension, MCP, or vendor tools. `scout` is a hard
383
+ read-only boundary that is derived from the live catalog: it keeps every active
384
+ tool the host proves read-only — `annotations.readOnlyHint` for extension and
385
+ MCP tools, plus pi's own `read`, `grep`, `find`, and `ls` — and never a shell, a
386
+ mutation tool, or a tool that reaches other tools, so `codemode` and
387
+ `tool_search` cannot reach a writer through it. A retrieval extension or an MCP
388
+ search server therefore works for scout without being named anywhere, and without
389
+ reconfiguring the server: a read-only tool the session reaches only through
390
+ `codemode` or `tool_search` — pi's default for MCP servers — is handed to scout
391
+ directly, which is the same capability without giving scout a way to reach a
392
+ writer. Every other MCP tool stays excluded from that child. Tools with no
393
+ read-only annotation, whether they are declared by another role or by an active
394
+ extension, are conservatively treated as write-capable when isolation is chosen.
395
+ An empty resolved snapshot starts the child with `--no-tools`.
481
396
 
482
397
  For external research scout prefers official documentation, specifications, release
483
398
  notes, and first-party repositories; it fetches decisive pages rather than citing
@@ -485,60 +400,37 @@ search snippets, records material dates/versions, and marks uncertainty.
485
400
 
486
401
  ## Configuration
487
402
 
488
- `/subagents-setup` opens the original settings menu: enable or disable roles,
489
- configure one enabled role's model and thinking level, or walk through a full
490
- re-setup. A full re-setup asks each role's model and then its thinking level, in
491
- that order. `Esc` moves back through the menu stack, and model lists support fuzzy
492
- search. The enable menu discovers built-ins and actual custom role files in the configured
493
- scope, including roles never configured before. Project files require Pi's project trust.
494
- Config-only names are not role definitions and never appear in the enable or configure
495
- picker. Saving an enable selection or full setup discards unavailable role names and their
496
- model/thinking settings; no retired-name aliases or configuration migration are applied.
497
- To start over, remove `pi-subagents.json` and run `/subagents-setup` again. Other settings live in
498
- `~/.pi/agent/pi-subagents.json` (following `PI_CODING_AGENT_DIR`):
403
+ `scout` and `artisan` are always enabled; the only settings are a model and a
404
+ thinking level per role. `/subagents-setup` opens a menu with one row per role —
405
+ its summary, current model, and current thinking level — plus a "Both roles"
406
+ walk that asks each role's model and then its thinking level. `Esc` moves back,
407
+ and the model picker supports fuzzy search. To start over, delete
408
+ `~/.pi/agent/pi-subagents.json` and run `/subagents-setup`; the next session
409
+ writes the defaults again. Settings live in `~/.pi/agent/pi-subagents.json`
410
+ (following `PI_CODING_AGENT_DIR`):
499
411
 
500
412
  ```json
501
413
  {
502
- "enabledAgents": ["scout", "artisan"],
503
- "knownAgents": ["scout", "artisan"],
504
414
  "agentModels": { "scout": "anthropic/claude-haiku-4-5" },
505
- "agentThinkingLevels": { "artisan": "high" },
506
- "maxResultLines": 40,
507
- "maxConcurrentAgents": 0,
508
- "agentScope": "user",
509
- "idleTimeoutSec": 1800
415
+ "agentThinkingLevels": { "artisan": "high" }
510
416
  }
511
417
  ```
512
418
 
513
419
  | Field | Meaning |
514
420
  | --------------------- | ------- |
515
- | `enabledAgents` | Agents available for discovery and delegation. `[]` disables all. |
516
- | `knownAgents` | Catalog shown by setup; tracks built-in adoption, but cannot define a custom role without a file. |
517
- | `agentModels` | Optional model per agent; missing means the current main model. |
518
- | `agentThinkingLevels` | Optional setup override per agent; missing means the role default. |
519
- | `maxResultLines` | Lines kept in a completion message before the artifact takes over. Default `40`. |
520
- | `maxConcurrentAgents` | Simultaneous child-process limit: `0` keeps automatic capacity (4–6); `1`–`6` sets an explicit capacity. Default `0`. |
521
- | `agentScope` | Discover `user`, `project`, or `both` agent directories. Default `user`. |
522
- | `idleTimeoutSec` | Seconds without child RPC output before termination; `0` disables. Default `1800`. |
523
-
524
- Concurrency changes apply at the next `subagent` dispatch. Lowering the limit
525
- lets active children finish before queued work acquires the reduced pool;
526
- increasing it releases queued work in its existing order. Set it back to `0`
527
- to restore automatic capacity. Setup preserves this setting when reconfiguring
528
- roles or models; edit it in the JSON configuration file.
529
-
530
- When at least one role is enabled, the delegation directive is installed as a
531
- `<subagents>` prompt section. Active leases go in `<subagent_leases>`. Pi 1.0
532
- appends a section delta only when that text changes, so idle turns keep the
533
- cached system prefix. Hosts without a section map still receive the same
534
- contract appended to the system prompt. `enabledAgents` is authoritative after
535
- catalog adoption: a newly shipped built-in is appended once, then `knownAgents`
536
- records that it was surfaced
537
- so a deliberate later disable remains disabled. Role names left in an older
538
- config do nothing unless a file still defines them; saving setup drops names
539
- that have no file. Available custom roles remain
540
- selectable even when disabled. Invalid known fields fall back safely, and unknown fields
541
- are dropped when canonical config is persisted.
421
+ | `agentModels` | Optional model per role as `provider/model-id`; missing means the current main model. |
422
+ | `agentThinkingLevels` | Optional thinking override per role; missing means the role default (`scout` low, `artisan` high). |
423
+
424
+ Everything else is a fixed constant: result deliveries keep 40 lines before the
425
+ on-disk artifact takes over, process capacity is automatic, and a child silent
426
+ for 30 minutes is terminated. Obsolete keys left by older config files are
427
+ dropped when the canonical shape is persisted, and invalid values fall back to
428
+ defaults.
429
+
430
+ The delegation directive is installed as a `<subagents>` prompt section. Active
431
+ leases go in `<subagent_leases>`. Pi 1.0 appends a section delta only when that
432
+ text changes, so idle turns keep the cached system prefix. Hosts without a
433
+ section map still receive the same contract appended to the system prompt.
542
434
 
543
435
  At session start, model overrides that pi no longer reports are removed with a
544
436
  one-time notice. If pi's own session compaction fails mid-thread, a notice surfaces
@@ -556,19 +448,17 @@ facts, but its tests do not establish a quality or cost advantage over solo Pi.
556
448
  Keep task prompts, models, thinking levels, tools, and project instructions
557
449
  fixed. Keep results from earlier attempts out of later prompts; alternate
558
450
  execution order and repeat each comparison several times.
559
- 3. Compare main alone (`enabledAgents: []`, with `knownAgents` retaining the
560
- current built-in catalog) against the same enabled-role catalog with
561
- `maxConcurrentAgents` set to `1`, `2`, and `4`. These are concurrency limits:
562
- a pool of one can still launch several children sequentially. Record actual
563
- child counts and roles as well, and do not require filling the pool.
451
+ 3. Compare a session where main delegates freely against one where you instruct
452
+ it to work solo (or uninstall the extension). Record actual child counts and
453
+ roles as well — a delegation-prone main may still finish some tasks alone.
564
454
  4. Measure final acceptance and regressions, elapsed time through integration,
565
455
  and rework. Record main plus every child's token usage and cost, retaining
566
456
  model identities and including failed attempts, review, integration, and
567
457
  retries. A child's successful exit or quick first patch is not final success.
568
458
  5. Compare quality under matched total-cost budgets and matched wall-clock
569
- limits as separate experiments. Include failed or unfinished runs. The
570
- concurrency setting is not a spending cap, and `idleTimeoutSec` only detects
571
- a silent child; enforce experiment-wide budgets in your evaluation process.
459
+ limits as separate experiments. Include failed or unfinished runs. The idle
460
+ timeout only detects a silent child; enforce experiment-wide budgets in your
461
+ evaluation process.
572
462
 
573
463
  The [BOAD coding study](https://arxiv.org/html/2512.23631v2) found a useful small
574
464
  expert set but declining results when adding more roles; its role-count result
@@ -577,31 +467,6 @@ does not prescribe a concurrency limit. A broader
577
467
  also found that coordination outcomes depend on the task and single-agent
578
468
  baseline. These motivate measuring your own workflow, not a universal team size.
579
469
 
580
- ## Custom agents
581
-
582
- Built-ins ship with the package. Add or replace them with Markdown files:
583
-
584
- - User agents: `~/.pi/agent/agents/`
585
- - Project agents: the nearest `.pi/agents/` in a trusted project
586
- - Precedence: project > user > built-in, where the same `name` wins
587
-
588
- ```yaml
589
- ---
590
- name: scout
591
- description: Fast read-only codebase reconnaissance
592
- isolation: shared
593
- tools: read, grep, find, ls
594
- ---
595
- …additional system prompt…
596
- ```
597
-
598
- `description` is the routing line the main model reads. `isolation` pins the
599
- role's default boundary as described under [Parallel edits](#parallel-edits).
600
- Models come only from `/subagents-setup`; an agent file cannot pin one. An
601
- explicit `tools` list is intersected with the parent's active set; omitting it
602
- inherits the active set. A role named `scout` is always reduced to the fixed
603
- read-only tool set described above.
604
-
605
470
  ## Storage and cleanup
606
471
 
607
472
  Everything lives under your pi agent directory, grouped per project. Nothing
@@ -636,14 +501,13 @@ npm run check
636
501
  `npm run check` is `tsc --noEmit` plus the unit tests (`npm test`). There are
637
502
  no bundled runtime dependencies; pi and TypeBox are peers. The source is
638
503
  grouped by responsibility under `src/`: configuration, delegation, execution, isolation,
639
- lifecycle, and presentation. Thread restoration, shared lifecycle coordination, RPC control,
640
- and Git command execution live in focused modules rather than oversized catch-all files.
641
-
642
- The test runner uses Node 22 or 24; Node 26 removed `--experimental-transform-types`.
643
- Pi 1.0 declares `@earendil-works/pi-server`. This project still lists that package
644
- as a peer and a development dependency so `npm run check` typechecks against the
645
- same SDK the tests import. It is not bundled into the extension, and no
646
- replacement RPC server is introduced.
504
+ lifecycle, and presentation.
505
+
506
+ `npm test` runs the TypeScript sources on Node's built-in type stripping from
507
+ Node 22.19 up, including Node 26, which removed `--experimental-transform-types`;
508
+ the source therefore avoids parameter properties and other transform-only
509
+ syntax. Pi and TypeBox are peers, and the extension imports only pi's public SDK
510
+ surface, so nothing is bundled.
647
511
 
648
512
  ## Changelog
649
513