pi-subagents 0.86.0 → 0.88.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 (122) hide show
  1. package/CHANGELOG.md +59 -0
  2. package/bundle/agents.js +3 -3
  3. package/bundle/child-tool-plan.js +2 -2
  4. package/bundle/{chunk-PYOAIN3V.js → chunk-2DIEL4WG.js} +2 -2
  5. package/bundle/{chunk-GJGTMLPE.js → chunk-3DT5X2QC.js} +483 -477
  6. package/bundle/{chunk-374MZFF4.js → chunk-3MFYKBKI.js} +23 -13
  7. package/bundle/{chunk-ZJJCPV3L.js → chunk-47GJDBIK.js} +10 -6
  8. package/bundle/{chunk-77ASNIEM.js → chunk-47ZN7NKR.js} +1 -1
  9. package/bundle/{chunk-QGO6HXHG.js → chunk-4MVDMA5C.js} +88 -64
  10. package/bundle/{chunk-O3YH7XIY.js → chunk-4PM6RDE5.js} +46 -32
  11. package/bundle/{chunk-BWC2LVII.js → chunk-4UGWHREQ.js} +200 -64
  12. package/bundle/{chunk-3RKFH2UZ.js → chunk-6EUQPQY7.js} +31 -14
  13. package/bundle/{chunk-A637IMAO.js → chunk-6OWNDN7R.js} +2 -2
  14. package/bundle/{chunk-6VD7BGIC.js → chunk-6PR44R7E.js} +7 -2
  15. package/bundle/{chunk-7ZUFN6ME.js → chunk-CKLZ5FGU.js} +2 -2
  16. package/bundle/{chunk-ZPY5QZCS.js → chunk-CYKNHFXB.js} +1 -1
  17. package/bundle/{chunk-YK3QYNLE.js → chunk-GDR2ILWY.js} +1 -1
  18. package/bundle/{chunk-7QA7ZA46.js → chunk-IZEKQEY4.js} +9 -9
  19. package/bundle/{chunk-NAFLUJ26.js → chunk-KXW62VBU.js} +1 -1
  20. package/bundle/{chunk-S2Q75LP3.js → chunk-L4YY2TOE.js} +1 -1
  21. package/bundle/{chunk-QM3JGE4W.js → chunk-MTPICU4A.js} +12 -12
  22. package/bundle/{chunk-BU6PFPVX.js → chunk-PJSOS2Q4.js} +12 -7
  23. package/bundle/{chunk-UR7OW5S7.js → chunk-RHYVKQQL.js} +11 -5
  24. package/bundle/{chunk-BGXEAYUM.js → chunk-SVIXQDIV.js} +20 -5
  25. package/bundle/{chunk-7ADDXUGF.js → chunk-UVDLJXL6.js} +14 -5
  26. package/bundle/{chunk-NF7IEKBH.js → chunk-W2BZS6UC.js} +27 -13
  27. package/bundle/{chunk-5H4BICQZ.js → chunk-W6HIYD2Z.js} +1 -1
  28. package/bundle/{chunk-2IYBCYFU.js → chunk-XAOHLFJO.js} +174 -56
  29. package/bundle/{chunk-LGINOOY5.js → chunk-XIA5GSEU.js} +2 -2
  30. package/bundle/chunk-YDZ7BZD5.js +523 -0
  31. package/bundle/{chunk-WN2E5XHN.js → chunk-YZPVALSQ.js} +30 -5
  32. package/bundle/control-channel.js +2 -2
  33. package/bundle/index.js +1 -1
  34. package/bundle/intercom-bridge.js +2 -2
  35. package/bundle/preflight.js +12 -10
  36. package/bundle/project-panes.js +3 -3
  37. package/bundle/workflow-resources.js +1 -1
  38. package/docs/agents.md +4 -4
  39. package/docs/configuration.md +17 -5
  40. package/docs/extension-api.md +2 -0
  41. package/docs/models.md +6 -2
  42. package/docs/observability.md +2 -0
  43. package/docs/tool-reference.md +5 -1
  44. package/package.json +2 -2
  45. package/skills/pi-subagents/SKILL.md +15 -6
  46. package/skills/pi-subagents/references/prompting-and-roles.md +1 -0
  47. package/src/agents/agent-management.d.ts +1 -0
  48. package/src/agents/agent-management.js +22 -10
  49. package/src/agents/agent-serializer.d.ts +2 -0
  50. package/src/agents/agent-serializer.js +1 -1
  51. package/src/agents/agents.d.ts +1 -0
  52. package/src/agents/agents.js +39 -14
  53. package/src/api/preflight.d.ts +3 -1
  54. package/src/api/preflight.js +2 -0
  55. package/src/extension/config.d.ts +1 -0
  56. package/src/extension/config.js +6 -0
  57. package/src/extension/index.js +8 -5
  58. package/src/extension/schemas.d.ts +4 -0
  59. package/src/extension/schemas.js +2 -0
  60. package/src/extension/tool-activation.js +20 -3
  61. package/src/runs/background/async-execution.d.ts +2 -1
  62. package/src/runs/background/async-execution.js +4 -2
  63. package/src/runs/background/async-resume.js +2 -1
  64. package/src/runs/background/async-retention.d.ts +0 -2
  65. package/src/runs/background/async-retention.js +11 -5
  66. package/src/runs/background/async-status.d.ts +2 -0
  67. package/src/runs/background/async-status.js +4 -0
  68. package/src/runs/background/run-child-session.d.ts +2 -2
  69. package/src/runs/background/run-child-session.js +4 -7
  70. package/src/runs/background/runner-aliases.js +15 -0
  71. package/src/runs/background/steering.d.ts +2 -11
  72. package/src/runs/background/steering.js +11 -6
  73. package/src/runs/background/subagent-runner.d.ts +0 -2
  74. package/src/runs/background/subagent-runner.js +73 -58
  75. package/src/runs/background/wait-subscriptions.js +124 -12
  76. package/src/runs/foreground/async-steering-action.js +24 -9
  77. package/src/runs/foreground/async-stop-action.d.ts +1 -1
  78. package/src/runs/foreground/async-stop-action.js +9 -1
  79. package/src/runs/foreground/execution.js +33 -15
  80. package/src/runs/foreground/prompt-audit.js +1 -0
  81. package/src/runs/foreground/subagent-executor.d.ts +2 -8
  82. package/src/runs/foreground/subagent-executor.js +57 -23
  83. package/src/runs/shared/async-status-projection.d.ts +2 -0
  84. package/src/runs/shared/async-status-projection.js +10 -0
  85. package/src/runs/shared/child-session.d.ts +5 -4
  86. package/src/runs/shared/child-session.js +64 -36
  87. package/src/runs/shared/herdr-placed-run.js +3 -2
  88. package/src/runs/shared/mcp-config-sources.d.ts +4 -1
  89. package/src/runs/shared/mcp-config-sources.js +1 -1
  90. package/src/runs/shared/mcp-direct-tool-allowlist.d.ts +0 -3
  91. package/src/runs/shared/mcp-direct-tool-allowlist.js +26 -17
  92. package/src/runs/shared/model-resolution.d.ts +19 -4
  93. package/src/runs/shared/model-resolution.js +50 -51
  94. package/src/runs/shared/subagent-prompt-runtime.js +14 -2
  95. package/src/runs/shared/supervisor-wait-timer.d.ts +16 -0
  96. package/src/runs/shared/supervisor-wait-timer.js +61 -0
  97. package/src/shared/artifacts.d.ts +1 -0
  98. package/src/shared/artifacts.js +132 -22
  99. package/src/shared/pruned-fork.js +2 -2
  100. package/src/shared/reported-progress.d.ts +1 -0
  101. package/src/shared/reported-progress.js +12 -0
  102. package/src/shared/status-format.d.ts +1 -0
  103. package/src/shared/status-format.js +1 -1
  104. package/src/shared/types.d.ts +23 -0
  105. package/src/shared/utils.d.ts +3 -1
  106. package/src/shared/utils.js +4 -0
  107. package/src/tui/render.js +33 -2
  108. package/src/watchdog/model-selection.js +2 -2
  109. package/src/watchdog/permission-arbiter.js +1 -0
  110. package/src/watchdog/review.d.ts +0 -5
  111. package/src/watchdog/review.js +4 -3
  112. package/src/workflows/scripted-workflow.d.ts +2 -0
  113. package/src/workflows/scripted-workflow.js +103 -39
  114. package/src/workflows/structured-workflow-scripts.d.ts +4 -3
  115. package/src/workflows/structured-workflow-scripts.js +32 -11
  116. package/src/workflows/workflow-resources.js +4 -4
  117. package/src/workflows/workflow-resume-claim.d.ts +2 -0
  118. package/src/workflows/workflow-resume-claim.js +1 -1
  119. package/src/workflows/workflow-resume.d.ts +1 -1
  120. package/src/workflows/workflow-resume.js +3 -1
  121. package/src/workflows/workflow-script-worker.js +3 -1
  122. package/bundle/chunk-GRJHIXYF.js +0 -235
