pi-subagents 0.74.0 → 0.75.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.
Files changed (157) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/docs/agents.md +15 -5
  3. package/docs/configuration.md +10 -0
  4. package/docs/extension-api.md +1 -1
  5. package/docs/missions.md +15 -1
  6. package/docs/models.md +6 -2
  7. package/docs/observability.md +8 -3
  8. package/docs/tool-reference.md +28 -3
  9. package/docs/workflows.md +2 -2
  10. package/package.json +1 -1
  11. package/src/agents/agents.d.ts +1 -0
  12. package/src/agents/agents.d.ts.map +1 -1
  13. package/src/agents/agents.js +65 -3
  14. package/src/agents/agents.js.map +1 -1
  15. package/src/api/preflight.d.ts +1 -1
  16. package/src/api/preflight.d.ts.map +1 -1
  17. package/src/api/preflight.js +44 -1
  18. package/src/api/preflight.js.map +1 -1
  19. package/src/extension/config.d.ts.map +1 -1
  20. package/src/extension/config.js +4 -1
  21. package/src/extension/config.js.map +1 -1
  22. package/src/extension/index.d.ts.map +1 -1
  23. package/src/extension/index.js +26 -19
  24. package/src/extension/index.js.map +1 -1
  25. package/src/extension/public-execution.d.ts.map +1 -1
  26. package/src/extension/public-execution.js +4 -0
  27. package/src/extension/public-execution.js.map +1 -1
  28. package/src/extension/reply-workflow-script.js +1 -1
  29. package/src/extension/reply-workflow-script.js.map +1 -1
  30. package/src/extension/rpc.js +1 -1
  31. package/src/extension/rpc.js.map +1 -1
  32. package/src/extension/schemas.d.ts +1 -0
  33. package/src/extension/schemas.d.ts.map +1 -1
  34. package/src/extension/schemas.js +5 -3
  35. package/src/extension/schemas.js.map +1 -1
  36. package/src/extension/tool-description.js +1 -1
  37. package/src/extension/tool-description.js.map +1 -1
  38. package/src/missions/goal-driver.d.ts +1 -0
  39. package/src/missions/goal-driver.d.ts.map +1 -1
  40. package/src/missions/goal-driver.js +49 -34
  41. package/src/missions/goal-driver.js.map +1 -1
  42. package/src/missions/store.d.ts.map +1 -1
  43. package/src/missions/store.js +11 -1
  44. package/src/missions/store.js.map +1 -1
  45. package/src/profiles/profiles.d.ts +1 -1
  46. package/src/profiles/profiles.d.ts.map +1 -1
  47. package/src/profiles/profiles.js +4 -0
  48. package/src/profiles/profiles.js.map +1 -1
  49. package/src/runs/background/async-execution.d.ts +13 -0
  50. package/src/runs/background/async-execution.d.ts.map +1 -1
  51. package/src/runs/background/async-execution.js +89 -6
  52. package/src/runs/background/async-execution.js.map +1 -1
  53. package/src/runs/background/async-job-tracker.d.ts +1 -0
  54. package/src/runs/background/async-job-tracker.d.ts.map +1 -1
  55. package/src/runs/background/async-job-tracker.js +2 -2
  56. package/src/runs/background/async-job-tracker.js.map +1 -1
  57. package/src/runs/background/await-async-run.d.ts.map +1 -1
  58. package/src/runs/background/await-async-run.js +4 -2
  59. package/src/runs/background/await-async-run.js.map +1 -1
  60. package/src/runs/background/control-channel.d.ts +10 -0
  61. package/src/runs/background/control-channel.d.ts.map +1 -1
  62. package/src/runs/background/control-channel.js +51 -0
  63. package/src/runs/background/control-channel.js.map +1 -1
  64. package/src/runs/background/run-child-session.d.ts.map +1 -1
  65. package/src/runs/background/run-child-session.js +20 -6
  66. package/src/runs/background/run-child-session.js.map +1 -1
  67. package/src/runs/background/runner-aliases.d.ts +1 -0
  68. package/src/runs/background/runner-aliases.d.ts.map +1 -1
  69. package/src/runs/background/runner-aliases.js +6 -2
  70. package/src/runs/background/runner-aliases.js.map +1 -1
  71. package/src/runs/background/scheduled-runs.d.ts +2 -1
  72. package/src/runs/background/scheduled-runs.d.ts.map +1 -1
  73. package/src/runs/background/scheduled-runs.js +28 -11
  74. package/src/runs/background/scheduled-runs.js.map +1 -1
  75. package/src/runs/background/stale-run-reconciler.d.ts +1 -1
  76. package/src/runs/background/stale-run-reconciler.d.ts.map +1 -1
  77. package/src/runs/background/stale-run-reconciler.js +15 -2
  78. package/src/runs/background/stale-run-reconciler.js.map +1 -1
  79. package/src/runs/background/subagent-runner.d.ts.map +1 -1
  80. package/src/runs/background/subagent-runner.js +44 -3
  81. package/src/runs/background/subagent-runner.js.map +1 -1
  82. package/src/runs/foreground/command-action.d.ts +13 -0
  83. package/src/runs/foreground/command-action.d.ts.map +1 -0
  84. package/src/runs/foreground/command-action.js +38 -0
  85. package/src/runs/foreground/command-action.js.map +1 -0
  86. package/src/runs/foreground/execution.d.ts.map +1 -1
  87. package/src/runs/foreground/execution.js +19 -5
  88. package/src/runs/foreground/execution.js.map +1 -1
  89. package/src/runs/foreground/subagent-executor.d.ts +1 -0
  90. package/src/runs/foreground/subagent-executor.d.ts.map +1 -1
  91. package/src/runs/foreground/subagent-executor.js +64 -11
  92. package/src/runs/foreground/subagent-executor.js.map +1 -1
  93. package/src/runs/shared/child-commands.d.ts +28 -0
  94. package/src/runs/shared/child-commands.d.ts.map +1 -0
  95. package/src/runs/shared/child-commands.js +250 -0
  96. package/src/runs/shared/child-commands.js.map +1 -0
  97. package/src/runs/shared/child-session.d.ts +4 -0
  98. package/src/runs/shared/child-session.d.ts.map +1 -1
  99. package/src/runs/shared/child-session.js +97 -20
  100. package/src/runs/shared/child-session.js.map +1 -1
  101. package/src/runs/shared/child-tool-plan.js +1 -1
  102. package/src/runs/shared/child-tool-plan.js.map +1 -1
  103. package/src/runs/shared/claude-code-adapter.d.ts +56 -0
  104. package/src/runs/shared/claude-code-adapter.d.ts.map +1 -1
  105. package/src/runs/shared/claude-code-adapter.js +138 -2
  106. package/src/runs/shared/claude-code-adapter.js.map +1 -1
  107. package/src/runs/shared/dynamic-fanout.js +1 -1
  108. package/src/runs/shared/dynamic-fanout.js.map +1 -1
  109. package/src/runs/shared/external-cli-preflight.d.ts +10 -0
  110. package/src/runs/shared/external-cli-preflight.d.ts.map +1 -1
  111. package/src/runs/shared/external-cli-preflight.js +50 -6
  112. package/src/runs/shared/external-cli-preflight.js.map +1 -1
  113. package/src/runs/shared/external-cli-runner.d.ts.map +1 -1
  114. package/src/runs/shared/external-cli-runner.js +4 -2
  115. package/src/runs/shared/external-cli-runner.js.map +1 -1
  116. package/src/runs/shared/mcp-direct-tool-allowlist.d.ts.map +1 -1
  117. package/src/runs/shared/mcp-direct-tool-allowlist.js +5 -4
  118. package/src/runs/shared/mcp-direct-tool-allowlist.js.map +1 -1
  119. package/src/runs/shared/model-resolution.d.ts +6 -2
  120. package/src/runs/shared/model-resolution.d.ts.map +1 -1
  121. package/src/runs/shared/model-resolution.js +9 -2
  122. package/src/runs/shared/model-resolution.js.map +1 -1
  123. package/src/runs/shared/parallel-utils.d.ts +2 -0
  124. package/src/runs/shared/parallel-utils.d.ts.map +1 -1
  125. package/src/runs/shared/parallel-utils.js.map +1 -1
  126. package/src/runs/shared/run-history.d.ts +47 -0
  127. package/src/runs/shared/run-history.d.ts.map +1 -1
  128. package/src/runs/shared/run-history.js +70 -0
  129. package/src/runs/shared/run-history.js.map +1 -1
  130. package/src/runs/shared/subagent-control.d.ts.map +1 -1
  131. package/src/runs/shared/subagent-control.js +30 -17
  132. package/src/runs/shared/subagent-control.js.map +1 -1
  133. package/src/runs/shared/subagent-prompt-runtime.d.ts +1 -0
  134. package/src/runs/shared/subagent-prompt-runtime.d.ts.map +1 -1
  135. package/src/runs/shared/subagent-prompt-runtime.js +12 -5
  136. package/src/runs/shared/subagent-prompt-runtime.js.map +1 -1
  137. package/src/shared/required-child-extensions.d.ts +16 -1
  138. package/src/shared/required-child-extensions.d.ts.map +1 -1
  139. package/src/shared/required-child-extensions.js +37 -5
  140. package/src/shared/required-child-extensions.js.map +1 -1
  141. package/src/shared/types.d.ts +6 -1
  142. package/src/shared/types.d.ts.map +1 -1
  143. package/src/shared/types.js +1 -1
  144. package/src/shared/types.js.map +1 -1
  145. package/src/slash/subagent-cost.d.ts.map +1 -1
  146. package/src/slash/subagent-cost.js +8 -4
  147. package/src/slash/subagent-cost.js.map +1 -1
  148. package/src/tui/render.d.ts +1 -1
  149. package/src/tui/render.d.ts.map +1 -1
  150. package/src/tui/render.js +4 -4
  151. package/src/tui/render.js.map +1 -1
  152. package/src/workflows/workflow-receipt.js +2 -2
  153. package/src/workflows/workflow-receipt.js.map +1 -1
  154. package/src/workflows/workflow-resources.d.ts +4 -0
  155. package/src/workflows/workflow-resources.d.ts.map +1 -1
  156. package/src/workflows/workflow-resources.js +7 -4
  157. package/src/workflows/workflow-resources.js.map +1 -1
