pi-subagents 0.78.0 → 0.79.1

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 (188) hide show
  1. package/CHANGELOG.md +68 -0
  2. package/docs/agents.md +4 -2
  3. package/docs/configuration.md +4 -4
  4. package/docs/extension-api.md +4 -0
  5. package/docs/observability.md +11 -3
  6. package/docs/tool-reference.md +12 -1
  7. package/docs/workflows.md +6 -4
  8. package/package.json +1 -1
  9. package/skills/pi-subagents/SKILL.md +1 -0
  10. package/skills/pi-subagents/references/execution-controls.md +2 -0
  11. package/src/extension/declaration-pinning.d.ts.map +1 -1
  12. package/src/extension/declaration-pinning.js +15 -1
  13. package/src/extension/declaration-pinning.js.map +1 -1
  14. package/src/extension/index.d.ts.map +1 -1
  15. package/src/extension/index.js +19 -4
  16. package/src/extension/index.js.map +1 -1
  17. package/src/extension/public-execution.d.ts +1 -0
  18. package/src/extension/public-execution.d.ts.map +1 -1
  19. package/src/extension/public-execution.js +3 -0
  20. package/src/extension/public-execution.js.map +1 -1
  21. package/src/extension/rpc.d.ts.map +1 -1
  22. package/src/extension/rpc.js +5 -3
  23. package/src/extension/rpc.js.map +1 -1
  24. package/src/extension/schemas.d.ts +2 -0
  25. package/src/extension/schemas.d.ts.map +1 -1
  26. package/src/extension/schemas.js +1 -0
  27. package/src/extension/schemas.js.map +1 -1
  28. package/src/extension/tool-activation.d.ts +1 -0
  29. package/src/extension/tool-activation.d.ts.map +1 -1
  30. package/src/extension/tool-activation.js +57 -18
  31. package/src/extension/tool-activation.js.map +1 -1
  32. package/src/extension/upgrade-notice.d.ts.map +1 -1
  33. package/src/extension/upgrade-notice.js +7 -1
  34. package/src/extension/upgrade-notice.js.map +1 -1
  35. package/src/intercom/native-supervisor-channel.d.ts +2 -1
  36. package/src/intercom/native-supervisor-channel.d.ts.map +1 -1
  37. package/src/intercom/native-supervisor-channel.js +117 -9
  38. package/src/intercom/native-supervisor-channel.js.map +1 -1
  39. package/src/runs/background/async-execution.d.ts.map +1 -1
  40. package/src/runs/background/async-execution.js +13 -16
  41. package/src/runs/background/async-execution.js.map +1 -1
  42. package/src/runs/background/async-job-tracker.d.ts.map +1 -1
  43. package/src/runs/background/async-job-tracker.js +8 -0
  44. package/src/runs/background/async-job-tracker.js.map +1 -1
  45. package/src/runs/background/async-resume.d.ts.map +1 -1
  46. package/src/runs/background/async-resume.js +2 -1
  47. package/src/runs/background/async-resume.js.map +1 -1
  48. package/src/runs/background/async-status-snapshot.d.ts.map +1 -1
  49. package/src/runs/background/async-status-snapshot.js +4 -2
  50. package/src/runs/background/async-status-snapshot.js.map +1 -1
  51. package/src/runs/background/async-status.d.ts.map +1 -1
  52. package/src/runs/background/async-status.js +16 -8
  53. package/src/runs/background/async-status.js.map +1 -1
  54. package/src/runs/background/inspect-rpc.d.ts +5 -0
  55. package/src/runs/background/inspect-rpc.d.ts.map +1 -1
  56. package/src/runs/background/inspect-rpc.js +20 -3
  57. package/src/runs/background/inspect-rpc.js.map +1 -1
  58. package/src/runs/background/result-delivery-ownership.d.ts +0 -2
  59. package/src/runs/background/result-delivery-ownership.d.ts.map +1 -1
  60. package/src/runs/background/result-delivery-ownership.js +5 -21
  61. package/src/runs/background/result-delivery-ownership.js.map +1 -1
  62. package/src/runs/background/result-files.d.ts +5 -3
  63. package/src/runs/background/result-files.d.ts.map +1 -1
  64. package/src/runs/background/result-files.js +10 -6
  65. package/src/runs/background/result-files.js.map +1 -1
  66. package/src/runs/background/result-watcher.d.ts.map +1 -1
  67. package/src/runs/background/result-watcher.js +15 -8
  68. package/src/runs/background/result-watcher.js.map +1 -1
  69. package/src/runs/background/resume-guidance.d.ts.map +1 -1
  70. package/src/runs/background/resume-guidance.js +3 -2
  71. package/src/runs/background/resume-guidance.js.map +1 -1
  72. package/src/runs/background/run-child-session.d.ts.map +1 -1
  73. package/src/runs/background/run-child-session.js +7 -4
  74. package/src/runs/background/run-child-session.js.map +1 -1
  75. package/src/runs/background/run-status.d.ts.map +1 -1
  76. package/src/runs/background/run-status.js +11 -4
  77. package/src/runs/background/run-status.js.map +1 -1
  78. package/src/runs/background/stale-run-reconciler.d.ts.map +1 -1
  79. package/src/runs/background/stale-run-reconciler.js +53 -5
  80. package/src/runs/background/stale-run-reconciler.js.map +1 -1
  81. package/src/runs/background/subagent-runner.d.ts.map +1 -1
  82. package/src/runs/background/subagent-runner.js +15 -5
  83. package/src/runs/background/subagent-runner.js.map +1 -1
  84. package/src/runs/background/workflow-terminal-proof.d.ts +18 -1
  85. package/src/runs/background/workflow-terminal-proof.d.ts.map +1 -1
  86. package/src/runs/background/workflow-terminal-proof.js +27 -0
  87. package/src/runs/background/workflow-terminal-proof.js.map +1 -1
  88. package/src/runs/foreground/async-dismiss-action.d.ts.map +1 -1
  89. package/src/runs/foreground/async-dismiss-action.js +2 -1
  90. package/src/runs/foreground/async-dismiss-action.js.map +1 -1
  91. package/src/runs/foreground/async-steering-action.d.ts.map +1 -1
  92. package/src/runs/foreground/async-steering-action.js +3 -2
  93. package/src/runs/foreground/async-steering-action.js.map +1 -1
  94. package/src/runs/foreground/async-stop-action.d.ts +1 -0
  95. package/src/runs/foreground/async-stop-action.d.ts.map +1 -1
  96. package/src/runs/foreground/async-stop-action.js +3 -1
  97. package/src/runs/foreground/async-stop-action.js.map +1 -1
  98. package/src/runs/foreground/command-action.d.ts.map +1 -1
  99. package/src/runs/foreground/command-action.js +2 -1
  100. package/src/runs/foreground/command-action.js.map +1 -1
  101. package/src/runs/foreground/execution.d.ts.map +1 -1
  102. package/src/runs/foreground/execution.js +18 -7
  103. package/src/runs/foreground/execution.js.map +1 -1
  104. package/src/runs/foreground/subagent-executor.d.ts +2 -0
  105. package/src/runs/foreground/subagent-executor.d.ts.map +1 -1
  106. package/src/runs/foreground/subagent-executor.js +98 -32
  107. package/src/runs/foreground/subagent-executor.js.map +1 -1
  108. package/src/runs/shared/async-status-projection.d.ts +4 -0
  109. package/src/runs/shared/async-status-projection.d.ts.map +1 -1
  110. package/src/runs/shared/async-status-projection.js +23 -1
  111. package/src/runs/shared/async-status-projection.js.map +1 -1
  112. package/src/runs/shared/child-commands.d.ts +2 -0
  113. package/src/runs/shared/child-commands.d.ts.map +1 -1
  114. package/src/runs/shared/child-commands.js +4 -0
  115. package/src/runs/shared/child-commands.js.map +1 -1
  116. package/src/runs/shared/child-runtime-config.d.ts +6 -0
  117. package/src/runs/shared/child-runtime-config.d.ts.map +1 -1
  118. package/src/runs/shared/child-runtime-config.js +6 -0
  119. package/src/runs/shared/child-runtime-config.js.map +1 -1
  120. package/src/runs/shared/child-session.d.ts +6 -6
  121. package/src/runs/shared/child-session.d.ts.map +1 -1
  122. package/src/runs/shared/child-session.js +111 -51
  123. package/src/runs/shared/child-session.js.map +1 -1
  124. package/src/runs/shared/long-running-guard.d.ts +3 -1
  125. package/src/runs/shared/long-running-guard.d.ts.map +1 -1
  126. package/src/runs/shared/long-running-guard.js +75 -17
  127. package/src/runs/shared/long-running-guard.js.map +1 -1
  128. package/src/runs/shared/model-resolution.d.ts +5 -1
  129. package/src/runs/shared/model-resolution.d.ts.map +1 -1
  130. package/src/runs/shared/model-resolution.js +8 -1
  131. package/src/runs/shared/model-resolution.js.map +1 -1
  132. package/src/runs/shared/nested-events.d.ts.map +1 -1
  133. package/src/runs/shared/nested-events.js +2 -0
  134. package/src/runs/shared/nested-events.js.map +1 -1
  135. package/src/runs/shared/pi-spawn.d.ts +5 -1
  136. package/src/runs/shared/pi-spawn.d.ts.map +1 -1
  137. package/src/runs/shared/pi-spawn.js +86 -30
  138. package/src/runs/shared/pi-spawn.js.map +1 -1
  139. package/src/runs/shared/run-ownership.d.ts +4 -0
  140. package/src/runs/shared/run-ownership.d.ts.map +1 -0
  141. package/src/runs/shared/run-ownership.js +9 -0
  142. package/src/runs/shared/run-ownership.js.map +1 -0
  143. package/src/runs/shared/subagent-control.d.ts +1 -0
  144. package/src/runs/shared/subagent-control.d.ts.map +1 -1
  145. package/src/runs/shared/subagent-control.js +2 -1
  146. package/src/runs/shared/subagent-control.js.map +1 -1
  147. package/src/runs/shared/subagent-prompt-runtime.d.ts +45 -18
  148. package/src/runs/shared/subagent-prompt-runtime.d.ts.map +1 -1
  149. package/src/runs/shared/subagent-prompt-runtime.js +160 -59
  150. package/src/runs/shared/subagent-prompt-runtime.js.map +1 -1
  151. package/src/shared/file-lease.d.ts +7 -1
  152. package/src/shared/file-lease.d.ts.map +1 -1
  153. package/src/shared/file-lease.js +8 -2
  154. package/src/shared/file-lease.js.map +1 -1
  155. package/src/shared/fork-context.d.ts +3 -1
  156. package/src/shared/fork-context.d.ts.map +1 -1
  157. package/src/shared/fork-context.js +23 -13
  158. package/src/shared/fork-context.js.map +1 -1
  159. package/src/shared/session-succession.d.ts +5 -0
  160. package/src/shared/session-succession.d.ts.map +1 -0
  161. package/src/shared/session-succession.js +25 -0
  162. package/src/shared/session-succession.js.map +1 -0
  163. package/src/shared/types.d.ts +15 -1
  164. package/src/shared/types.d.ts.map +1 -1
  165. package/src/shared/types.js +3 -0
  166. package/src/shared/types.js.map +1 -1
  167. package/src/shared/utils.d.ts +11 -0
  168. package/src/shared/utils.d.ts.map +1 -1
  169. package/src/shared/utils.js +17 -0
  170. package/src/shared/utils.js.map +1 -1
  171. package/src/slash/slash-commands.d.ts.map +1 -1
  172. package/src/slash/slash-commands.js +2 -2
  173. package/src/slash/slash-commands.js.map +1 -1
  174. package/src/watchdog/register-main.js +2 -2
  175. package/src/watchdog/register-main.js.map +1 -1
  176. package/src/watchdog/runtime.d.ts.map +1 -1
  177. package/src/watchdog/runtime.js +3 -5
  178. package/src/watchdog/runtime.js.map +1 -1
  179. package/src/workflows/scripted-workflow.d.ts +1 -1
  180. package/src/workflows/scripted-workflow.d.ts.map +1 -1
  181. package/src/workflows/workflow-child-summary.d.ts +5 -0
  182. package/src/workflows/workflow-child-summary.d.ts.map +1 -1
  183. package/src/workflows/workflow-child-summary.js +10 -0
  184. package/src/workflows/workflow-child-summary.js.map +1 -1
  185. package/src/workflows/workflow-reuse.d.ts +6 -1
  186. package/src/workflows/workflow-reuse.d.ts.map +1 -1
  187. package/src/workflows/workflow-reuse.js +22 -1
  188. package/src/workflows/workflow-reuse.js.map +1 -1