package/CHANGELOG.md CHANGED
@@ -2,6 +2,65 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.88.0] - 2026-11-10
6
+
7
+ ### Highlights
8
+
9
+ - The widget and `status` now show the latest progress a running child reported, with how long ago it reported.
10
+ - A child waiting for your answer no longer runs out its `timeoutMs` while it waits, and a reply cut off at the model's output limit now fails instead of passing as a success.
11
+ - Forked subagents stop filling the disk: their copies of the parent session are deleted once they go unused for `cleanupDays`.
12
+ - Big agent catalogs stay small in the conversation: `list` shows at most 30 agents and has a `search` filter.
13
+ - Fixes for pi Desktop workflow scripts, Windows machines that block PowerShell, disabled MCP servers, and gateways that require a prompt cache key.
14
+
15
+ ### Added
16
+
17
+ - The subagent widget shows the latest progress a running child reported with `contact_supervisor` (`progress_update`), with how long ago it reported, and `status` lists it on the child's line. Before, the report text was not shown anywhere in the parent. Thanks to [@kodfodrasz](https://github.com/kodfodrasz) for #3230.
18
+ - `{ action: "list" }` takes an `options.search` filter that matches agent names, descriptions and aliases. Thanks to [@peskycipher](https://github.com/peskycipher) for the report. (#3225)
19
+
20
+ ### Fixed
21
+
22
+ - A run's remaining `timeoutMs` budget no longer changes when the system clock is adjusted. Before, setting the clock back or forward during a run could add that much time to the budget or end the run early. Thanks to [@Osraka](https://github.com/Osraka) for #3247.
23
+ - A subagent run's `timeoutMs` no longer counts the time a child spends waiting for its supervisor to answer a `contact_supervisor` decision or interview, or an `intercom` ask. Before, a child that asked late in a run could time out while it waited, and the run was reported as failed even though the child did the right thing. Thanks to [@adrian-ludwig](https://github.com/adrian-ludwig) for #3228.
24
+ - A subagent whose final reply was cut off at the model's maximum output length now fails with "Response was truncated: the model reached its maximum output length." and keeps the partial reply for inspection. Before, the run was reported as a success with the cut-off text as its answer. A run that already returned a valid `structured_output` still succeeds. Thanks to [@adrian-ludwig](https://github.com/adrian-ludwig) for #3226.
25
+ - With `toolActivation: "auto"`, switching models before the first message now picks the subagent tools for the model you switched to. Before, the choice was made for the startup model, so a session that switched to a model that can't add tools mid-conversation kept the loader, and calling it later made the provider miss its prompt cache. Thanks to [@IdrisGit](https://github.com/IdrisGit) for #3241.
26
+ - A subagent's final acceptance report now reaches the parent intact. Before, a steer or follow-up queued while the child was finishing started another turn after the report, and the parent received that turn's text instead of the report. A steer the child rejects now stays rejected until you resume the child, instead of the child being restarted automatically. Thanks to [@adrian-ludwig](https://github.com/adrian-ludwig) for #3227.
27
+ - The bundled `undici` dependency is now 8.12.4, which fixes the security advisories published against 8.12.3 (cache and redirect information disclosure, credential stripping, a skipped integrity check, and an uncaught exception). Thanks to [@dzervas](https://github.com/dzervas) for the report. (#3242)
28
+ - On Windows machines where policy blocks `powershell.exe`, the cleanup of old background subagent state now finishes. Before, it stopped with `spawn UNKNOWN` and printed the error over the footer every session. A cleanup failure now shows as a warning in Pi instead of raw text over the screen. Thanks to [@SuperSalsa20](https://github.com/SuperSalsa20) for the report. (#3240)
29
+ - Subagents now skip `mcp:` selectors for pi-mcp-adapter servers explicitly configured with `disabled: true`. Before, a disabled server could prevent a child from launching. Unknown servers and enabled servers without matching cached tools still fail the launch. Thanks to [@shura-v](https://github.com/shura-v) for #3238.
30
+ - Workflow scripts start on hosts that run Pi on Electron, such as pi Desktop. Before, Electron left the sandbox flags in the script process's arguments and every workflow script failed with `Cannot find module '--allow-worker'`. Thanks to [@hotsnow-sean](https://github.com/hotsnow-sean) for #3222.
31
+ - A forked subagent (`context: "fork"`) launched in another folder than the parent session now gets that folder's `AGENTS.md` / `CLAUDE.md`. Before, it kept only the parent's project instructions, so a fork started in a repository worktree never saw the repository's `AGENTS.md`.
32
+ - The copies of the parent session that forked subagents write under `<parent session>/forks/` are now deleted once nothing has written to them for `artifactConfig.cleanupDays` (default 7) and their run is no longer active. Before, nothing deleted them; one parent session of about 400 MB filled 22 GB in a day with 57 forks. Resuming a child whose copy was deleted now says so. (#3232)
33
+ - `{ action: "list" }` now shows at most 30 agents and points to `options.search` for the rest. Before, it printed every agent with its full description, so a catalog of a few hundred agents put about 160 KB into the conversation in one call.
34
+ - In a non-interactive session (`pi -p`), Pi now waits for background subagent work at the end of a turn for as long as the `timeoutMs` setting allows a run to take. Before, it always gave up after 30 minutes, so a parent that ended its turn to wait for a longer child failed and exited before the child's result arrived. Without `timeoutMs`, the wait is still 30 minutes. Thanks to [@mt-huerta](https://github.com/mt-huerta) for #3229.
35
+ - The Watchdog's own model requests (reviews and permission decisions) and Prompt Audit's task rewrite now carry the parent session id, so providers that key prompt caching on it get a `prompt_cache_key`. Before, a gateway that requires one rejected every Watchdog review with HTTP 400. Thanks to [@hetingyi](https://github.com/hetingyi) for #3223.
36
+
37
+ ## [0.87.0] - 2026-11-07
38
+
39
+ ### Highlights
40
+
41
+ - You can stop a long workflow without losing the work already in progress: `stop` with `drain: true` starts nothing new, lets running children finish and keeps their results.
42
+ - A model written as `provider/id` now always runs on that provider, so a subagent can no longer quietly run on, and bill, another provider's copy of the model.
43
+ - One setting, `subagents.defaultInheritGlobalContext: true`, gives every subagent your global `AGENTS.md`.
44
+ - Old artifacts in nested folders are now cleaned up too, so session artifact folders stop growing.
45
+ - Several multi-window and multi-session fixes: wait notices reach the right window, and closing one session in a host like pi-web no longer stops another session's subagents.
46
+
47
+ ### Added
48
+
49
+ - `stop` with `drain: true` ends an async workflow without killing the children already running: it starts no new children, lets the running ones finish and report, then ends as stopped. Before, stopping a workflow killed them too. Thanks to [@nnayr](https://github.com/nnayr) for the report. (#3202)
50
+ - `subagents.defaultInheritGlobalContext: true` gives every subagent your global `~/.pi/agent/AGENTS.md`, without listing each agent in `agentOverrides`. An agent that sets `inheritGlobalContext: false` still opts out. Thanks to [@imagebuilder1837](https://github.com/imagebuilder1837) for the report. (#3206)
51
+
52
+ ### Fixed
53
+
54
+ - A subagent model written as `provider/id` now always runs on that provider. Before, if you were not signed in to that provider, a similar model from another provider (for example OpenRouter's copy of an Anthropic model) could run instead and bill that account. The launch now fails with an error that names the other provider's model, so you can choose it on purpose. The bundled skill also tells the parent to leave `model` out unless you or your settings name one. Thanks to [@crusaderky](https://github.com/crusaderky) for the report. (#3203)
55
+ - When a `parallel` workflow, `tasks` or `chain` item has a field it does not accept, the error now says how to keep what that field asked for. For `output`, it explains that `output` on the outer call writes one file per child, and that exact per-child paths need a workflow script with `runs.all`. For fields such as `worktree`, the error points to the outer call and says that no child was launched. Thanks to [@cash-flow-king](https://github.com/cash-flow-king) for the report. (#3207)
56
+ - `validate` now catches a `runs.lanes` lane that starts by resuming a finished run. It reports the same error the launch would give, so the script can be fixed before it runs. (#3210)
57
+ - `mcp:` selectors now resolve for pi-mcp-adapter servers that set `directTools: "search"` or use `${NAME:-default}` in their configuration. Before, pi-subagents dropped a `"search"` server from the configuration, and a `${NAME:-default}` value gave a server a different cache hash than the adapter computed. In both cases, every selector for the server was unresolved. A server URL that used a default also failed the launch. Thanks to [@acolomba](https://github.com/acolomba) for #3201.
58
+ - In a host that runs several Pi sessions in one process, such as pi-web, closing one session no longer stops subagents that another session started. Thanks to [@Jarcis-cy](https://github.com/Jarcis-cy) for #3204.
59
+ - When two Pi windows have the same session open, a background wait notice now reaches the window that asked for it, instead of whichever window checked first. If that window has closed, the next window that opens the session takes the notice over. Thanks to [@mdrkrg](https://github.com/mdrkrg) for #3205.
60
+ - Old subagent artifacts in nested folders, such as workflow child outputs under `outputs/`, are now removed after `artifactConfig.cleanupDays` like top-level ones. Before, cleanup only looked at the top level, so session artifact folders kept growing. Worktree handoff records and their patches are kept. (#3217)
61
+ - The configuration docs now explain how to turn on delegation in a session that was recorded before pi-subagents was installed. They also no longer say that `"toolActivation": "eager"` makes `subagent` active in every resumed session. Thanks to [@dapp-whisperer](https://github.com/dapp-whisperer) for #3218.
62
+ - On a Pi 1.5 install that is missing `@earendil-works/pi-schema` (seen in a NixOS package), a background subagent launch now fails right away with an error that names the missing package. Before, the launch was accepted and the child then exited with `Cannot find module '@earendil-works/pi-schema'` before its first turn. Thanks to [@Hifive55555](https://github.com/Hifive55555) for #3220.
63
+
5
64
  ## [0.86.0] - 2026-11-05
6
65
 
7
66
  ### Highlights
package/bundle/agents.js CHANGED
@@ -2,11 +2,11 @@ import {
2
2
  RUNTIME_AGENT_REGISTER_EVENT,
3
3
  RUNTIME_AGENT_REGISTER_VERSION,
4
4
  registerAgentViaEvents
5
- } from "./chunk-S2Q75LP3.js";
5
+ } from "./chunk-L4YY2TOE.js";
6
6
  import {
7
7
  registerRuntimeAgent
8
- } from "./chunk-NAFLUJ26.js";
9
- import "./chunk-QGO6HXHG.js";
8
+ } from "./chunk-KXW62VBU.js";
9
+ import "./chunk-4MVDMA5C.js";
10
10
  import "./chunk-JEZOSEWG.js";
11
11
  import "./chunk-YFCK7H2S.js";
12
12
  import "./chunk-QXASAHIA.js";
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  resolvePiLaunchToolPlan
3
- } from "./chunk-374MZFF4.js";
3
+ } from "./chunk-3MFYKBKI.js";
4
4
  import "./chunk-CTPAE36Y.js";
5
- import "./chunk-QGO6HXHG.js";
5
+ import "./chunk-4MVDMA5C.js";
6
6
  import "./chunk-JEZOSEWG.js";
7
7
  import "./chunk-YFCK7H2S.js";
8
8
  import "./chunk-QXASAHIA.js";
@@ -3,11 +3,11 @@ import {
3
3
  } from "./chunk-7J4ZXMY7.js";
4
4
  import {
5
5
  getProjectSubagentsDir
6
- } from "./chunk-GRJHIXYF.js";
6
+ } from "./chunk-YDZ7BZD5.js";
7
7
  import {
8
8
  getPiSpawnCommand,
9
9
  writeAtomicJson
10
- } from "./chunk-QGO6HXHG.js";
10
+ } from "./chunk-4MVDMA5C.js";
11
11
 
12
12
  // src/inspectors/herdr/project-panes.ts
13
13
  import * as fs from "node:fs";