package/CHANGELOG.md CHANGED
@@ -2,6 +2,52 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.75.0] - 2026-10-02
6
+
7
+ ### Highlights
8
+
9
+ - Background subagents work on Pi 1.0.0 again. In 0.74.0 they failed to start with "does not provide @earendil-works/pi-agent-core/node".
10
+ - The built-in `claude-code` and `claude-code-writer` agents can pick a Claude model and effort level per launch, for example `model: "claude-opus-5.5:high"`.
11
+ - On Windows, `claude-code`, `codex-exec`, and `cursor-agent` can now launch CLIs installed with npm.
12
+ - Children on a virtual model from an extension, such as a model router set as `subagents.defaultModel`, now launch and pass model verification.
13
+ - An invalid config value no longer silently turns off `authorityPolicy`, `permissions`, or `toolBudget`. Loading the config fails instead.
14
+
15
+ ### Added
16
+
17
+ - The built-in `claude-code` and `claude-code-writer` agents accept a model and thinking level per launch or in agent frontmatter, and pass them to Claude Code as `--model` and `--effort`. Before, the model could only be set in your global Claude Code settings. `model: "claude-opus-5.5:high"` sets both; `model: ":high"` sets only the effort. An unknown model or level fails the launch and names it. `subagents.maxThinking` and an enforced `subagents.modelScope` apply to these launches; with an enforced scope, a launch that sets no model fails, because Claude Code's default model cannot be checked. Other external runners still reject both fields. See [agents](docs/agents.md). Thanks to [@lexxbyte](https://github.com/lexxbyte) for [#2602](https://github.com/nicobailon/pi-subagents/issues/2602).
18
+ - The parent can now manage a long `bash` command inside a native Pi child that is granted both `bash` and `subagent_command`: `command.status` shows it, `command.yield` lets the child continue while the command keeps running, and `command.cancel` stops only that command. The child can do the same itself with `bash`'s `yieldTimeMs` and the `subagent_command` tool. Commands use Pi's own shell and are stopped when the child exits, and a child that finishes with a command still running fails. Thanks to [@jiuai233](https://github.com/jiuai233) for [#2598](https://github.com/nicobailon/pi-subagents/pull/2598).
19
+ - Hosts that require child extensions with `registerRequiredChildExtensions` can pass `requireForAllRunners: true`. Only local Pi children can load those extensions, so with this flag a launch on an external CLI, an external job, or another machine is refused before it starts instead of running without them. The requirement stays with the run, including nested, resumed, and workflow children, even after the host removes its registration. Without the flag, external runners are skipped as before. See [agents](docs/agents.md). Thanks to [@doc-krieger](https://github.com/doc-krieger) for [#2639](https://github.com/nicobailon/pi-subagents/issues/2639).
20
+ - `schedule.create` accepts an existing `missionId`, so a scheduled workflow keeps the same mission state across runs and session restarts. Schedules with a mission are saved in a new format that older pi-subagents versions reject instead of silently dropping the mission; other schedules keep the old format. Thanks to [@quifox](https://github.com/quifox) for [#2616](https://github.com/nicobailon/pi-subagents/pull/2616).
21
+ - `asyncWidgetCollapsed: true` starts the async widget under the editor folded to one line. Clicking its header still unfolds it, and the default is unchanged. Thanks to [@unrelentingfox](https://github.com/unrelentingfox) for [#2621](https://github.com/nicobailon/pi-subagents/pull/2621).
22
+
23
+ ### Changed
24
+
25
+ - CI now runs the clean-install test against both Pi `0.86.1` and `1.0.0`, as separate jobs with separate logs. Thanks to [@EightDoor](https://github.com/EightDoor) for [#2648](https://github.com/nicobailon/pi-subagents/pull/2648).
26
+
27
+ ### Fixed
28
+
29
+ - Background subagents failed to start on Pi 1.0.0 with "does not provide @earendil-works/pi-agent-core/node", because Pi 1.0.0 no longer ships that module. They now start without it, and still fail if Pi includes the module but the file is missing. Thanks to [@albertgwo](https://github.com/albertgwo) for [#2634](https://github.com/nicobailon/pi-subagents/pull/2634).
30
+ - An invalid value for any config key no longer silently drops `authorityPolicy`, `permissions`, or `toolBudget`. If the config file sets any of them, loading now fails instead of continuing with an empty config that would allow what those settings forbid. (#2622)
31
+ - A required child extension (`registerRequiredChildExtensions`) that throws during `session_start` now stops the launch. Before, Pi only reported the error, so the child still started and could send model requests without the policy the extension was meant to set up. Ordinary extensions are unchanged: their startup errors are reported and the child still starts. Thanks to [@doc-krieger](https://github.com/doc-krieger) for reporting [#2639](https://github.com/nicobailon/pi-subagents/issues/2639).
32
+ - On Windows, external-CLI agents such as `claude-code`, `codex-exec`, and `cursor-agent` failed with `EINVAL` when the CLI was installed with npm, because npm installs it as a `.cmd` file that Node cannot start without a shell. The runner now runs the CLI's script with Node directly, still without a shell, and refuses any other `.cmd` or `.bat` file. Thanks to [@lexxbyte](https://github.com/lexxbyte) for tracing the cause in [#2631](https://github.com/nicobailon/pi-subagents/issues/2631).
33
+ - A child could not launch on a virtual model that an extension registers with `pi.registerVirtualModel()`, such as a router set as `subagents.defaultModel`. The child looked up its model before the extension's virtual models were registered, so the name matched a model on another provider and the launch failed on that provider's missing API key. Virtual models are now registered first, and a required extension whose registration fails stops the launch. Thanks to [@mauroziux](https://github.com/mauroziux) for [#2636](https://github.com/nicobailon/pi-subagents/pull/2636) (#2635).
34
+ - A child on a virtual model failed with `model_verification_failed` even when it ran correctly, because the check compared the launch model with the real model the router picked. For virtual models, the check now compares the child's selected model with the launch model. Other children are checked as before. Thanks to [@mauroziux](https://github.com/mauroziux) for reporting [#2637](https://github.com/nicobailon/pi-subagents/issues/2637) (#2635).
35
+ - A background chain whose `expand` step runs an external-CLI agent such as `claude-code` failed with "Dynamic chain step N parallel does not support field 'runner'". Each item now runs through that agent's runner, and its output is collected like any parallel child. Thanks to [@lexxbyte](https://github.com/lexxbyte) for reporting [#2629](https://github.com/nicobailon/pi-subagents/issues/2629).
36
+ - Saving builtin agent overrides no longer risks a half-written settings file: if the save is interrupted, the previous settings stay readable. Thanks to [@quifox](https://github.com/quifox) for [#2627](https://github.com/nicobailon/pi-subagents/pull/2627).
37
+ - Codex children now keep tool-call IDs in the `call_id|item_id` form when both parts are at most 64 characters and use only letters, digits, `_`, or `-`. Other IDs are shortened as before. Thanks to [@jtabke](https://github.com/jtabke) for [#2628](https://github.com/nicobailon/pi-subagents/pull/2628) (#2623).
38
+ - With Pi's built-in MCP, `mcp:` entries whose server or tool name contains `-`, such as `mcp:srv/get-item`, failed with "selects MCP tools that Pi's built-in MCP does not offer". pi-subagents now converts `-` to `_` the same way Pi names the tool, so you keep writing names as the server reports them. Thanks to [@sheurich](https://github.com/sheurich) for [#2607](https://github.com/nicobailon/pi-subagents/issues/2607).
39
+ - Some MCP clients, such as pi-claude-bridge, send `workflow: true` as the string `"true"`, which failed with an error asking for `workflow: true`. The string now works the same as the boolean (#2600).
40
+ - `action: "validate"` now checks workflow `args` against the same limits as a launch: 16 fields per object, 64 items per array, depth 8, and 16 KiB total. A script that validates no longer fails at launch because of its `args`. ([#2608](https://github.com/nicobailon/pi-subagents/issues/2608))
41
+ - The parent is now told about every tool call that stays open past the attention threshold, not only the first one in each child. Thanks to [@jiuai233](https://github.com/jiuai233) for [#2598](https://github.com/nicobailon/pi-subagents/pull/2598).
42
+ - Async runs now reach `run-history.jsonl`. Before, only foreground runs were recorded, so per-agent lookups missed every background launch. Single-step runs record the same row as a foreground run, multi-step runs record one row per child step, and a paused run records as `interrupted`, with a later resume recording again. Thanks to [@limin411](https://github.com/limin411) for [#2620](https://github.com/nicobailon/pi-subagents/pull/2620).
43
+ - `/subagent-cost` and the RPC `cost` method now count every round of a resumed foreground workflow child. Before, every round after the first was dropped as a duplicate, so totals came out low with no warning. Results recorded before this fix still undercount. Thanks to [@chagwood](https://github.com/chagwood) for [#2601](https://github.com/nicobailon/pi-subagents/issues/2601).
44
+ - `/subagent-cost` and the RPC `cost` method no longer log a missing-receipt error on every call for foreground workflows. An async workflow that has no receipt yet, such as one still running, is now listed as `Async child usage unavailable` instead of being left out of the total without notice. (#2614)
45
+ - The global mission list now takes title, status, update time, and latest run from each mission's own record, so a mission no longer looks out of date because its index entry is stale. Thanks to [@quifox](https://github.com/quifox) for [#2618](https://github.com/nicobailon/pi-subagents/pull/2618).
46
+ - Headless sessions now deliver goal-mission notices even when finishing background work fails. The failure is still reported to the caller. Thanks to [@quifox](https://github.com/quifox) for [#2605](https://github.com/nicobailon/pi-subagents/pull/2605).
47
+ - One mission with a damaged run status or state no longer stops continuation notices for healthy goal missions. The damaged mission is reported separately. Thanks to [@quifox](https://github.com/quifox) for [#2604](https://github.com/nicobailon/pi-subagents/pull/2604).
48
+ - On Linux, a runner process that exited but was not yet cleaned up by the system no longer leaves its run marked as running, or a workflow waiting for a result that will never arrive. Thanks to [@quifox](https://github.com/quifox) for [#2606](https://github.com/nicobailon/pi-subagents/pull/2606).
49
+ - Saved subagent profiles with an invalid `machine` value are now rejected when loaded or checked, before any settings are written. `machine: false` still clears a pin. Thanks to [@quifox](https://github.com/quifox) for [#2619](https://github.com/nicobailon/pi-subagents/pull/2619).
50
+
5
51
  ## [0.74.0] - 2026-09-30
6
52
 
7
53
  ### Highlights
package/docs/agents.md CHANGED
@@ -110,12 +110,20 @@ The built-in `claude-code` and `claude-code-writer` profiles are the supported C
110
110
 
111
111
  Both adapters own `claude -p` argv with stream JSON, strict empty MCP configuration, user-only setting sources, no session persistence, disabled slash commands, and disabled Chrome integration. The writer mode does not include Bash or any permission bypass. Neither mode uses `--bare`, which does not read normal OAuth/keychain authentication. Neither mode requires `--safe-mode`, which is absent from the installed 2.1.150 help. User profiles cannot add argv. Selecting the code-owned `claude-code-writer` adapter identity is the only way to opt into its write tools; the read-only adapter cannot be widened with user argv.
112
112
 
113
+ A `model`, and a thinking level carried on it as a `:level` suffix, are the one thing these two adapters do accept from a launch; the same two fields work in agent frontmatter. They become Claude Code's own `--model` and `--effort` rather than a Pi child model, so one launch can pin `claude-opus-5.5` with `high` effort without changing the operator's global Claude Code settings. The model must be an alias or a model id, and both values are checked before launch, so an unusable value fails the launch by name and no other token can be added.
114
+
115
+ The level travels as the same `:level` suffix Pi children use, on the `model` field: `model: "claude-opus-5.5:high"` pins the model and the effort, and `model: ":high"` asks for the effort alone. A suffix wins over the frontmatter `thinking` value. `off` passes no `--effort` and `minimal` maps to `low`, and a launch that requests no level leaves the flag out, so Claude Code's own default effort applies and this repository cannot bound it. `off` therefore means "pass no flag", not "no thinking".
116
+
117
+ `subagents.maxThinking` applies here the way it does to a native Pi child: a request above the ceiling fails before the child starts, compared on the requested level rather than on the effort it maps to. An enforced `subagents.modelScope` applies too, checked against the id that will reach the CLI; a launch that pins no model at all fails closed, because the CLI's own default cannot be checked. Every other external runner still refuses both fields.
118
+
113
119
  Run it asynchronously:
114
120
 
115
121
  ```text
116
122
  Use claude-code to analyze this handoff without editing files.
117
123
 
118
124
  Use claude-code-writer to make the requested file changes.
125
+
126
+ Use claude-code-writer with model claude-sonnet-5:high to make the requested file changes.
119
127
  ```
120
128
 
121
129
  The adapter validates `claude --version` and `claude --help` only when a run launches. Discovery, list, status, and native Pi launches do not execute Claude Code or probe authentication. A capabilities listing performs only a passive PATH/PATHEXT/X_OK lookup and exposes the command as `runner.available`; that does not prove authentication or launch compatibility. JSONL, stderr, and stdout are untrusted. A run succeeds only after bounded valid JSONL contains exactly one successful terminal `result` with non-empty final text. Missing or revoked local authentication, limit stops, malformed JSON, duplicate terminal results, and EOF before a terminal result fail closed.
@@ -351,8 +359,8 @@ Field notes:
351
359
  | `allowedAgents` | Restricts which canonical, case-sensitive agent names this agent may launch. Omitted adds no restriction; an empty list denies every descendant launch. This only narrows an existing nesting grant: `tools: subagent` or `allowNestedSubagents: true` is still required. Inherited/runtime allowlists are intersected and cannot be widened. |
352
360
  | `extensions` | Omitted means a background child loads the parent's ambient extensions; empty means no ambient extensions; list values load exactly those extensions. Foreground children never load ambient extensions, so for them only listed values apply. |
353
361
  | `subagentOnlyExtensions` | Extension paths loaded only in this agent's child sessions. Tools registered there are unavailable to the main agent unless also installed through normal Pi extension configuration. |
354
- | `model` | Default model. Bare ids prefer the current provider when possible, then unique registry matches. |
355
- | `thinking` | Appended as a `:level` suffix at runtime unless a suffix is already present. |
362
+ | `model` | Default model. Bare ids prefer the current provider when possible, then unique registry matches. On the two Claude Code adapters this is Claude Code's own alias or id, and a trailing `:level` picks the effort. |
363
+ | `thinking` | Appended as a `:level` suffix at runtime unless a suffix is already present. On the two Claude Code adapters it becomes `--effort`, and a suffix on `model` wins over it. |
356
364
  | `systemPromptMode` | `replace` by default; `append` keeps Pi's base prompt. |
357
365
  | `inheritProjectContext` | Keeps or strips inherited repository instruction blocks. |
358
366
  | `inheritGlobalContext` | Keeps or strips the operator's global context file from the Pi config agent directory (e.g. `~/.pi/agent/AGENTS.md`). It has an effect only when `inheritProjectContext` is `true`; otherwise all context files are already disabled. Defaults to `false`. |
@@ -375,9 +383,11 @@ Field notes:
375
383
 
376
384
  ### Required host extensions
377
385
 
378
- Hosts can import `registerRequiredChildExtensions` from `pi-subagents/required-child-extensions` and register `{ sessionId, extensions: [{ id, path }] }`. Paths resolve to existing files and are canonicalized into an immutable launch snapshot; bounded safe IDs appear in evidence instead of paths. One registration is allowed per parent session until its idempotent `dispose()` runs, normally on `session_shutdown`.
386
+ Hosts can import `registerRequiredChildExtensions` from `pi-subagents/required-child-extensions` and register `{ sessionId, extensions: [{ id, path }], requireForAllRunners? }`. Paths resolve to existing files and are canonicalized into an immutable launch snapshot; bounded safe IDs appear in evidence instead of paths. One registration is allowed per parent session until its idempotent `dispose()` runs, normally on `session_shutdown`.
387
+
388
+ Required paths follow ordinary extension resolution and survive agent defaults and `extensions: []` across native foreground, detached, nested, and recovery launches. A `capabilityCeiling.denyExtensions` conflict or required load/provider-registration failure rejects before model resolution. An error a required extension reports while the child binds its extensions, such as a throwing `session_start` handler, disposes the child and rejects the launch before its first prompt. By default external runners are excluded (they run without the required extensions), and status/watch paths do not query the registry.
379
389
 
380
- Required paths follow ordinary extension resolution and survive agent defaults and `extensions: []` across native foreground, detached, nested, and recovery launches. A `capabilityCeiling.denyExtensions` conflict or required load/provider-registration failure rejects before model resolution. External runners are excluded, and status/watch paths do not query the registry.
390
+ With `requireForAllRunners: true`, a launch that resolves to an external CLI runner, an external-job runner, or a machine placement is rejected before a runner process, provider job, or remote owner starts, because only local native Pi children load these extensions. The requirement stays with the run through nested, detached, resumed, recovered, workflow-script, and appended launches, so disposing the registration or setting `extensions: []` cannot drop it. Launch preflight previews the runner-type rejection for the session's current registration; machine placement and requirements retained by nested or resumed runs are checked at launch.
381
391
 
382
392
  Successful completion is determined by observable gates such as process outcome, required outputs, explicit acceptance, verification commands, independent review, and staged-index integrity. Best-effort mutation observations remain diagnostic: unchanged or unknown evidence does not fail a run, and observed changes do not prove correctness.
383
393
 
@@ -462,7 +472,7 @@ Examples:
462
472
  - `allowNestedSubagents: true` with `tools` omitted: normal builtin tools (and, for background children, ambient extensions) remain inherited, and the child-safe nested `subagent` runtime is added.
463
473
  - `tools: read, fixture_search` plus `subagentOnlyExtensions: ./tools/fixture-search.ts`: the provider loads only in this agent's child sessions, and the registered `fixture_search` name survives the strict allowlist.
464
474
 
465
- When [pi-mcp-adapter](https://github.com/nicobailon/pi-mcp-adapter) is not installed and Pi has built-in MCP (Pi 0.99 or later), `mcp:server` and `mcp:server/tool` entries resolve against Pi's built-in MCP. The child connects the servers in Pi's `mcp.json` (the project's `.pi/mcp.json` only when the parent trusts the project) and gets only the selected tools, as direct tools, whatever exposure the server is configured with; tools configured as `hidden` cannot be selected. Servers that an extension adds with `pi.registerMcpServer()` work in background children, because the registering extension loads there too. They do not work in foreground children, which load no ambient extensions, so a foreground launch that selects one fails and says to use `async: true`. The launch fails if a selected tool does not register in the child within 10 seconds.
475
+ When [pi-mcp-adapter](https://github.com/nicobailon/pi-mcp-adapter) is not installed and Pi has built-in MCP (Pi 0.99 or later), `mcp:server` and `mcp:server/tool` entries resolve against Pi's built-in MCP. Name the server and tool as the server reports them: `mcp:my-docs/get-item` selects the tool Pi registers as `mcp__my_docs__get_item`. The child connects the servers in Pi's `mcp.json` (the project's `.pi/mcp.json` only when the parent trusts the project) and gets only the selected tools, as direct tools, whatever exposure the server is configured with; tools configured as `hidden` cannot be selected. Servers that an extension adds with `pi.registerMcpServer()` work in background children, because the registering extension loads there too. They do not work in foreground children, which load no ambient extensions, so a foreground launch that selects one fails and says to use `async: true`. The launch fails if a selected tool does not register in the child within 10 seconds.
466
476
 
467
477
  When pi-mcp-adapter is installed, it keeps priority and provides the direct MCP tools. Subagents only receive direct MCP tools when `mcp:` entries are listed in their frontmatter; global `directTools: true` in the adapter's MCP config is not enough by itself. The generic `mcp` proxy tool can still be used for discovery when available. The adapter caches tool metadata at startup, so after connecting a new MCP server for the first time, restart Pi before relying on direct tools. Server `includeTools` and `excludeTools` policies are enforced while resolving cached metadata for children: both accept exact names and `*`/`?` glob patterns against raw, generated-resource, and server/short/mcp/none-prefixed names, with `excludeTools` taking precedence. `mcp:` entries must name servers from the adapter's configuration files. A server that exists only in the adapter's runtime snapshot (registered at runtime, not persisted) cannot be provided to a child: children are pi sessions inside the parent or the runner process, not `pi` processes that could receive an MCP config argument, so such a launch fails with an error saying that MCP tools must come from an ambient adapter extension in a background child. An `mcp:` entry named `subagent` does not authorize nested fanout; declare the builtin `subagent` tool or set `allowNestedSubagents: true`. If a resolved direct MCP name is missing from the child registry, pi-subagents keeps the launch failed under the strict allowlist and reports the registration mismatch; check the resolved names against what the host or pi-mcp-adapter actually registers before child startup.
468
478
 
@@ -76,6 +76,8 @@ For a native Pi `model_verification_failed` where your proxy accepts `claude-hai
76
76
 
77
77
  Replace `YOUR_PROVIDER` with the resolved Pi provider ID. Keep the outgoing model alias unchanged. This native remedy already exists in v0.65.1; it does not infer equivalence from provider prefixes or dates. The built-in external `claude-code` adapter does not invoke this verifier or use this setting. If an external run shows this diagnostic, identify the installed version, resolved runner kind/adapter, and error location before applying a native remedy. Thanks to [sixtus](https://github.com/sixtus) for the concrete request-ID/response-ID example in [#1922](https://github.com/nicobailon/pi-subagents/issues/1922).
78
78
 
79
+ A local Pi child whose selected model is a virtual model (`pi.registerVirtualModel()`, such as a router) needs no alias. Its assistant messages name whichever physical model the router picked, so verification compares the child's selected virtual `provider/id` with the launch model instead, exactly. A different virtual selection fails, and `modelResponseAliases` does not override it.
80
+
79
81
  ## Tool activation lifecycle
80
82
 
81
83
  On Pi 0.86.1 or newer, when the model can take a new tool mid-conversation (see [`toolActivation`](#toolactivation)), a fresh unrestricted parent starts with `subagents_enable`, `bg_wait`, and `subagent_supervisor` active while `subagent` stays registered but inactive. Calling `subagents_enable({})` preserves unrelated active tools and exposes `subagent` on the next model request. It does not launch a child or infer authority from prompt keywords. With other models, a fresh parent starts with `subagent`, `bg_wait`, and `subagent_supervisor` active and no `subagents_enable`.
@@ -294,6 +296,14 @@ Prompt modes keep their fixed keys. For example, `Esc` still cancels steer text
294
296
 
295
297
  Controls the under-editor widget for active background runs. It defaults to `true`, including when FleetView is enabled, so active work remains visible after reload. Set it to `false` to hide this widget while keeping FleetView available.
296
298
 
299
+ ## `asyncWidgetCollapsed`
300
+
301
+ ```json
302
+ { "asyncWidgetCollapsed": true }
303
+ ```
304
+
305
+ Starts each newly mounted under-editor async widget in its one-line folded state. It defaults to `false`. A header click still toggles the widget, and the folded state still resets when the widget is removed or Pi reloads.
306
+
297
307
  ## `waitTool`
298
308
 
299
309
  ```json
@@ -251,7 +251,7 @@ const result = await resolveSubagentLaunchContract({
251
251
  if (!result.ok) {
252
252
  // missing_agent, ambiguous_agent, missing_skill, denied_required_tool,
253
253
  // invalid_artifact_dir, invalid_cwd, unsupported_mode, restricted_agent,
254
- // thinking_ceiling, invalid_extension_bindings, or invalid_intercom_bridge
254
+ // thinking_ceiling, model_scope, invalid_extension_bindings, or invalid_intercom_bridge
255
255
  throw new Error(result.message);
256
256
  }
257
257
 
package/docs/missions.md CHANGED
@@ -116,9 +116,23 @@ subagent({ action: "schedule.create", id: "nightly-sweep", every: "24h", quiet:
116
116
 
117
117
  Manage schedules with `schedule.list`, `schedule.show`, `schedule.history`, `schedule.pause`, `schedule.resume`, `schedule.run`, `schedule.run-due`, and `schedule.delete`.
118
118
 
119
+ Attach an existing mission to give each scheduled workflow access to the same durable `state.get/set`:
120
+
121
+ ```ts
122
+ subagent({ action: "schedule.create", id: "backlog", every: "6h", workflow: "./.pi/workflows/backlog.js", missionId: "<mission-id>" })
123
+ ```
124
+
125
+ The mission must be readable in the store resolved from the schedule's target `cwd` and current mission configuration. Creation checks it without changing its status. Every fire uses the normal explicit mission launch path, including after session restoration; missing or invalid records fail before workflow execution. Schedules accept only an existing `missionId`, not mission creation or updates. The script's fixed `args` and its mutable mission state remain separate.
126
+
127
+ Attachment uses ordinary mission lifecycle and retention rules. A non-goal mission can become terminal after a run, and the next fire reactivates it. `mission.close` does not pause the schedule; use `schedule.pause` or `schedule.delete` to stop future fires. A schedule does not protect its mission from terminal retention (default 200 records). If it is removed, later fires record `failed_launch` rather than creating a replacement. Open mission decisions and goal notice pause/budget settings do not gate schedule launches. Multiple schedules sharing a mission still have independent overlap controls; attachment does not serialize their workflows.
128
+
129
+ `missions.enabled:false` still permits explicit attachment; `disabledFeatures:["missions"]` rejects it. Each fire resolves the mission store using its target `cwd`, current mission configuration and Pi agent directory; the schedule does not pin the creation-time store. Sessions must resolve the same effective store to reuse the same state. Attachment does not search other worktrees or copy mission records; an explicitly shared `missions.directory` follows the existing storage rules.
130
+
131
+ Mission-bound definitions use schedule schema version 2 so older versions reject them instead of dropping the attachment. Existing unbound definitions keep version 1 and need no migration. A project using mission attachment should use a version that supports it in every scheduler session.
132
+
119
133
  Behavior:
120
134
 
121
- - Runs always launch async with fresh context and disable automatic mission creation; mission attachment is deferred from this first slice.
135
+ - Runs always launch async with fresh context. Without `missionId`, they disable mission creation and have no `state` global.
122
136
  - An optional top-level `baseRef` selects the safe Git ref used by managed worktrees (default `HEAD`); it is persisted with the schedule and forwarded on every fire. The source checkout must still be clean.
123
137
  - Definitions, bounded history, append-only events, and per-run receipts are stored with mode `0600`.
124
138
  - `overlap` is currently fixed to `skip`; `catchUp` supports `latest` (default) and `none`.
package/docs/models.md CHANGED
@@ -13,6 +13,8 @@ Builtin agents inherit your current Pi default model. This keeps new installs fr
13
13
 
14
14
  Precedence, strongest first: per-run override → provider-scoped role override → `agentOverrides.<name>.model` → agent frontmatter `model` → `subagents.defaultModel` → the parent session model. A provider preference does not replace this order; it only resolves bare model ids when the active registry has more than one match. Fully qualified `provider/model` strings still win exactly.
15
15
 
16
+ On the two Claude Code adapters a model is Claude Code's own alias or id rather than a Pi child model, so a value set for one of them resolves nothing against the registry. `subagents.defaultModel` is ignored there, because it is a default for Pi children. An explicit `agentOverrides.<name>.model` or agent frontmatter `model` is passed on as given, and Claude Code reports it when it does not recognize the value. See [agents](agents.md).
17
+
16
18
  Each launch resolves one model. Provider errors, including HTTP 429 responses, are returned from that model rather than selecting another one. Separately, a verified compaction abort after useful progress may continue the retained child session once on the same resolved model; this lifecycle recovery preserves work and is not model fallback.
17
19
 
18
20
  Use `model: "inherit"` in agent frontmatter or `agentOverrides.<name>.model` to select the current parent session model explicitly.
@@ -122,7 +124,7 @@ If your provider rejects model IDs with thinking suffixes, set `subagents.disabl
122
124
 
123
125
  ### Thinking ceiling
124
126
 
125
- Set `subagents.maxThinking` to enforce a hard maximum for every native Pi child. The supported levels, from least to most thinking, are `off`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`:
127
+ Set `subagents.maxThinking` to enforce a hard maximum for every child that can ask for a thinking level: native Pi children and the two Claude Code adapters. The supported levels, from least to most thinking, are `off`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`:
126
128
 
127
129
  ```json
128
130
  {
@@ -133,7 +135,7 @@ Set `subagents.maxThinking` to enforce a hard maximum for every native Pi child.
133
135
  }
134
136
  ```
135
137
 
136
- Requests above the ceiling fail before child startup; the setting covers frontmatter, `agentOverrides`, per-run overrides, parallel/chain children, nested launches, and resumed children. Project settings take precedence over user settings. External runners retain their existing behavior.
138
+ Requests above the ceiling fail before child startup; the setting covers frontmatter, `agentOverrides`, per-run overrides, parallel/chain children, nested launches, and resumed children. Project settings take precedence over user settings. External runners keep their existing behavior, except the two Claude Code adapters, which translate the requested level into `--effort` and enforce the same ceiling. An enforced `subagents.modelScope` also covers them: the model id that will reach the CLI is checked, and a launch that pins no model fails closed.
137
139
 
138
140
  ## Extension defaults
139
141
 
@@ -247,3 +249,5 @@ The workflow:
247
249
  - `/subagents-refresh-provider-models` writes a serialized provider model catalog with observed registry data, simple role-oriented classification, and live probe results from tiny one-shot `pi -p --model ... --no-tools` checks. The cache refreshes when missing or stale; use `--force` to ignore freshness and probe again immediately.
248
250
  - `/subagents-generate-profiles` uses the provider catalog to produce quota and quality profiles.
249
251
  - `/subagents-check-profile` re-checks each assigned model in a saved profile against the current registry and a live probe, so you can detect model removals, auth problems, or stale assignments.
252
+
253
+ Hand-authored profile entries can also set `machine` to a non-empty string or `false`. Loading and checking validate the whole saved profile, including machine syntax; malformed values are rejected before loading writes settings or checking probes models. Valid machine strings are trimmed and use the same limits as agent settings. `false` clears a machine pin, while an omitted field preserves an existing string pin when loading. Validation does not query the live machine catalog.
@@ -10,6 +10,8 @@ A foreground child is a pi session created inside the parent Pi process, not a s
10
10
 
11
11
  A background child is a pi session created inside the detached runner process. The runner mirrors session events into `events.jsonl`, `output-<index>.log`, and the transcript. Interrupt and stop abort the child session; steer requests are delivered with the session's `steer` or `followUp`.
12
12
 
13
+ Long-open `bash` attention notices identify the exact tool call and include status and child-specific transcript commands. Each distinct long-open call notifies once. Inspect the running command and recent output before intervening: development servers and watch commands may intentionally never return, while builds and tests may legitimately take time. A queued steer does not cancel the shell command. For local native Pi children explicitly granted `subagent_command`, `command.yield` returns control while the selected command remains managed; `command.cancel` stops that command without interrupting the child. Query `command.status` to confirm its terminal state. Unsupported children require the existing run-scoped interrupt/resume path, which may affect siblings. See [command controls](tool-reference.md#command-controls).
14
+
13
15
  Live progress shows compact detail for single, chain, and parallel modes: a bounded one-line task, current tool, recent output, token counts, aggregate cost, duration, activity freshness, current-tool duration, and chain graph metadata when available. Workflow `label` metadata wins over raw task text in compact multi-child cards.
14
16
 
15
17
  Press Pi's configured expand key (`Ctrl+O` by default) to expand the full streaming view with complete output per step.
@@ -53,9 +55,11 @@ or keyboard shortcuts is needed. The summary counts the widget's tracked runs,
53
55
  including workflow parents and children, rather than unique agents.
54
56
 
55
57
  Folding stays in effect across progress updates and does not change Pi's global
56
- expand setting, run execution, or completion notifications. Task rows, drag and
57
- wheel events, and modifier clicks are left unhandled. The state resets when the
58
- widget is removed or Pi reloads. Regular mode keeps the existing keyboard controls.
58
+ expand setting, run execution, or completion notifications. Set
59
+ `asyncWidgetCollapsed: true` in the extension configuration to start each newly
60
+ mounted widget folded. Task rows, drag and wheel events, and modifier clicks are left
61
+ unhandled. The state resets when the widget is removed or Pi reloads. Regular mode
62
+ keeps the existing keyboard controls.
59
63
 
60
64
  ### Reducing status display noise
61
65
 
@@ -74,6 +78,7 @@ For compact chat results with FleetView as the only live editor surface, merge t
74
78
  - `inlineToolDisplay: "summary"` keeps one static result row per call, alongside its call heading. A completed status query is not proof that the queried child has finished.
75
79
  - `fleetView: true` retains live progress. Open `/subagents-fleet` for details instead of repeatedly requesting status just to watch progress. Pi's expand key does not expand summary results; keep `"rich"` if you want expandable inline output.
76
80
  - `asyncWidget: false` hides only the additional under-editor async widget, leaving FleetView available. This configuration reduces visible surfaces; it does not guarantee ordering relative to other extensions.
81
+ - `asyncWidgetCollapsed: true` starts each newly mounted async widget as a one-line live status summary; click its header to expand it.
77
82
 
78
83
  Thanks to [DraconDev](https://github.com/DraconDev) for reporting the display noise and suggesting summary mode in [#1931](https://github.com/nicobailon/pi-subagents/issues/1931).
79
84
 
@@ -75,8 +75,8 @@ The complete plain-JSON inventory is validated before the first launch (maximum
75
75
  | `topic` | `overview \| workflows \| agents \| missions \| observability \| tool-reference \| configuration \| models \| watchdog \| extension-api \| council` | `overview` | Packaged guide topic for `action: "guide"`. |
76
76
  | `config` | object/string | - | Agent config for management create/update. |
77
77
  | `context` | `fresh \| fork \| profile` | global or per-agent default, else `fresh` | Explicit `fresh` or `fork` overrides every workflow child. `profile` requires the selected agent's declared `defaultContext` and ignores config `defaultSubagentContext`; missing agent defaults fail. When omitted, [`defaultSubagentContext`](configuration.md#defaultsubagentcontext) wins over each agent's `defaultContext`; implicit fork falls back to fresh without a persisted parent session and leaf. Explicit fork is strict. Packaged `worker` defaults to `fresh`; packaged `oracle` and `advisor` default to `fork`. |
78
- | `model` | string | agent default | Call `{action:"models"}` first and copy an exact `provider/id`; bare ids resolve only if unique, and agent names are not model ids. A suffix such as `provider/id:high` (`off/minimal/low/medium/high/xhigh/max`) overrides agent thinking. The `thinking` field is only for `watchdog.configure`, ignored on dispatch. |
79
- | `missionId` | string | - | Attach a workflow to an existing project mission instead of creating its default enclosing mission. |
78
+ | `model` | string | agent default | Call `{action:"models"}` first and copy an exact `provider/id`; bare ids resolve only if unique, and agent names are not model ids. A suffix such as `provider/id:high` (`off/minimal/low/medium/high/xhigh/max`) overrides agent thinking. The `thinking` field is only for `watchdog.configure`, ignored on dispatch. On the `claude-code` and `claude-code-writer` adapters the model is Claude Code's own alias or id, and the same suffix becomes its `--effort`, bounded by `subagents.maxThinking` and by an enforced `subagents.modelScope`. |
79
+ | `missionId` | string | - | Attach a workflow, including each fire of `schedule.create`, to an existing project mission. Scheduled attachment uses ordinary lifecycle and retention rules. |
80
80
  | `mission` | object/false | auto-create | Override the default enclosing mission with `{ title \| summary, objective?, goal?, budget?, labels? }`. Set exactly one non-empty `title` or `summary`; `objective` and `labels` are optional. `goal` may only be `true`, requires `budget.tokens`, and enables continuation notices. Pass `false` for an intentionally ephemeral workflow with no mission for it or its children and no `state` global. Explicit mission persistence failures are strict. |
81
81
  | `handoffPath` | string | - | Aggregate handoff manifest for `action: "worktree.discard"` or lane evidence actions, or optional explicit metadata for `action: "worktree.cleanup"`. |
82
82
  | `repo` | string | runtime cwd | Repository path for `action: "worktree.cleanup"`; plan mode only. The configured worktree base filters candidates by their per-project folder under it but never discovers them. |
@@ -246,7 +246,7 @@ Rules:
246
246
 
247
247
  ### Schedule controls
248
248
 
249
- Use `schedule.create` with `workflow: true` or a script path, not a direct child. `at` accepts a delay like `+10m` or an ISO timestamp with timezone; `every` accepts fixed intervals. `sessionOnly:true` binds restoration/execution to the creating session file; omitted/false is project-wide. Recurring `quiet:true` keeps successful automatic fires visible without a parent turn; failed, stopped or paused runs still wake the parent. One-shot `at` and manual `schedule.run` stay noisy unless that launch passes `quiet:true`. See [missions and schedules](missions.md#schedules) for examples and list/show/history/pause/resume/run/run-due/delete. Calendar selectors (`on`, `timezone`) and schedule mission attachment are deferred. `baseRef` resolves only at worktree allocation and still requires a clean source checkout.
249
+ Use `schedule.create` with `workflow: true` or a script path, not a direct child. `at` accepts a delay like `+10m` or an ISO timestamp with timezone; `every` accepts fixed intervals. `sessionOnly:true` binds restoration/execution to the creating session file; omitted/false is project-wide. Recurring `quiet:true` keeps successful automatic fires visible without a parent turn; failed, stopped or paused runs still wake the parent. One-shot `at` and manual `schedule.run` stay noisy unless that launch passes `quiet:true`. An optional `missionId` attaches an existing mission on every fire and exposes its workflow state, using ordinary mission lifecycle and retention rules; `mission.close` does not pause the schedule. See [missions and schedules](missions.md#schedules) for examples and list/show/history/pause/resume/run/run-due/delete. Calendar selectors (`on`, `timezone`) are deferred. `baseRef` resolves only at worktree allocation and still requires a clean source checkout.
250
250
 
251
251
  ## Lane merge evidence and cleanup eligibility
252
252
 
@@ -320,6 +320,31 @@ subagent({ action: "doctor" })
320
320
  - Inside child-safe fanout mode, bare `status` requires an id when no local foreground run is active, so children cannot enumerate unrelated top-level async runs.
321
321
  - Bare `interrupt` still targets only the visible top-level run; interrupting a nested run requires its explicit nested id.
322
322
 
323
+ ### Command controls
324
+
325
+ Command controls target direct local native Pi children that explicitly select both `bash` and `subagent_command`, in foreground or async runs. They require the owning parent session, a run `id`, an explicit `index` for multi-child runs, and the exact `toolCallId` for mutations. Nested, external, and custom shell backends do not expose this controller. Custom bash extensions keep their own registered `subagent_command` tool. If a custom bash backend does not provide that tool, an explicitly required `subagent_command` remains available and reports an unsupported-backend error. Native supervisor command controls are unavailable for custom backends.
326
+
327
+ ```ts
328
+ subagent({ action: "command.status", id: "<run-id>", index: 0 })
329
+ subagent({ action: "command.yield", id: "<run-id>", index: 0, toolCallId: "<call-id>" })
330
+ subagent({ action: "command.cancel", id: "<run-id>", index: 0, toolCallId: "<call-id>" })
331
+ subagent({ action: "command.status", id: "<run-id>", index: 0, toolCallId: "<call-id>" })
332
+ ```
333
+
334
+ `command.yield` releases the selected blocking tool call without restarting the process. `command.cancel` aborts only that command through Pi's native bash cancellation; the child receives a tool error and can continue. `cancel_requested` acknowledges the request, while `cancelled` confirms the backend settled. A stale id never targets a later command. Run-scoped `interrupt` remains separate.
335
+
336
+ Enable command controls by including both `bash` and `subagent_command` in the agent or call's `tools` allowlist. Tool ceilings and `excludeTools` still apply. Without this explicit selection, bash keeps its original tool schema and backend; no command controller, inbox watcher, or command-state writes are added. Inside an enabled child:
337
+
338
+ ```ts
339
+ bash({ command: "npm run dev", yieldTimeMs: 1000 })
340
+ subagent_command({ action: "status", toolCallId: "<returned-call-id>", waitMs: 1000 })
341
+ subagent_command({ action: "cancel", toolCallId: "<returned-call-id>", waitMs: 1000 })
342
+ ```
343
+
344
+ `yieldTimeMs` and `waitMs` range from 0 to 30,000 milliseconds. Omitting `yieldTimeMs` preserves completion-waiting behavior. Yielded handles are not successful exits. Status includes running/yielded/cancel-requested states and completed/failed/cancelled terminal states, a bounded output tail, and Pi's full-output file path when available. Recent terminal history retains 20 commands; active commands remain tracked.
345
+
346
+ Commands remain owned by the child session. Normal completion with unfinished commands cancels them and fails the run. Interrupt, stop, timeout, and disposal clean up owned commands. Controls do not transfer processes out of the child or create detached services. Native bash `timeout` remains command-scoped; `toolTimeoutMs` covers an open tool call and does not become a yielded process deadline.
347
+
323
348
  ### resume
324
349
 
325
350
  `resume` revives a paused, completed, or failed async/foreground child by starting a new child from its stored session file. Stopped runs remain non-resumable, and it does not interrupt a live top-level async child. Use `steer` for acknowledged live async guidance.
package/docs/workflows.md CHANGED
@@ -53,7 +53,7 @@ The `workflow` field selects the script source:
53
53
 
54
54
  - `workflow: true` runs the one ```` ```js workflow ```` fenced block written in the same assistant reply as the `subagent` call. The script is plain text in the reply, so it needs no JSON string escaping. A reply can carry exactly one such block and one `workflow: true` call; zero or several blocks fail. A line containing only ```` ``` ```` (three or more backticks, optionally followed by spaces or tabs) ends the block, so keep Markdown fences inside quoted strings.
55
55
  - A string containing `/` (or `\` in a Windows path), such as `workflow: "./workflows/review.js"`, is a script file.
56
- - Any other string, such as `workflow: "review"`, is a [named workflow resource](#named-workflow-resources-for-permission-extensions).
56
+ - Any other string, such as `workflow: "review"`, is a [named workflow resource](#named-workflow-resources-for-permission-extensions). The string `"true"` is read as `workflow: true`, because some MCP clients send the boolean as a string.
57
57
 
58
58
  `workflow: true` works only from a model tool call. Slash commands, RPC, and schedules pass scripts through their own inputs. Examples below that show only a ```` ```js workflow ```` block run with `subagent({ workflow: true })` in the same reply.
59
59
 
@@ -395,7 +395,7 @@ A plain workflow creates one enclosing mission by default. Its children do not c
395
395
 
396
396
  ### Repeatable workflows
397
397
 
398
- Use stable child keys and keep process logic in ordinary JavaScript. `runs.run` launches one child, `runs.all` launches independent children together, and later steps can use each completed child's `output`. Put long task text in arrays joined with `"\n"` so Markdown fences do not conflict with the script string.
398
+ Use stable child keys and keep process logic in ordinary JavaScript. `runs.run` launches one child, `runs.all` launches independent children together, and later steps can use each completed child's `output`. Put long task text in arrays joined with `"\n"` so Markdown fences do not conflict with the script string. Pass long child briefs as files and put only their paths in task text, not the briefs themselves in `args`, which is limited to 16 KiB.
399
399
 
400
400
  For a process you run often, save the task as a prompt template under `.pi/prompts/` or `~/.pi/agent/prompts/` and launch it with `/prompt-workflow`. The adapter compiles prompt steps into a workflow script, so templates describe the work instead of embedding raw `subagent` tool calls. You can ask the parent agent to create or update these prompt files from a process described in natural language.
401
401
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "pi-subagents",
4
- "version": "0.74.0",
4
+ "version": "0.75.0",
5
5
  "description": "Pi extension for single-agent delegation and scripted multi-agent workflows",
6
6
  "author": "Nico Bailon",
7
7
  "license": "MIT",
@@ -241,6 +241,7 @@ export declare function resolveAgentName(name: string, agents: AgentConfig[]): {
241
241
  export declare function findNearestGitRoot(cwd: string): string | null;
242
242
  export declare function findNearestProjectRoot(cwd: string): string | null;
243
243
  export declare function findConfiguredProjectRoot(cwd: string): string | null;
244
+ export declare function validateOptionalMachine(value: unknown, label: string): string | undefined;
244
245
  export interface RuntimeAgentSettingsContext {
245
246
  cwd: string;
246
247
  scope: AgentScope;
@@ -1 +1 @@
1
- {"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../../../src/agents/agents.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAK9B,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAS7I,OAAO,EAAyB,KAAK,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAC7F,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAG7F,OAAO,EAA2B,KAAK,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAC9F,OAAO,EAAsB,KAAK,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAIvF,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,SAAS,GAAG,MAAM,CAAC;AAErD,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,CAAC;AACjF,KAAK,gBAAgB,GAAG,QAAQ,GAAG,SAAS,CAAC;AAC7C,MAAM,MAAM,mBAAmB,GAAG,OAAO,GAAG,MAAM,CAAC;AAEnD,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,MAAM,CAAC;AAElD,MAAM,WAAW,iBAAiB;IACjC,KAAK,EAAE,gBAAgB,CAAC;IACxB,IAAI,EAAE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,MAAM,EACX,KAAK,EAAE,UAAU,EACjB,sBAAsB,CAAC,EAAE,MAAM,EAC/B,OAAO,GAAE,qBAAqB,GAAG;IAAE,aAAa,CAAC,EAAE,OAAO,CAAA;CAAO,GAC/D,sBAAsB,CAIxB;AAqDD,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,sBAAsB,CAAC,EAAE,MAAM,EAAE,OAAO,GAAE,qBAA0B,GAAG,oBAAoB,CAIzJ;AAED,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,sBAAsB,CAAC,EAAE,MAAM,EAAE,OAAO,GAAE,qBAA0B,GAAG,uBAAuB,CAE5I"}
@@ -7,7 +7,9 @@ import { parse as parseYaml } from "yaml";
7
7
  import * as os from "node:os";
8
8
  import * as path from "node:path";
9
9
  import { fileURLToPath } from "node:url";
10
+ import { createAtomicJsonWriter } from "../shared/atomic-json.js";
10
11
  import { CODE_OWNED_EXTERNAL_CLI_ADAPTER_LABEL, isCodeOwnedExternalCliAdapterId, parseExternalCliCapabilityNarrowing, validateCodeOwnedProfileRunner } from "../runs/shared/external-cli-contract.js";
12
+ import { isClaudeCodeAdapterId } from "../runs/shared/claude-code-adapter.js";
11
13
  import { getAgentDir, getProjectConfigDir } from "../shared/utils.js";
12
14
  import { expandHomePath } from "../shared/settings.js";
13
15
  import { KNOWN_FIELDS } from "./agent-serializer.js";
@@ -656,7 +658,64 @@ function readSettingsFileStrict(filePath) {
656
658
  }
657
659
  function writeSettingsFile(filePath, settings) {
658
660
  fs.mkdirSync(path.dirname(filePath), { recursive: true });
659
- fs.writeFileSync(filePath, JSON.stringify(settings, null, 2) + "\n", "utf-8");
661
+ const targetPath = resolveSettingsWriteTarget(filePath);
662
+ let existingMode;
663
+ try {
664
+ existingMode = fs.statSync(targetPath).mode & 0o7777;
665
+ }
666
+ catch (error) {
667
+ if (!(error instanceof Error && "code" in error && error.code === "ENOENT"))
668
+ throw error;
669
+ }
670
+ if (existingMode !== undefined)
671
+ fs.accessSync(targetPath, fs.constants.W_OK);
672
+ const tempMode = existingMode === undefined ? undefined : existingMode | 0o200;
673
+ // Reuse the atomic temp/rename path while retaining settings' newline and existing mode.
674
+ const writeAtomicSettings = createAtomicJsonWriter({
675
+ mode: tempMode,
676
+ fs: {
677
+ mkdirSync: fs.mkdirSync,
678
+ writeFileSync: (tempPath, data, options) => {
679
+ return fs.writeFileSync(tempPath, `${data}\n`, options);
680
+ },
681
+ renameSync: (sourcePath, destinationPath) => {
682
+ if (existingMode !== undefined)
683
+ fs.chmodSync(sourcePath, existingMode);
684
+ fs.renameSync(sourcePath, destinationPath);
685
+ },
686
+ rmSync: fs.rmSync,
687
+ },
688
+ });
689
+ writeAtomicSettings(targetPath, settings);
690
+ }
691
+ function resolveSettingsWriteTarget(filePath) {
692
+ let targetPath = filePath;
693
+ for (;;) {
694
+ try {
695
+ return fs.realpathSync.native(targetPath);
696
+ }
697
+ catch (error) {
698
+ if (!(error instanceof Error && "code" in error && error.code === "ENOENT"))
699
+ throw error;
700
+ // A trailing separator requires a directory; it cannot name a new settings file.
701
+ if (targetPath.endsWith("/") || targetPath.endsWith(path.sep))
702
+ throw error;
703
+ }
704
+ // A missing target is allowed only when its physical parent already exists.
705
+ const parentPath = fs.realpathSync.native(path.dirname(targetPath));
706
+ const unresolvedPath = path.join(parentPath, path.basename(targetPath));
707
+ let linkText;
708
+ try {
709
+ linkText = fs.readlinkSync(unresolvedPath);
710
+ }
711
+ catch (error) {
712
+ if (!(error instanceof Error && "code" in error && error.code === "ENOENT"))
713
+ throw error;
714
+ return unresolvedPath;
715
+ }
716
+ // Keep link text intact so the filesystem follows directory links before "..".
717
+ targetPath = path.isAbsolute(linkText) ? linkText : `${parentPath}${path.sep}${linkText}`;
718
+ }
660
719
  }
661
720
  function parseOverrideStringArrayOrFalse(value, meta) {
662
721
  if (value === undefined)
@@ -685,7 +744,7 @@ function parseToolsOverride(value, meta) {
685
744
  }
686
745
  throw new Error(`Builtin override '${meta.name}' in '${meta.filePath}' has invalid 'tools'; expected an array of strings, "inherit", or false.`);
687
746
  }
688
- function validateOptionalMachine(value, label) {
747
+ export function validateOptionalMachine(value, label) {
689
748
  if (value === undefined || value === false)
690
749
  return undefined;
691
750
  if (typeof value !== "string" || !value.trim())
@@ -1771,8 +1830,11 @@ function parseAgentRunnerFrontmatter(raw, agentName) {
1771
1830
  function validateExternalRunnerProfile(frontmatter, agentName, runner) {
1772
1831
  if (runner?.type !== "external-cli" && runner?.type !== "external-job")
1773
1832
  return;
1833
+ // The code-owned Claude Code adapters accept an explicit model and thinking level:
1834
+ // both are translated into their own argv rather than into a Pi child model.
1835
+ const adapterAcceptsOverrides = runner.type === "external-cli" && isClaudeCodeAdapterId(runner.adapter);
1774
1836
  const unsupported = ["tools", "excludeTools", "allowNestedSubagents", "allowedAgents", "model", "thinking", "extensions", "subagentOnlyExtensions", "mutationTools", "maxSubagentDepth", "skills", "skill", "skillPath", "toolBudget", "permission", "permissions"]
1775
- .filter((field) => frontmatter[field] !== undefined);
1837
+ .filter((field) => frontmatter[field] !== undefined && !(adapterAcceptsOverrides && (field === "model" || field === "thinking")));
1776
1838
  if (unsupported.length > 0) {
1777
1839
  throw new Error(`Agent '${agentName}' uses runner.type='${runner.type}' and declares unsupported Pi-only fields: ${unsupported.join(", ")}.`);
1778
1840
  }