package/CHANGELOG.md CHANGED
@@ -2,6 +2,73 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.79.1] - 2026-10-17
6
+
7
+ ### Highlights
8
+
9
+ - Leaner requests until you delegate. A session that hasn't turned on `subagent` no longer sends the `bg_wait` and `subagent_supervisor` tool definitions, about 1,500 characters on every request.
10
+ - Apps that embed Pi, such as pi-web, now launch children with their own Pi install instead of the copy that came with pi-subagents.
11
+ - A workflow whose main process died keeps the results of children that had already finished, instead of marking them all failed.
12
+ - Workflow child lanes in the widget, FleetView and `status` now show each child's model.
13
+ - Read-only installs start without a "permission denied" error.
14
+
15
+ ### Changed
16
+
17
+ - A session that hasn't delegated anything no longer sends `subagent_supervisor` with every request, saving about 420 characters each time. It turns on with `subagent`, or when a child's question reaches a session that doesn't have it yet, for example from a scheduled run. Thanks to [@armchairfuturist-code](https://github.com/armchairfuturist-code) for reporting [#2936](https://github.com/nicobailon/pi-subagents/issues/2936).
18
+ - A session that hasn't delegated anything no longer sends `bg_wait` with every request, saving about 1,100 characters each time. It turns on with `subagent` (after `subagents_enable`), or once another extension registers background work for it to wait on. Sessions that already had `bg_wait` or `subagent_supervisor` keep them, so upgrading doesn't change their tools or break their prompt cache. Thanks to [@armchairfuturist-code](https://github.com/armchairfuturist-code) for reporting [#2935](https://github.com/nicobailon/pi-subagents/issues/2935).
19
+
20
+ ### Fixed
21
+
22
+ - When pi-subagents ran inside an app that embeds Pi, children could start with the Pi copy installed next to pi-subagents instead of the app's own. Children now use the app's Pi first. `PI_SUBAGENTS_PI_CODING_AGENT_PACKAGE_ROOT` still takes priority, including when Pi is started through `node_modules/.bin/pi`. If the chosen Pi install is broken, launching a child fails and says why, while `doctor` and `status` keep working. Thanks to [@CompN3rd](https://github.com/CompN3rd) for [#2947](https://github.com/nicobailon/pi-subagents/pull/2947).
23
+ - When a workflow's main process died, every child still listed as running was marked failed, even one that had already finished on its own. A background child that already recorded its result (`complete`, `failed`, `stopped`, `partial` or `rejected`) now keeps it. Children that hadn't finished, or whose status can't be read, are still marked failed. Thanks to [@isjiajia01](https://github.com/isjiajia01) for [#2940](https://github.com/nicobailon/pi-subagents/pull/2940) ([#2938](https://github.com/nicobailon/pi-subagents/issues/2938)).
24
+ - A background workflow child showed no model on its lane in the async widget, FleetView or `status`. Lanes now show the model and thinking level the child reports. Thanks to [@bottfish](https://github.com/bottfish) for [#2941](https://github.com/nicobailon/pi-subagents/pull/2941).
25
+ - Attention notices for a child's `bash` call could name `&1;` as the file being written, because `2>&1` was read as a file. The notice now names the first real file the command writes, and names none when the command only redirects to another output or `/dev/null`. ([#2943](https://github.com/nicobailon/pi-subagents/issues/2943))
26
+ - In a read-only install, every Pi start logged "Failed to show the pi-subagents upgrade notice: ... permission denied", because the upgrade notice couldn't save which version it last showed. It now skips the notice quietly in that case. Thanks to [@jakubsuchy](https://github.com/jakubsuchy) for reporting [#2949](https://github.com/nicobailon/pi-subagents/issues/2949).
27
+
28
+ ## [0.79.0] - 2026-10-17
29
+
30
+ ### Highlights
31
+
32
+ - Handoffs keep your background work. A session that takes over from another one in the same Pi process can see, wait on, steer, stop and resume the old session's background runs, and a stopped workflow can be picked up with `reuseFrom` without running its finished children again.
33
+ - Coordinators can give a finished worker another round. Resuming a finished background child, a forked child, or a child that was already resumed once now works instead of failing with "session file is not under that nested run's session directory".
34
+ - Fewer wasted tokens. Forked subagents reuse the parent's prompt cache, `/subagent-cost` and other view-only reports no longer ride along in every request, and codemode no longer breaks the cache on every resume.
35
+ - `subagent` survives updates. Updating or reloading pi-subagents mid-session no longer leaves `subagent` or `bg_wait` turned off.
36
+ - RPC hosts see more: each background child's agent, run id, requested model, and the model that actually answered.
37
+
38
+ ### Added
39
+
40
+ - Inspect replies (`/subagents-inspect-rpc`) now include `resolvedModel: { provider, model }`, the provider and model of the inspected child's latest reply. Before, a host could only see the requested model. The field is missing until the child replies, for a whole workflow or multi-step run, and for runs from before this release. A forked child's inherited history never counts. Thanks to [@koenvg](https://github.com/koenvg) for reporting [#2922](https://github.com/nicobailon/pi-subagents/issues/2922).
41
+ - The RPC `subagent-async` status snapshot now includes each background step's `model`, `thinking` level and `agent`. A workflow lane's label names the lane, not the agent, so hosts could not name a running child until it finished. Thanks to [@agustinsacco](https://github.com/agustinsacco) for [#2893](https://github.com/nicobailon/pi-subagents/pull/2893) ([#2892](https://github.com/nicobailon/pi-subagents/issues/2892)) and [@kevinsleegerslameco](https://github.com/kevinsleegerslameco) for [#2912](https://github.com/nicobailon/pi-subagents/pull/2912) ([#2911](https://github.com/nicobailon/pi-subagents/issues/2911)).
42
+ - In a workflow that waits for its result, a background child's `workflowChildren` row now carries its `agent` and `runId` from launch, and that `runId` matches the child's run in the `subagent-async` snapshot. Before, the row had only `{ childId, state }` until the child finished. Thanks to [@kevinsleegerslameco](https://github.com/kevinsleegerslameco) for reporting [#2911](https://github.com/nicobailon/pi-subagents/issues/2911).
43
+ - After a handoff, a relaunched workflow can reuse the work of a run that was stopped because the old session's runtime was replaced: pass `options: { reuseFrom: "<run id>" }`. Finished children are reused and running ones are awaited, even from another session, as long as the run ran the same script in the same cwd. Before, relaunching ran every child again, so two writers could share one output. The stop notice names the option and the run id. Thanks to [@wireknight](https://github.com/wireknight) for reporting [#2909](https://github.com/nicobailon/pi-subagents/issues/2909).
44
+ - A session that takes over from another one in the same Pi process, for example after a handoff to a new session file, now owns the old session's background runs. They show in its run list, fleet view and RPC snapshot. It can wait on, steer, stop, resume and inspect them, and it gets their notices and answers their supervisor questions. `status` shows `Owner: inherited from session '…' (replaced in this process).` for these runs. A fresh start, `pi --continue`, or another Pi process inherits nothing. Thanks to [@wireknight](https://github.com/wireknight) for reporting [#2909](https://github.com/nicobailon/pi-subagents/issues/2909).
45
+
46
+ ### Changed
47
+
48
+ - The pi-subagents skill now says that `subagent`, `subagents_enable`, `subagent_supervisor`, `contact_supervisor` and `structured_output` can't be called from codemode scripts. With codemode on, models used to try `tools.subagent_supervisor(...)` and get a "does not exist" error. Thanks to [@CovetingEpiphany2152](https://github.com/CovetingEpiphany2152) for the report. ([#2887](https://github.com/nicobailon/pi-subagents/issues/2887))
49
+ - Replying to a supervisor question that was already answered, expired or withdrawn now lists the questions still pending, so the parent can answer a newer one without another `pending` call. Thanks to [@agustinsacco](https://github.com/agustinsacco) for [#2895](https://github.com/nicobailon/pi-subagents/pull/2895). ([#2894](https://github.com/nicobailon/pi-subagents/issues/2894))
50
+
51
+ ### Fixed
52
+
53
+ - A coordinator could not resume its own finished background child: `resume` failed with "session file is not under that nested run's session directory", so it had to start a new child and send the brief again. The same happened for forked children (`context: "fork"`) and for a child that had already been resumed once. All three now resume, with the same ownership checks as before. Background and forked children now keep their session in a folder named by their run id. Children launched before this update still can't be resumed. Thanks to [@mannainsect](https://github.com/mannainsect) for reporting [#2924](https://github.com/nicobailon/pi-subagents/issues/2924) and [@GeorgeLautenschlager](https://github.com/GeorgeLautenschlager) for showing it outside workflows. ([#2932](https://github.com/nicobailon/pi-subagents/issues/2932))
54
+ - A coordinator child (one that delegates its own work) stayed stuck in `bg_wait` when one of its children asked it a question with `contact_supervisor`, so the questions expired unanswered. Its `bg_wait` now returns as soon as a question is waiting, as the parent's already does. Thanks to [@mannainsect](https://github.com/mannainsect) for reporting [#2923](https://github.com/nicobailon/pi-subagents/issues/2923).
55
+ - A child's `contact_supervisor` question could expire before the parent saw it when the parent was busy in a long tool call, so the child gave up and asked again and the parent's late reply failed. The question's deadline now moves forward until the parent's model sees it. Thanks to [@agustinsacco](https://github.com/agustinsacco) for the report. ([#2894](https://github.com/nicobailon/pi-subagents/issues/2894))
56
+ - When a handoff or reload stopped an async workflow, its still-running children were listed as `stopped`, its notice didn't say that reusing finished children works only from the same session, and `status` offered a `Revive:` command to sessions that can't use it. The children now show as `running`, the notice explains how the same session and another session can reuse them, and `status` offers resume only to the session that launched the run. Thanks to [@wireknight](https://github.com/wireknight) for reporting [#2909](https://github.com/nicobailon/pi-subagents/issues/2909).
57
+ - After pi-subagents was updated or reloaded mid-session, `subagent` stayed off once the session started again (`/reload` or `pi --continue`), and `subagents_enable` wasn't offered either, so nothing could turn it back on. Pi records the unload as a removal of the extension's tools, and that was replayed as if you had turned `subagent` off. An unload is now recognized and the tools come back as you had them. Thanks to [@bkdinoop](https://github.com/bkdinoop) for reporting [#2910](https://github.com/nicobailon/pi-subagents/issues/2910).
58
+ - After such an update, a session continued in a new process (`pi --continue`) also kept `bg_wait` off, and a second update in that session lost `subagent` again. The tools the update removed now come back when the session starts, unless they are excluded for this process. ([#2916](https://github.com/nicobailon/pi-subagents/issues/2916))
59
+ - Forked subagents now reuse the parent's prompt cache. A fork used to replace the parent's system prompt and tools, so its first request re-read the whole conversation. It now sends the parent's system prompt, tools and messages unchanged, and gets its own instructions in a `<subagent_instructions>` block at the start of its task. A fork also sees the parent's project context and skills even when its agent turns them off. On Claude with a 60k-token parent, a fork's first request went from 9.6k cached and 52k written tokens to 60.8k cached and 1.7k written. See [tool-reference.md](docs/tool-reference.md#fork-context-details) for the forks that still miss the cache. Fresh children are unchanged. Thanks to [@gabsn](https://github.com/gabsn) for [#2879](https://github.com/nicobailon/pi-subagents/pull/2879).
60
+ - `/subagent-cost` and other view-only slash reports no longer go into every later model request. They are still saved, shown in the TUI and sent to RPC callers. `/run` results stay in context because the model needs them. Reports saved before this update stay until compaction, so updating doesn't break a session's prompt cache. Thanks to [@isjiajia01](https://github.com/isjiajia01) for [#2927](https://github.com/nicobailon/pi-subagents/pull/2927) and [@summer-tt](https://github.com/summer-tt) for the report. ([#2925](https://github.com/nicobailon/pi-subagents/issues/2925))
61
+ - With Pi's codemode on, every start or resume of a session added another copy of codemode's note to the `bg_wait` description, so the provider re-read the conversation without its prompt cache. The note now appears once and a resumed session keeps its tool declaration. Thanks to [@SamuelBadr](https://github.com/SamuelBadr) for the report. ([#2889](https://github.com/nicobailon/pi-subagents/issues/2889))
62
+ - When a provider stopped a child with an error, such as a content-filter refusal, the child reported only the stop code. Its error now includes the provider's reply text as `Reply text: …` (up to 500 characters), so a refusal can be told apart from an outage. In a failed workflow, each failed child's line also starts with its own error instead of the `Run fan-out: N/64 used` line. Thanks to [@stanleytelehealth](https://github.com/stanleytelehealth) for [#2913](https://github.com/nicobailon/pi-subagents/pull/2913).
63
+ - A read-only child running `grep … 2>/dev/null` could be flagged `needs_attention`: the redirect counted as a file change, and output containing words like "error" counted as a failure. Redirects to `/dev/null` no longer count as changes, and a tool call counts as failed only when its result says `isError: true`. Calls blocked by a hard `toolBudget` don't count either. Thanks to [@Liaokc](https://github.com/Liaokc) for the fix and [@builtroller](https://github.com/builtroller) for the report. ([#2878](https://github.com/nicobailon/pi-subagents/issues/2878), [#2884](https://github.com/nicobailon/pi-subagents/issues/2884))
64
+ - A notice about a long-running `bash` call in a child suggested `command.status`, `command.yield` and `command.cancel` even when the child had no command controller, so following it failed with "No command controller is available for this child." The notice now suggests them only when they work. Thanks to [@G0-0000](https://github.com/G0-0000) for [#2882](https://github.com/nicobailon/pi-subagents/pull/2882). ([#2880](https://github.com/nicobailon/pi-subagents/issues/2880))
65
+ - On Pi 1.2 and later, the watchdog took the system prompt of a run started by an extension message (for example a wake sent with `triggerTurn: true`) as your prompt and showed it to its reviewer model as a real requirement. These runs no longer add to the watchdog's scope, and their edits are still reviewed against your earlier prompts. Thanks to [@isjiajia01](https://github.com/isjiajia01) for [#2928](https://github.com/nicobailon/pi-subagents/pull/2928) and [@sternnick](https://github.com/sternnick) for reporting [#2926](https://github.com/nicobailon/pi-subagents/issues/2926).
66
+ - A child using built-in MCP tools failed after 10 seconds even when its server was still connecting normally. It now waits for the connection, fails promptly when a connection fails, and stops waiting when the child is stopped or times out. This needs Pi 0.99.2 or later. Thanks to [@qsgy-edge](https://github.com/qsgy-edge) for [#2904](https://github.com/nicobailon/pi-subagents/pull/2904).
67
+ - An extension that force-exits a headless run on quit could kill the background runner when one of its children ended, so the run failed with "Async runner process N exited with code 0 before writing a result". The runner now sets `PI_SUBAGENT_RUNNER_PID` to its own pid, so an extension can compare it with `process.pid` and leave the runner alone. Processes spawned from a child inherit the value but have their own pid. See [extension-api.md](docs/extension-api.md#background-work-provider-api). Thanks to [@hughy](https://github.com/hughy) for [#2885](https://github.com/nicobailon/pi-subagents/pull/2885). ([#2883](https://github.com/nicobailon/pi-subagents/issues/2883))
68
+ - After Pi auto-compacted in the middle of a turn, the async and Fleet status widgets stayed hidden until the whole run ended. They now come back as soon as the compaction finishes. Thanks to [@agustinsacco](https://github.com/agustinsacco) for [#2891](https://github.com/nicobailon/pi-subagents/pull/2891). ([#2890](https://github.com/nicobailon/pi-subagents/issues/2890))
69
+ - When a background subagent finished, the parent often logged `Failed to acknowledge the mission observer ... Timed out waiting for another process to finish updating` with a stack trace and stalled for 200 ms. It now retries quietly a moment later. Thanks to [@RainbowXie](https://github.com/RainbowXie) for the report. ([#2896](https://github.com/nicobailon/pi-subagents/issues/2896))
70
+ - A finished mission run from an earlier Pi process in the same session was synced to its mission again every 60 seconds, rewriting the mission record each time. It is now synced once. Thanks to [@BelovedYaoo](https://github.com/BelovedYaoo) for reporting [#2905](https://github.com/nicobailon/pi-subagents/issues/2905).
71
+
5
72
  ## [0.78.0] - 2026-10-12
6
73
 
7
74
  ### Highlights
@@ -406,6 +473,7 @@
406
473
  - Logs from running and failed external CLI agents can be viewed in Fleet, tool status, and the TUI. Thanks to [@Shujakuinkuraudo](https://github.com/Shujakuinkuraudo) for [#2375](https://github.com/nicobailon/pi-subagents/issues/2375).
407
474
  - Structured delegation updates report cumulative usage and no longer count missing provider cache numbers as zero. Thanks to [@bioShaun](https://github.com/bioShaun) for [#2374](https://github.com/nicobailon/pi-subagents/pull/2374).
408
475
  - Forked sessions keep Pi 0.87 context edits, including replaced content and signed Anthropic thinking blocks.
476
+
409
477
  ## [0.70.1] - 2026-09-20
410
478
 
411
479
  ### Highlights
package/docs/agents.md CHANGED
@@ -359,6 +359,8 @@ Use these fields when an agent should see more:
359
359
 
360
360
  Builtin agents opt into repository instruction inheritance by default so they follow repo-specific rules out of the box, but global context remains excluded unless `inheritGlobalContext: true` is set. This changes the behavior of existing agents that previously received global context as part of `inheritProjectContext: true`. `delegate` also uses append mode because its job is orchestration inside the parent workflow.
361
361
 
362
+ These fields and `systemPromptMode` shape a fresh child's system prompt. A forked child (`context: "fork"`) sends its parent's whole system prompt instead, project context, global context, and skills included, and gets its agent prompt in its task message (see [fork context details](tool-reference.md#fork-context-details)).
363
+
362
364
  ## Frontmatter reference
363
365
 
364
366
  A full example:
@@ -537,7 +539,7 @@ Examples:
537
539
 
538
540
  ### MCP tools
539
541
 
540
- 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 server part may also use the `-`→`_` form of its name that Pi's MCP namespace uses, such as `mcp:my_docs`. 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.
542
+ When [pi-mcp-adapter](https://github.com/nicobailon/pi-mcp-adapter) is not installed and Pi has built-in MCP (Pi 0.99.2 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 server part may also use the `-`→`_` form of its name that Pi's MCP namespace uses, such as `mcp:my_docs`. 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 child waits for the selected servers' current MCP connection attempts before its first prompt, then rejects the launch if any selected tool is missing or not available as a direct tool. Pi's MCP request timeout still bounds each connection; stopping, interrupting, timing out, or shutting down the child cancels the startup wait. An unrelated server does not delay this check.
541
543
 
542
544
  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.
543
545
 
@@ -613,7 +615,7 @@ Agent-local `skillPath` candidates never enter Pi's parent/global skills catalog
613
615
 
614
616
  ## The bundled pi-subagents skill
615
617
 
616
- The package bundles a `pi-subagents` skill that is automatically available to the parent agent when the extension is installed. Availability is not automatic routing or permission to delegate: the parent works directly unless the operator requests delegation in the current request or through applicable user/project instructions. Once authorized, use the smallest bounded child or workflow whose evidence, independent review, specialization, parallelism, or isolation benefit earns its overhead. It is for the orchestrating parent only: child subagents never receive it, and a child's own context is filtered to strip parent-only orchestration instructions. A forked child keeps the history it inherited as the parent sent it, so its first request can reuse the parent's prompt cache.
618
+ The package bundles a `pi-subagents` skill that is automatically available to the parent agent when the extension is installed. Availability is not automatic routing or permission to delegate: the parent works directly unless the operator requests delegation in the current request or through applicable user/project instructions. Once authorized, use the smallest bounded child or workflow whose evidence, independent review, specialization, parallelism, or isolation benefit earns its overhead. It is for the orchestrating parent only: fresh child subagents never receive it, and a child's own context is filtered to strip parent-only orchestration instructions. A forked child is the exception: it keeps the history, system prompt, and tool declarations it inherited as the parent sent them, so it sees this skill in the parent's skills list and the parent's subagent catalog. It receives its own instructions, including its subagent boundary, in its task message, and its first request reuses the parent's prompt cache (see [fork context details](tool-reference.md#fork-context-details)).
617
619
 
618
620
  What it covers:
619
621
 
@@ -80,9 +80,9 @@ A local Pi child whose selected model is a virtual model (`pi.registerVirtualMod
80
80
 
81
81
  ## Tool activation lifecycle
82
82
 
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`. `contact_supervisor` is active whenever `subagent` is, with the definition children use, so a forked child declares the same tools as its parent and can reuse its prompt cache; called in a session that is not a subagent, it returns an error.
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 only `subagents_enable` active while `subagent`, `bg_wait`, and `subagent_supervisor` stay registered but inactive. Calling `subagents_enable({})` preserves unrelated active tools and exposes all three on the next model request. It does not launch a child or infer authority from prompt keywords. `bg_wait` is also declared without `subagent` once another extension registers a [background-work provider](extension-api.md#background-work-provider-api), because only `bg_wait` waits for that work. `subagent_supervisor`, which answers this session's children, is also declared when a child request reaches a session that does not have it, such as one from a scheduled run. With other models, a fresh parent starts with `subagent`, `bg_wait`, and `subagent_supervisor` active and no `subagents_enable`. `contact_supervisor` is active whenever `subagent` is, with the definition children use, so a forked child declares the same tools as its parent and can reuse its prompt cache; called in a session that is not a subagent, it returns an error.
84
84
 
85
- The recorded native `subagent` selection is restored on resume, reload, and tree navigation, so an activated session stays activated and a cold session stays cold. With the default `toolActivation`, the recorded `subagents_enable` selection is restored too, so a session that started without the loader never gets it later. Older history without tool-selection records keeps eager `subagent` availability. If Pi's allowlist or exclusions remove the loader, the extension does not hide `subagent`; if they remove `subagent`, the loader reports it unavailable. Hosts whose extension API lacks `getAllTools`, `getActiveTools`, or `setActiveTools` keep eager behavior and log one compatibility warning. The host version is not read from disk, so in-process hosts such as pi-web activate the same way as the Pi CLI.
85
+ The recorded native `subagent` selection is restored on resume, reload, and tree navigation, so an activated session stays activated and a cold session stays cold. The recorded `bg_wait` and `subagent_supervisor` selections are restored the same way, so a session that declared them, for example on an earlier version, keeps them. With the default `toolActivation`, the recorded `subagents_enable` selection is restored too, so a session that started without the loader never gets it later. Older history without tool-selection records keeps eager `subagent`, `bg_wait`, and `subagent_supervisor` availability. If Pi's allowlist or exclusions remove the loader, the extension does not hide `subagent` or `bg_wait`; if they remove `subagent`, the loader reports it unavailable. Hosts whose extension API lacks `getAllTools`, `getActiveTools`, or `setActiveTools` keep eager behavior and log one compatibility warning. The host version is not read from disk, so in-process hosts such as pi-web activate the same way as the Pi CLI.
86
86
 
87
87
  Some providers fix the tool list for a whole prompt, for example bridges that hand Pi's tools to another agent SDK. There `subagent` appears only on the next user prompt, not the next model request. Start Pi with `--exclude-tools subagents_enable` to keep `subagent` active from the start.
88
88
 
@@ -278,7 +278,7 @@ Controls how resolved fork launches prepare the inherited session. The default `
278
278
 
279
279
  Child-visible spilled items contain only the model summary and a stable `{ batchId, itemId }` recovery ref. Raw bodies and their digests, source entry ids, labels, sizes, and tool metadata go to a private `0600` sidecar next to the child session. This release does not add a recovery command or expose that payload to the child model.
280
280
 
281
- Pruned forks keep the normal `parentSession` link, child cwd alignment, and fork thinking-block sanitization (signed Anthropic thinking blocks are stripped; the child keeps its requested thinking level). Missing model or auth, invalid or incomplete summary JSON, budget overflow, recovery validation failure, and raw overflow leakage all stop the launch before child spawn. The extension never falls back to a full fork or refs-only context after a prune failure.
281
+ Pruned forks keep the normal `parentSession` link, child cwd alignment, and fork thinking-block sanitization (a pruned fork rewrites inherited content, so its signed and redacted Anthropic thinking blocks are stripped; the child keeps its requested thinking level). Missing model or auth, invalid or incomplete summary JSON, budget overflow, recovery validation failure, and raw overflow leakage all stop the launch before child spawn. The extension never falls back to a full fork or refs-only context after a prune failure.
282
282
 
283
283
  ## `fleetView`
284
284
 
@@ -570,7 +570,7 @@ export PI_SUBAGENTS_PI_CODING_AGENT_PACKAGE_ROOT=/path/to/pi-coding-agent-packag
570
570
 
571
571
  Overrides host-package discovery for spawned children. Foreground CLI resolution uses this root to locate the `pi` CLI script, and the detached background runner uses it for jiti host resolution and peer-package aliases, so both child kinds agree on one host. The value must be the root of a canonical `@earendil-works/pi-coding-agent` installation (the directory containing its `package.json`, with that package name); both child kinds still validate the package name and its peer packages from that install tree, so a package whose manifest carries a different name is rejected even with the override set. Empty or whitespace-only values are ignored.
572
572
 
573
- The default in-process child session loader consults the same discovery. Before falling back to a bare `@earendil-works/pi-coding-agent` import, it resolves the host package root (the running pi process's location, then this override, then pi-subagents' own install tree as a last fallback) and imports the host's entry file directly, so children share the host's single SDK instance instead of a second copy. Roots whose `package.json` name is not `@earendil-works/pi-coding-agent` are rejected. When this override is selected, an unimportable root is reported instead of falling back to a bare import from a different tree.
573
+ The default in-process child session loader consults the same discovery. Before falling back to a bare `@earendil-works/pi-coding-agent` import, it resolves the host package root (a verified Pi-owned JavaScript entry, then this override, then any other Pi-owned entry such as an extensionless `.bin/pi` symlink, then the embedding host's dependency, then pi-subagents' own install tree as a last fallback) and imports the host's entry file directly, so children share the host's single SDK instance instead of a second copy. For an embedding host, discovery walks ancestor `node_modules` directories from the host entry's canonical location to find its Pi dependency before using the extension's install tree. Roots whose `package.json` name is not `@earendil-works/pi-coding-agent` are rejected. When this override is selected, an unimportable root is reported instead of falling back to a bare import from a different tree, and foreground CLI resolution fails instead of falling back to another install or `pi` on `PATH`.
574
574
 
575
575
  ## `intercomBridge`
576
576
 
@@ -432,6 +432,10 @@ Children do not gain provider tools or extensions automatically. Add `bg_wait` t
432
432
 
433
433
  Local foreground children never load the parent's ambient extensions: they share the parent's process, and loading them would start a second copy of every ambient extension, including this one, inside it. They do inherit the providers the parent's extensions registered, so a provider extension's models resolve in a local foreground child. Pane-native remote foreground children instead use the remote machine's provider discovery and configuration. Agents that need MCP tools (`mcpDirectTools`, or MCP tools from an ambient adapter such as pi-mcp-adapter) must run as background children (`async: true`), which load the ambient extensions inside the detached runner process unless the agent sets `extensions` or the capability ceiling denies extensions.
434
434
 
435
+ The runner hosts many child sessions in one process and keeps working after each one ends: a background child's extensions see `session_shutdown` with reason `"quit"` in print mode, but the process does not exit with it. An extension that acts on process exit at that point (for example by force-exiting a headless run) should first check `process.env.PI_SUBAGENT_RUNNER_PID === String(process.pid)`, which is true only inside the runner. `PI_SUBAGENT_CHILD=1` cannot make that distinction: processes spawned from a child, such as a headless `pi` started by its bash tool, inherit both variables but have their own pid.
436
+
437
+ A local foreground child ends the same way, but it runs inside the parent Pi process, which is not a runner and sets no marker. An extension configured into a foreground child (through the agent's `extensions` or `subagentOnlyExtensions`) must not act on process exit at `session_shutdown`.
438
+
435
439
  ## External job provider bridge
436
440
 
437
441
  Extensions that own long-running advisor jobs can register a process-local provider for `runner.type: external-job` agents:
@@ -155,9 +155,11 @@ If something feels misconfigured, run `/subagents-doctor` or ask: "Check whether
155
155
  ## Host inspection protocol (RPC)
156
156
 
157
157
  RPC hosts receive live async status through the bounded `subagent-async` widget
158
- (`PI_SUBAGENT_ASYNC_JSON:` payload). For on-demand detail — a child's delegated
159
- task, transcript window, or final output — hosts can invoke the extension
160
- command:
158
+ (`PI_SUBAGENT_ASYNC_JSON:` payload). Step nodes report the `agent` the child
159
+ runs as, and the `model` and `thinking` level it runs on once its status reports
160
+ them. For on-demand
161
+ detail — a child's delegated task, transcript window, or final output — hosts
162
+ can invoke the extension command:
161
163
 
162
164
  ```text
163
165
  /subagents-inspect-rpc <requestId> <asyncId> [childId] [--lines N]
@@ -183,6 +185,10 @@ Inspection properties:
183
185
  - `task` is the child session's first user message and is only populated when
184
186
  it is genuinely attributable (fresh-context child whose session file fits the
185
187
  read window); forked children omit it.
188
+ - `resolvedModel` (`{ provider, model }`) is the pair Pi recorded on the
189
+ inspected child's latest own assistant reply, never the requested model. It is
190
+ absent before the first reply, for run-level inspection of a multi-step or
191
+ workflow run, and for runs recorded before pi-subagents reported it.
186
192
  - `childId` is exactly the node id the host received in the status snapshot
187
193
  (step `workflowKey`/`runId`/`step:<index>`, or a nested run id).
188
194
 
@@ -235,6 +241,8 @@ child stop API.
235
241
 
236
242
  The status/result fields are: `lifecycleArtifactVersion`, `runId`/`id`, `sessionId`, `mode`, `state`, `startedAt`, `lastUpdate`, `endedAt`, `durationMs`, `cwd`, `asyncDir`, `sessionFile`, `outputFile`, `workflowGraph`, `steps`, `results`, `totalTokens`, `totalCost`, `model`/`requestedModel`, `toolCount`, `turnCount`, optional `launchResolvedExtensions`, optional `runtimeAcknowledgedExtensions`, and nested `children` when a child is allowed to launch subagents.
237
243
 
244
+ A workflow child's own status adds `parentWorkflowRunId` and `workflowKey`. Use that pair to bind the child to its workflow. The child's `toolCallId` is a launch id the workflow host generates for that child, not the id of the parent tool call that started the workflow. While an async child runs, its session path is in `steps[0].sessionFile`; the top-level `sessionFile` is written when it completes.
245
+
238
246
  `requestedModel` records the launch's requested model (the explicit `--model` override, else the agent's configured model) before registry normalization.
239
247
 
240
248
  `launchResolvedExtensions` is parent-resolved launch intent only: it reports opaque extension identifiers and whether ambient extensions were disabled, without exposing raw extension paths or claiming the child runtime acknowledged that those extensions loaded.
@@ -82,6 +82,7 @@ The `subagent` tool schema lists `agent`, `task`, `workflow`, `args`, `async`, `
82
82
  | `options.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`. |
83
83
  | `model` | string | agent default | An exact `provider/id`; bare ids resolve only if unique, and agent names are not model ids. An unknown or ambiguous model fails with up to 5 closest registry ids to copy; `{action:"models"}` lists them all. 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`. |
84
84
  | `options.missionId` | string | - | Attach a workflow, including each fire of `schedule.create`, to an existing project mission. Scheduled attachment uses ordinary lifecycle and retention rules. |
85
+ | `options.reuseFrom` | string | - | Exact id of an async workflow run stopped by a runtime replacement (`workflow.stopCause: "runtime-replaced"`). An async relaunch of the same script in the same cwd, from any session, reuses that run's finished children and waits for its running ones; see [Workflows](workflows.md). |
85
86
  | `options.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. |
86
87
  | `options.handoffPath` | string | - | Aggregate handoff manifest for `action: "worktree.discard"` or lane evidence actions, or optional explicit metadata for `action: "worktree.cleanup"`. |
87
88
  | `options.repo` | string | runtime cwd | Repository path for `action: "worktree.cleanup"`; required explicitly for apply. The configured worktree base filters candidates by their per-project folder under it but never discovers them. |
@@ -131,7 +132,17 @@ Bound writer work with a narrow task and an outer `timeoutMs` or `maxRuntimeMs`
131
132
 
132
133
  Explicit `context: "fork"` fails fast when the parent session is not persisted, the current leaf is missing, or the branched child session cannot be created. By contrast, global `defaultSubagentContext: "fork"` and agent-level `defaultContext: fork` are preferences: when the parent has no persisted session file or current leaf yet, the launch uses `fresh` immediately instead of failing and requiring a retry. Global `defaultSubagentContext: "fresh"` starts fresh. Explicit `context: "fresh"` always wins over both preferences.
133
134
 
134
- When the inherited transcript contains signed Anthropic `thinking` / `redacted_thinking` blocks, `pi-subagents` strips those provider-private blocks from the forked child session: a thinking signature is bound to the session that produced it and cannot be replayed into a branch. The child keeps its requested thinking level and reasons fresh from its first turn; sanitizing the inherited transcript is not a downgrade. Explicit `context: "fork"` never silently downgrades to `fresh`.
135
+ A forked child keeps the inherited transcript as the parent sent it, signed Anthropic `thinking` blocks included: a signature covers its block's content, so a verbatim copy stays valid, and Pi replays a signed block only to the model that signed it. Raw `redacted_thinking` blocks, signed thinking in a `context_edit` replacement, and every signed or redacted Anthropic thinking block of a [pruned fork](configuration.md#forkcontext) are still removed. The child keeps its requested thinking level either way. Explicit `context: "fork"` never silently downgrades to `fresh`.
136
+
137
+ A forked child's requests start exactly as its parent's last request did, so the provider reads the whole inherited conversation from the parent's prompt cache:
138
+
139
+ - The child sends its parent's system prompt and tool declarations unchanged. Its own instructions (its agent prompt, the subagent boundary, structured-output rules, and the list of tools it can call) go in a `<subagent_instructions>` block at the start of its task message. Sections that describe a loadout (tools, rules, docs, skills, advertised subagents, MCP servers, project context) are not repeated there.
140
+ - A fork's prompt therefore includes the parent's base prompt, project and global context, skills (the bundled `pi-subagents` skill included), the parent's subagent catalog, and its list of running runs when that is shown. This holds even when the fork's agent sets `inheritProjectContext`, `inheritGlobalContext`, or `inheritSkills` to `false`, and `systemPromptMode: replace` does not remove the parent's base prompt: the agent prompt goes in the instructions block in both modes.
141
+ - A parent tool the child does not have stays declared, and calling it returns Pi's "not found" error without running anything. A tool only the child has is declared at the fork point. Models whose Pi `compat` sets `supportsMidConvoSystemMessages` and `supportsMidConvoToolChanges` take it there and keep the cache; others get it appended to the tool list, which changes the very start of the request and loses the cache. Give a fork agent no tool the parent lacks to keep its cache on those models.
142
+ - A tool the child defines differently under a parent tool's name, such as a `structured_output` with its own schema, is declared again at the fork point with the child's definition, so the model sees the schema the child's tool checks. Pi cannot redefine a tool in place, so that request sends the child's tool list and loses the cache.
143
+ - On Anthropic-style endpoints where Pi sends a session-affinity header, a child that runs on the model that wrote its inherited history sends its parent's session id, so a router with several upstreams sends it to the one that holds the parent's cache. A child on another model sends its own session id.
144
+ - A child on a different model than its parent gets each inherited thinking block as plain text, so the parent's reasoning is sent to that model's provider. Pi-shaped redacted thinking (`redacted: true` on a `thinking` block) is kept in a verbatim fork and replayed only to the model that wrote it.
145
+ - Another extension that returns a replacement `systemPrompt` from `before_agent_start` in the child replaces the parent's prompt and loses the cache. After a compaction in the child, no inherited message remains, so the child sends its own prompt with the boundary as a prompt section.
135
146
 
136
147
  In workflow runs that omit `context`, each `runs.run` child follows the global `defaultSubagentContext` when set, then its own `defaultContext`. Without the global setting, a fresh-default worker can run fresh beside a fork-default oracle. If the parent session file or current leaf is not available yet, implicit fork-default children run fresh. Pass explicit `context: "fork"` or `context: "fresh"` when you intentionally want one context for every child.
137
148
 
package/docs/workflows.md CHANGED
@@ -29,7 +29,9 @@ Stop and report the exact failure, run/status, and repository/cwd/worktree/branc
29
29
 
30
30
  Failed workflow details and async `status.json` include `workflow.failureKind` as `validation`, `script`, `child`, `return-serialization`, `timeout`, `detached-child`, or `runtime`. `validation` means the host rejected the script before it ran (syntax or portability) or at completion (unawaited calls); errors thrown into a running script, including rejected `runs.run` parameters and runtime `SyntaxError`s, are `script` because the script could catch them, and failed children are `child`. `runtime` covers host setup and infrastructure failures, such as an unavailable cwd or a crashed worker. A workflow that is stopped or reloaded is not a failure and has no `failureKind`.
31
31
 
32
- When `/reload`, a session resume, or a pi-web project switch replaces the extension runtime, a running async workflow stops with `workflow.stopCause: "runtime-replaced"` in `status.json`, and its awaited async children keep running. Its in-process foreground children are stopped, including ones that detached to ask their supervisor. When the same workflow script is launched again with the same `args` in that session, a `runs.run` with the same key and params returns a child that already finished successfully without launching it, and waits for a child that is still running instead of starting another. Those results carry `reused: true`, their step and trace entry are marked `reused`, and the new run records `workflow.reusedFrom`. Failed and stopped children, and children that ran in-process, launch again. Reuse applies only when the newest run of that script and args in the session was stopped this way; a user stop or a completed run ends it.
32
+ When `/reload`, a session resume, or a pi-web project switch replaces the extension runtime, a running async workflow stops with `workflow.stopCause: "runtime-replaced"` in `status.json`, and its awaited async children keep running. Its in-process foreground children are stopped, including ones that detached to ask their supervisor. When the same workflow script is launched again with the same `args` in that session, a `runs.run` with the same key and params returns a child that already finished successfully without launching it, and waits for a child that is still running instead of starting another. Those results carry `reused: true`, their step and trace entry are marked `reused`, and the new run records `workflow.reusedFrom`. Failed and stopped children, and children that ran in-process, launch again. Reuse applies only when the newest run of that script and args in the session was stopped this way; a user stop or a completed run ends it. From another session, such as one that took over after a handoff, relaunch the same script as an async workflow with `options: { reuseFrom: "<stopped run id>" }`; the run must have stopped this way in the same cwd, and `args` may differ, because each child is still reused only when its key and params match.
33
+
34
+ After `/new`, `/resume`, or a fork in the same Pi process, the new session owns the async runs of the session it replaced, and of the sessions that one replaced. It can list, `bg_wait` on, steer, stop, and resume them, receives their completion notices, and answers their children's pending supervisor requests. Over RPC, a host can steer, interrupt, stop, resume, and inspect them, and sees them in the fleet and `subagent-async` snapshots. Startup and other Pi processes inherit nothing; `/reload` adds nothing new but keeps what the session already inherited. To relaunch a stopped workflow instead of controlling its children one by one, use `options.reuseFrom`.
33
35
 
34
36
  Pi core may print a generic `pi -ne` extension-load hint; that out-of-repo hint is not protocol-approved fallback. A verified compaction abort may continue the retained child once on its already resolved model; it does not authorize an execution-mode or model switch.
35
37
 
@@ -67,7 +69,7 @@ Workflow-level child controls default onto each `runs.run`/`runs.all` launch; ex
67
69
 
68
70
  Child results cross into the script as plain JSON data. Non-JSON host metadata is omitted, so use returned fields such as `runId`, `ok`, `output`, and `structuredOutput` for workflow control.
69
71
 
70
- Omitting a child's `async` preserves awaited final-result semantics, even if the child runs in the background. Explicit child `async: true` intentionally returns after launch: its receipt has `state: "running"`, `ok: false`, an empty `output`, and no completion error or final `outputReference`. `ok` confirms successful child completion, not successful dispatch. Use `runId` and `asyncDir` to inspect the running child; `artifactPaths` may include runtime directories and is not a list of final reports. Reusing the same workflow key returns the same receipt, not a refreshed result.
72
+ Omitting a child's `async` preserves awaited final-result semantics, even if the child runs in the background. Explicit child `async: true` intentionally returns after launch: its receipt has `state: "running"`, `ok: false`, an empty `output`, and no completion error or final `outputReference`. `ok` confirms successful child completion, not successful dispatch. It does not confirm that the task's intent was carried out: a child that declines or cannot do the work can still end normally. When later steps depend on the work having happened, give the child an `outputSchema` with an explicit status field (and check `structuredOutput` in the script) or a host-run `gate`, and treat only that verdict as success. Use `runId` and `asyncDir` to inspect the running child; `artifactPaths` may include runtime directories and is not a list of final reports. Reusing the same workflow key returns the same receipt, not a refreshed result.
71
73
 
72
74
  A workflow can finish dispatch while these children remain running. Its summary and child rows identify that distinction, and launch receipts do not generate child-completion notices. Consume the later child result before treating its work or report as complete.
73
75
 
@@ -429,7 +431,7 @@ known, or for explicit emergency hotfix lanes.
429
431
 
430
432
  For watched same-repo workflows, pass `async:false` only when the parent must block until completion. That blocking mode also shows the live in-chat workflow card. `chatProgress` can force `off` or `live-card` when the automatic policy is not what you want. Blocking workflows default to a 30-minute timeout; async workflows have no default timeout. See the [tool reference](tool-reference.md) for the full parameter list.
431
433
 
432
- Synchronous workflows publish trace and `emit(...)` updates through the tool update callback regardless of `chatProgress`, including RPC/headless and cross-repository runs. These updates include `details.workflow` and `details.workflowChildren`; `chatProgress: "off"` disables the live card, not transport progress. Running foreground child rows additionally expose bounded `activity` (current tool, timing, and counters), plus resolved model/thinking when available, keyed by `childId`. Activity-only updates coalesce over 100 ms; lifecycle updates remain immediate. Activity clears when children settle, and is not persisted for async workflows. Tool names are limited to 256 UTF-8 bytes and each activity object is below 2 KiB (including JSON escaping); arguments and transcripts are not forwarded.
434
+ Synchronous workflows publish trace and `emit(...)` updates through the tool update callback regardless of `chatProgress`, including RPC/headless and cross-repository runs. These updates include `details.workflow` and `details.workflowChildren`; `chatProgress: "off"` disables the live card, not transport progress. Once a child launches, its running row carries its `agent` and `runId`; for a child running in the background, that `runId` is the id of its run node in the `subagent-async` snapshot. Running foreground child rows additionally expose bounded `activity` (current tool, timing, and counters), plus resolved model/thinking when available, keyed by `childId`. Activity-only updates coalesce over 100 ms; lifecycle updates remain immediate. Activity clears when children settle, and is not persisted for async workflows. Tool names are limited to 256 UTF-8 bytes and each activity object is below 2 KiB (including JSON escaping); arguments and transcripts are not forwarded.
433
435
 
434
436
  The workflow result text keeps the Return, Emitted, and Console sections, and a failed workflow's error, under 200 KB and 5000 lines, or under `maxOutput` when set. Each call-trace error is cut to 500 characters. A cut adds a `[TRUNCATED: ... - full output at <path>]` line. The full text goes to the workflow `output` file when one is set, otherwise to `<run>_workflow-result.md` in the run's artifacts directory, outside the `outputs/` tree where children save their reports. That file has the same retention as the other run artifacts: age-based cleanup removes it from temp and session artifact directories, and `artifactDir: "project"` files are kept. The status line, the rest of each trace line, warnings, and output-path mappings are never cut. Async completion notices and `action: "status"` show short previews; a cut preview or async error ends in `…` and names the run's `status.json`, which holds the full `workflow.value`, `workflow.emits`, and `error`.
435
437
 
@@ -451,7 +453,7 @@ const [api, ui] = await runs.all([
451
453
  return { api: api.artifactPaths, ui: ui.artifactPaths };
452
454
  ```
453
455
 
454
- Each child uses the existing worktree lifecycle: it branches from clean HEAD, journals ownership before launch, captures a patch and handoff manifest, then removes cleanly captured temporary worktrees and branches. The handoff manifest path remains available in the child's `artifactPaths`; return or emit it when the orchestrator needs to apply or inspect the patches. `runs.ref` stays concise and intentionally omits full paths.
456
+ Each child uses the existing worktree lifecycle: it branches from clean HEAD, journals ownership before launch, captures a patch and handoff manifest, then removes cleanly captured temporary worktrees and branches. The handoff manifest path remains available in the child's `artifactPaths`; return or emit it when the orchestrator needs to apply or inspect the patches. `worktree.cleanup` scans only the repository's project artifacts, so a workflow child's worktree is reported as unknown until you pass that manifest as `options.handoffPath`; worktrees of retained, resumable children are then kept rather than removed. `runs.ref` stays concise and intentionally omits full paths.
455
457
 
456
458
  A top-level `{ workflow: true, worktree: true }` makes isolation the default for every workflow child. An individual child can override that default with `worktree: false`. Keep one writer when parallel writes are not intentionally isolated.
457
459
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "pi-subagents",
4
- "version": "0.78.0",
4
+ "version": "0.79.1",
5
5
  "description": "Pi extension for single-agent delegation and scripted multi-agent workflows",
6
6
  "author": "Nico Bailon",
7
7
  "license": "MIT",
@@ -105,6 +105,7 @@ For an authorized complex delegated workflow, read `prompting-and-roles.md` and
105
105
  ## Operating rules
106
106
 
107
107
  - Avoid duplicate scouts, overlapping writers, and vague prompts without a concrete deliverable.
108
+ - Call `subagent`, `subagents_enable`, `subagent_supervisor`, `contact_supervisor`, and `structured_output` as ordinary model tool calls. They are model-only, so codemode scripts cannot reach them through `tools.*`, `ALL_TOOLS`, or `searchTools`.
108
109
  - Keep the parent on the ordinary strong default model. Route workers/scouts to a fast capable tier, serious reviews to a strong tier, and top reasoning to bounded read-only critique.
109
110
  - Exact model names are deployment policy. Put them in user/project settings or profiles, not package guidance.
110
111
  - Give every child a compact meta-prompt checklist: objective; repo/cwd/ref; authority/edit boundary; relevant files/contracts and constraints; success/acceptance criteria; validation; expected output/report; and stop/ask conditions. See `references/prompting-and-roles.md`.
@@ -558,4 +558,6 @@ subagent_supervisor({ action: "pending" })
558
558
 
559
559
  Native supervisor coordination does not expose generic `intercom` as a fallback. Use `subagent_supervisor` for parent replies.
560
560
 
561
+ `subagent`, `subagents_enable`, `subagent_supervisor`, `contact_supervisor`, and `structured_output` are model-only: call them as ordinary model tool calls. Codemode scripts cannot reach them through `tools.*`, `ALL_TOOLS`, or `searchTools`.
562
+
561
563
  If intercom messages do not show up, run `subagent({ action: "doctor" })` or `/subagents-doctor`.
@@ -1 +1 @@
1
- {"version":3,"file":"declaration-pinning.d.ts","sourceRoot":"","sources":["../../../src/extension/declaration-pinning.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAoB,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACtG,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAiJvC;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAExF;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,SAAS,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,cAAc,CAAC,OAAO,EAAE,QAAQ,CAAC,GAAG,IAAI,CAMrI;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,EAAE,EAAE,YAAY,EAAE,MAAM,EAAE,OAAO,GAAG,IAAI,CAE7E"}
1
+ {"version":3,"file":"declaration-pinning.d.ts","sourceRoot":"","sources":["../../../src/extension/declaration-pinning.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAoB,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACtG,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AA+JvC;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAExF;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,SAAS,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,cAAc,CAAC,OAAO,EAAE,QAAQ,CAAC,GAAG,IAAI,CAMrI;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,EAAE,EAAE,YAAY,EAAE,MAAM,EAAE,OAAO,GAAG,IAAI,CAE7E"}
@@ -1,10 +1,24 @@
1
1
  import { declarationsEqual, getCurrentSystemMessage, toToolDeclaration } from "@earendil-works/pi-ai";
2
2
  const pinsByApi = new WeakMap();
3
3
  const GUIDELINES_PLACEHOLDER = "\u0000pi-subagents guidelines";
4
+ /**
5
+ * A recorded description without the text a host appends to each declared tool, such as Pi's
6
+ * codemode note on script-callable tools. The host decorates whatever is registered, so reusing a
7
+ * decorated description would add the note again on every session start (#2889). Drops a repeated
8
+ * trailing paragraph, then a trailing paragraph added after the current description.
9
+ */
10
+ function undecorated(recorded, current) {
11
+ const paragraphs = recorded.split("\n\n");
12
+ while (paragraphs.length > 1 && paragraphs.at(-1) === paragraphs.at(-2))
13
+ paragraphs.pop();
14
+ const stripped = paragraphs.join("\n\n");
15
+ return stripped.startsWith(`${current}\n\n`) ? current : stripped;
16
+ }
4
17
  function pinnedDefinition(tool, pin) {
5
18
  const { constrainedSampling, promptSnippet, promptGuidelines, ...rest } = tool;
6
19
  // An unchanged declaration keeps the registered schema object rather than its JSON copy.
7
- const declaration = pin && !declarationsEqual(pin.declaration, tool) ? pin.declaration : undefined;
20
+ const recorded = pin ? { ...pin.declaration, description: undecorated(pin.declaration.description, rest.description) } : undefined;
21
+ const declaration = recorded && !declarationsEqual(recorded, tool) ? recorded : undefined;
8
22
  const definition = { ...rest, description: declaration?.description ?? rest.description, parameters: declaration?.parameters ?? rest.parameters };
9
23
  const sampling = declaration ? declaration.constrainedSampling : constrainedSampling;
10
24
  if (sampling !== undefined)
@@ -1 +1 @@
1
- {"version":3,"file":"declaration-pinning.js","sourceRoot":"","sources":["../../../src/extension/declaration-pinning.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,iB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EAYlB,MAAM,oBAAoB,CAAC;AAoI5B,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,aAAa,GAAG,cAAc,EAAE,CA6C7E;AAED,MAAM,CAAC,OAAO,UAAU,yBAAyB,CAAC,EAAE,EAAE,YAAY,GAAG,IAAI,CAy3BxE"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/extension/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAOH,OAAO,KAAK,EAAE,YAAY,EAAoC,MAAM,iCAAiC,CAAC;AAmCtG,OAAO,EAA6B,KAAK,cAAc,EAAE,MAAM,iCAAiC,CAAC;AA8BjG,OAAO,EAIN,KAAK,aAAa,EAYlB,MAAM,oBAAoB,CAAC;AAoI5B,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,aAAa,GAAG,cAAc,EAAE,CA6C7E;AAED,MAAM,CAAC,OAAO,UAAU,yBAAyB,CAAC,EAAE,EAAE,YAAY,GAAG,IAAI,CAw4BxE"}
@@ -24,6 +24,7 @@ import { registerRuntimeAgentEventListener } from "../agents/runtime-agent-event
24
24
  import { ensureAccessibleDir } from "../shared/accessible-dir.js";
25
25
  import { cleanupAllArtifactDirs, cleanupOldArtifacts, getArtifactsDir } from "../shared/artifacts.js";
26
26
  import { resolveCurrentSessionId } from "../shared/session-identity.js";
27
+ import { recordSessionReplacement } from "../shared/session-succession.js";
27
28
  import { getAgentDir } from "../shared/utils.js";
28
29
  import { isStaleExtensionContextError, MODEL_ONLY_TOOL, withCachedUiContext } from "../shared/extension-context.js";
29
30
  import { currentCompletionOwnerId } from "../shared/completion-owner.js";
@@ -553,6 +554,13 @@ export default function registerSubagentExtension(pi) {
553
554
  return undefined;
554
555
  return createSlashResultComponent(details, options, theme, config.mainWindowRenderer, config.foregroundDetachShortcut, () => state.lastUiContext?.ui.theme ?? theme);
555
556
  });
557
+ // Keep view-only reports in the transcript/RPC stream, but out of model context.
558
+ // SLASH_RESULT_TYPE carries delegated work and must remain model-visible.
559
+ pi.on("context", (event) => ({
560
+ messages: event.messages.filter((message) => message.role !== "custom"
561
+ || message.customType !== SLASH_TEXT_RESULT_TYPE
562
+ || message.details?.viewOnly !== true),
563
+ }));
556
564
  pi.registerMessageRenderer(SLASH_TEXT_RESULT_TYPE, (message, _options, _theme) => {
557
565
  const content = typeof message.content === "string"
558
566
  ? message.content
@@ -798,9 +806,10 @@ export default function registerSubagentExtension(pi) {
798
806
  state.widgetsSuspended = false;
799
807
  state.baseCwd = ctx.cwd;
800
808
  goalTurnId = 0;
801
- const previousRuntimeSessionId = state.currentSessionId;
802
- resultDeliveryOwnership.claimPredecessor(previousSessionFile, previousRuntimeSessionId);
803
809
  state.currentSessionId = resolveCurrentSessionId(ctx.sessionManager);
810
+ // Pi passes previousSessionFile only for new/resume/fork, after tearing that session down in this process.
811
+ if (previousSessionFile)
812
+ recordSessionReplacement(state.currentSessionId, previousSessionFile);
804
813
  state.supervisorOwnerSessionId = ctx.sessionManager.getSessionId() || null;
805
814
  transitionResultDelivery();
806
815
  owedResultRunIds.clear();
@@ -904,7 +913,6 @@ export default function registerSubagentExtension(pi) {
904
913
  modulePreloadTimer = undefined;
905
914
  asyncRetentionAbort.abort();
906
915
  stopResultWatcher();
907
- resultDeliveryOwnership.clear();
908
916
  completionNotifier.dispose();
909
917
  mainWatchdog.dispose();
910
918
  scheduledRunManager.stop();
@@ -993,7 +1001,12 @@ export default function registerSubagentExtension(pi) {
993
1001
  herdrStatusBridge.agentStarted();
994
1002
  programStatus.agentStarted();
995
1003
  });
996
- pi.on("message_start", (event) => completionNotifier.messageStarted(event.message));
1004
+ pi.on("message_start", (event) => {
1005
+ // Pi also compacts between turns of a running loop, with no agent_start after it. A message
1006
+ // starts only once that compaction has finished and its status indicator is cleared.
1007
+ resumeWidgetsAfterCompaction();
1008
+ completionNotifier.messageStarted(event.message);
1009
+ });
997
1010
  pi.on("agent_settled", () => {
998
1011
  resumeWidgetsAfterCompaction();
999
1012
  programStatus.agentSettled();
@@ -1084,6 +1097,8 @@ export default function registerSubagentExtension(pi) {
1084
1097
  pi.on("session_start", (_event, ctx) => beginAdvertisement(ctx));
1085
1098
  registerSubagentToolActivation(pi, {
1086
1099
  mode: config.toolActivation,
1100
+ // The channel's session_start poll already declared the reply tool for these; the replay must not drop it.
1101
+ hasPendingSupervisorRequest: () => [...supervisorChannel.pending.values()].some((request) => request.expectsReply),
1087
1102
  advertisedPrompt: async () => {
1088
1103
  await waitForAdvertisement();
1089
1104
  return buildAdvertisedAgentPrompt(advertisedAgents, resolveCurrentSubagentCapabilityCeiling(state.currentSessionId ?? undefined));