pi-subagents 0.82.0 → 0.83.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 (93) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/README.md +1 -1
  3. package/bundle/agents.js +4 -4
  4. package/bundle/background-work.js +1 -1
  5. package/bundle/child-tool-plan.js +3 -3
  6. package/bundle/{chunk-7PCKZHR5.js → chunk-4BW55BTL.js} +6 -6
  7. package/bundle/{chunk-7IVSUMQQ.js → chunk-527E3D2J.js} +6 -6
  8. package/bundle/{chunk-NRQ75MGH.js → chunk-5ESXK62X.js} +40 -1076
  9. package/bundle/{chunk-ZQGSDHL6.js → chunk-6B4ITO2W.js} +8 -4
  10. package/bundle/{chunk-CIZQXJ5Q.js → chunk-7F5SK2U3.js} +39 -6
  11. package/bundle/{chunk-OYF6AFDY.js → chunk-BKFWQ642.js} +2 -2
  12. package/bundle/{chunk-ZLINIYTP.js → chunk-CDI3GMNV.js} +48 -32
  13. package/bundle/{chunk-GC4DSPMH.js → chunk-CGXWSNPA.js} +12 -18
  14. package/bundle/{chunk-SIJ4S3EN.js → chunk-CNLDYEH4.js} +12 -12
  15. package/bundle/{chunk-4SDU2BZX.js → chunk-CSSZRTKY.js} +2 -2
  16. package/bundle/{chunk-W2SZ22EM.js → chunk-CZTMUBUI.js} +10 -8
  17. package/bundle/{chunk-WVD4UEL4.js → chunk-HJJAVHFB.js} +28 -24
  18. package/bundle/{chunk-GJECHSAR.js → chunk-HLE22FSH.js} +2 -2
  19. package/bundle/{chunk-M2CTFYT3.js → chunk-HXVKGS33.js} +5 -5
  20. package/bundle/{chunk-5LFLVSTM.js → chunk-JEZOSEWG.js} +2 -0
  21. package/bundle/{chunk-YKEWIB4M.js → chunk-JHZ6DZ5M.js} +1 -1
  22. package/bundle/{chunk-B5EKXDHE.js → chunk-LDMXJIA6.js} +458 -657
  23. package/bundle/{chunk-43SCHIMD.js → chunk-MBDOYZ2V.js} +1 -1
  24. package/bundle/{chunk-XSWOTIA3.js → chunk-MHX22USZ.js} +1 -1
  25. package/bundle/{chunk-VH5OAWVG.js → chunk-OOFW75PV.js} +5 -5
  26. package/bundle/{chunk-RMQFMMAT.js → chunk-P2NCCTZP.js} +231 -10
  27. package/bundle/{chunk-NGGAFDL6.js → chunk-RZJN63GU.js} +12 -5
  28. package/bundle/{chunk-7YMXOYEU.js → chunk-TJQJ3MEA.js} +12 -11
  29. package/bundle/{chunk-5TYMSZX3.js → chunk-VTMNBPCQ.js} +2 -2
  30. package/bundle/{chunk-52UBALJL.js → chunk-WG2OTTAK.js} +2 -2
  31. package/bundle/{chunk-N2BN7BF5.js → chunk-XA3DY6UG.js} +7 -5
  32. package/bundle/{chunk-MHZ4G23A.js → chunk-XXKG3P2W.js} +9 -6
  33. package/bundle/{chunk-PLCCBLPY.js → chunk-Y3I6H6DV.js} +2 -2
  34. package/bundle/control-channel.js +3 -3
  35. package/bundle/index.js +1 -1
  36. package/bundle/intercom-bridge.js +3 -3
  37. package/bundle/preflight.js +9 -9
  38. package/bundle/project-panes.js +4 -4
  39. package/bundle/shared-types.js +1 -1
  40. package/docs/agents.md +6 -7
  41. package/docs/configuration.md +1 -1
  42. package/docs/extension-api.md +19 -4
  43. package/docs/observability.md +1 -0
  44. package/docs/tool-reference.md +1 -1
  45. package/package.json +1 -1
  46. package/skills/council-mode/SKILL.md +1 -4
  47. package/skills/pi-subagents/SKILL.md +130 -107
  48. package/skills/pi-subagents/references/orchestration.md +124 -0
  49. package/skills/pi-subagents/references/prompting-and-roles.md +96 -295
  50. package/src/agents/agent-management.js +8 -14
  51. package/src/agents/agent-serializer.js +1 -2
  52. package/src/agents/agents.js +19 -3
  53. package/src/api/background-work.d.ts +9 -6
  54. package/src/api/background-work.js +14 -7
  55. package/src/extension/index.js +4 -1
  56. package/src/extension/public-execution.d.ts +2 -2
  57. package/src/extension/public-execution.js +3 -3
  58. package/src/extension/reply-workflow-script.js +5 -3
  59. package/src/extension/rpc.js +3 -1
  60. package/src/extension/subagent-guide.js +1 -2
  61. package/src/extension/subagent-options.js +17 -4
  62. package/src/runs/background/async-execution.js +4 -1
  63. package/src/runs/background/async-job-tracker.js +2 -1
  64. package/src/runs/background/async-status.d.ts +2 -0
  65. package/src/runs/background/async-status.js +1 -1
  66. package/src/runs/background/auto-drain.js +2 -3
  67. package/src/runs/background/fleet-view.js +1 -1
  68. package/src/runs/background/run-child-session.js +22 -6
  69. package/src/runs/background/subagent-wait.d.ts +2 -1
  70. package/src/runs/background/subagent-wait.js +5 -2
  71. package/src/runs/background/terminal-run-index.d.ts +1 -0
  72. package/src/runs/background/terminal-run-index.js +40 -1
  73. package/src/runs/foreground/execution.js +22 -6
  74. package/src/runs/foreground/subagent-executor.js +2 -5
  75. package/src/runs/shared/child-launch.js +5 -2
  76. package/src/runs/shared/child-session.d.ts +6 -0
  77. package/src/runs/shared/child-session.js +20 -4
  78. package/src/runs/shared/herdr-machine.d.ts +2 -0
  79. package/src/runs/shared/herdr-machine.js +2 -0
  80. package/src/runs/shared/herdr-placed-run.js +11 -4
  81. package/src/runs/shared/subagent-prompt-runtime.js +11 -17
  82. package/src/shared/disabled-features.d.ts +3 -1
  83. package/src/shared/disabled-features.js +11 -3
  84. package/src/shared/types.d.ts +3 -1
  85. package/src/shared/types.js +2 -0
  86. package/src/tui/fleet.js +1 -0
  87. package/src/workflows/scripted-workflow.js +9 -1070
  88. package/workflow-script-worker.cjs +1067 -0
  89. package/skills/pi-subagents/references/constraints-and-recipes.md +0 -74
  90. package/skills/pi-subagents/references/execution-controls.md +0 -564
  91. package/skills/pi-subagents/references/management-authoring-rpc.md +0 -165
  92. package/skills/pi-subagents/references/multi-lane-orchestration.md +0 -61
  93. package/skills/pi-subagents/references/review-and-validation.md +0 -73
package/CHANGELOG.md CHANGED
@@ -2,6 +2,52 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.83.0] - 2026-10-25
6
+
7
+ ### Highlights
8
+
9
+ - Subagents no longer break your session's prompt cache on models that take system messages mid-conversation, so each turn after a subagent returns is cheaper and faster. A child that runs its own subagents keeps its cache too.
10
+ - Subagents that finished their work always report it: background runs no longer end as "exited with code 0 before writing a result", and foreground calls no longer hang when the child stops after its final reply.
11
+ - Children placed on another machine (a Rex tab, Rex over SSH, or a Herdr pane) launch instead of being refused, and workflows no longer crash on Windows standalone Pi builds.
12
+ - Extensions and editors that show subagent activity can refresh on a new event instead of polling, and `bg_wait` now waits for background jobs that other extensions report, such as surf-cli's.
13
+ - A typo in an agent override in settings, such as `modle` or a thinking level like `hgih`, now fails with a "Did you mean" hint instead of being ignored.
14
+
15
+ ### Added
16
+
17
+ - Extensions and editor integrations that show background subagent activity no longer need to poll for changes. A new `subagent:jobs-changed` event tells them to read `status` again whenever a background run starts, moves to its next step, reports progress, or finishes, including chain and parallel step changes that no event reported before. The RPC `ping` reply now lists it, along with the existing `subagent:async-started` event, and [extension-api.md](docs/extension-api.md#refresh-a-host-view-without-polling) shows how to use them. Thanks to [@raviy06](https://github.com/raviy06) for the proposal. (#3068)
18
+
19
+ ### Fixed
20
+
21
+ - On models that take system messages mid-conversation, the first request of every new turn after the first subagent notice missed the prompt cache, so most of the context was sent uncached again each turn. A child that had called `subagent` missed it on every later request. The way pi-subagents marked its notices and removed parent-only subagent history made Pi move every mid-conversation system message to the start of the prompt; both now leave those messages where they are. Thanks to [@adameq](https://github.com/adameq) for the report. (#3058, #3063)
22
+ - Background subagents that finished their work no longer end as "exited with code 0 before writing a result". When a child stopped after its final reply without reporting that it had settled, or when one of its extensions hung on shutdown, the background runner process exited with the result still unwritten. It now ends the child after its final reply, waits for any compaction that runs after that reply, and waits at most 5 seconds for shutdown handlers. A foreground subagent whose child stops the same way now returns its reply too, instead of the call never returning. Thanks to [@perriea](https://github.com/perriea). (#3051)
23
+ - Background jobs that other extensions report to `bg_wait`, such as surf-cli's or pi-agent-wait's, are now waited for in saved sessions. Before, `bg_wait` and the wait at the end of a `pi -p` run matched a job only when the extension named the session by its file path, so a job named by the session id was ignored and they returned while it was still running. Both forms are now accepted. Thanks to [@cad0p](https://github.com/cad0p) for the report. (#3071)
24
+ - With features turned off in `disabledFeatures`, every `guide` topic now starts with a notice listing what is disabled, and every section with a one-line pointer to that list, not only the `tool-reference` topic. Before, an agent reading the workflow guide with `workflow-scripts` disabled was taught `workflow: true` and `args`, and its call was rejected. With workflow scripts disabled, the notice also says to use the top-level `tasks` or `chain` fields instead. Thanks to [@jefftheai](https://github.com/jefftheai) for the report. (#3057)
25
+ - When text written after a tool call reaches Pi only as a summary, as happens through the Claude Agent SDK used by pi-claude-bridge, a lost ```` ```js workflow ```` block no longer means writing the script to a file first. The error now says to resend the source as `options: { script: "..." }`, which runs it directly. (#3056)
26
+ - A fresh child placed on a machine (a Rex tab, a Rex machine over SSH, or a Herdr pane) launches. Every such launch was refused with "does not support fork, resume, or revival" because each child is handed a local session file path, which placement read as a request to restore a transcript. Builtin agents with a tools list, such as `scout`, can be placed too: their required tools are checked against the tools the remote Pi activates. Forked context is still refused on a machine, and so is a resume that would place the child again, since a placed child's transcript stays on that machine. Thanks to [@honbolau](https://github.com/honbolau) for the report and [@isjiajia01](https://github.com/isjiajia01) for tracing it. (#3043)
27
+ - A misspelled field in a `subagents.agentOverrides` or `agentOverridesByProvider` entry, such as `modle`, was ignored; loading now fails with the settings file, the field, and the nearest known name (`Did you mean 'model'?`). An override's `thinking` must now be a known level (`off` through `max`) or `false`; a typo such as `hgih` used to be appended to the child's model id. Creating or updating an agent with the `subagent` tool now rejects such a level too, instead of writing it into the agent file. Thanks to [@isjiajia01](https://github.com/isjiajia01) for the report. (#3050)
28
+ - Creating an agent with `thinking: off`, or updating one to ` off ` with spaces, now saves `thinking: off` in the agent file. Before, the line was left out, so the agent used the default thinking level instead of none.
29
+ - `extensionBindings` now reach foreground children. Before, an extension in a foreground child saw no `PI_SUBAGENT_EXTENSION_BINDINGS`, or the bindings of the background child that launched it. A foreground child now gets its own bindings while its extensions load and run `session_start`, and the parent's environment is restored afterwards. Thanks to [@crisboarna](https://github.com/crisboarna). (#3049)
30
+ - Workflows no longer crash on Windows standalone Pi builds (Bun 1.3.14) once Bun's transpiler cache is warm. The workflow worker now starts from a file in the package. Thanks to [@temoc](https://github.com/temoc). (#3055)
31
+ - `subagent` calls from providers that send nested tool values as strings, such as `options: { capabilities: "true", timeoutMs: "120000" }`, no longer fail with "must be boolean" or "must be integer". Values inside `options` now get the same type conversion Pi already applies to top-level parameters. Thanks to [@5hiri](https://github.com/5hiri) for the report and [@isjiajia01](https://github.com/isjiajia01) for narrowing it down. (#3048)
32
+ - Child transcripts in `/subagents-fleet`, `subagent` status and inspect replies show each tool call's input (`[tool: bash {"command":"ls"}]`) instead of only the tool name. Thanks to [@kunkun9527](https://github.com/kunkun9527) for the report. (#3053)
33
+
34
+ ## [0.82.1] - 2026-10-24
35
+
36
+ ### Highlights
37
+
38
+ - A run with a damaged status file no longer hides your other runs from `/subagents-fleet` and status listings.
39
+ - The bundled skill costs about 3k tokens per use instead of 10.6k, and agents following it block on a child less often.
40
+ - On Opus 5.5, Sonnet 5.5 and Fable 5.1, a workflow launch that loses its script recovers on the next try instead of failing again.
41
+
42
+ ### Changed
43
+
44
+ - The bundled `pi-subagents` skill is about a quarter of its old size: about 3k tokens per use instead of 10.6k. It keeps the common calls, the workflow and resume examples, and the rules for when and how to delegate, and points to the `guide` sections for everything else instead of copying the reference docs. In testing, agents using it blocked on a child with `async: false` 2 times in 39 tasks instead of 10. `/council` no longer loads an extra 11k-token reference.
45
+ - On Claude 5.x models (Opus 5.5, Sonnet 5.5, Fable 5.1), text written after a tool call reaches Pi only as a short summary without code blocks, so a ```` ```js workflow ```` block written at that point is lost and `subagent({ workflow: true })` can't find it. The error now explains this and tells the agent to pass the script as a file for the rest of the turn, and the bundled skill tells these models to use a file from the start once the turn has made a tool call.
46
+
47
+ ### Fixed
48
+
49
+ - A recent background run whose `status.json` no longer parses, for example a file filled with NUL bytes, no longer stops `/subagents-fleet` and status listings from showing your other runs. The run is skipped with one warning, shown as a notice while `/subagents-fleet` is open, which repeats only if the file changes. Its files are left as they are, and asking for that run by id still reports the parse error. Thanks to [@ozand](https://github.com/ozand) for #3040 and #3041.
50
+
5
51
  ## [0.82.0] - 2026-10-24
6
52
 
7
53
  ### Highlights
package/README.md CHANGED
@@ -62,7 +62,7 @@ The extension ships with agents you can use immediately:
62
62
  | `researcher` | Web/docs research with sources and a concise research brief. Requires [pi-web-access in the child](docs/agents.md#web-research-prerequisites). |
63
63
  | `evidence-auditor` | Independently checks whether important research claims are supported by their sources. Requires [pi-web-access in the child](docs/agents.md#web-research-prerequisites). |
64
64
  | `worker` | Implementation work. Edits files, validates, escalates unapproved decisions instead of guessing. |
65
- | `reviewer` | Code review and small fixes against the task/plan, tests, edge cases, and simplicity. |
65
+ | `reviewer` | Read-only code review against the task/plan, tests, edge cases, and simplicity. |
66
66
  | `oracle` | A second opinion before acting. Challenges assumptions without editing. |
67
67
  | `delegate` | A lightweight general delegate that behaves close to the parent session. |
68
68
 
package/bundle/agents.js CHANGED
@@ -2,12 +2,12 @@ import {
2
2
  RUNTIME_AGENT_REGISTER_EVENT,
3
3
  RUNTIME_AGENT_REGISTER_VERSION,
4
4
  registerAgentViaEvents
5
- } from "./chunk-43SCHIMD.js";
5
+ } from "./chunk-MBDOYZ2V.js";
6
6
  import {
7
7
  registerRuntimeAgent
8
- } from "./chunk-YKEWIB4M.js";
9
- import "./chunk-CIZQXJ5Q.js";
10
- import "./chunk-5LFLVSTM.js";
8
+ } from "./chunk-JHZ6DZ5M.js";
9
+ import "./chunk-7F5SK2U3.js";
10
+ import "./chunk-JEZOSEWG.js";
11
11
  import "./chunk-YFCK7H2S.js";
12
12
  import "./chunk-Z7KVHQHL.js";
13
13
  export {
@@ -5,7 +5,7 @@ import {
5
5
  listBackgroundWorkWakeChannels,
6
6
  registerBackgroundWorkProvider,
7
7
  snapshotBackgroundWork
8
- } from "./chunk-N2BN7BF5.js";
8
+ } from "./chunk-XA3DY6UG.js";
9
9
  export {
10
10
  BACKGROUND_WORK_PROTOCOL_VERSION,
11
11
  BACKGROUND_WORK_REGISTRY_KEY,
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  resolvePiLaunchToolPlan
3
- } from "./chunk-4SDU2BZX.js";
3
+ } from "./chunk-CSSZRTKY.js";
4
4
  import "./chunk-CTPAE36Y.js";
5
- import "./chunk-CIZQXJ5Q.js";
6
- import "./chunk-5LFLVSTM.js";
5
+ import "./chunk-7F5SK2U3.js";
6
+ import "./chunk-JEZOSEWG.js";
7
7
  import "./chunk-YFCK7H2S.js";
8
8
  import "./chunk-Z7KVHQHL.js";
9
9
  export {
@@ -13,7 +13,7 @@ import {
13
13
  summarizeContextModes,
14
14
  utf8Tail,
15
15
  workflowPreflightLaneForRuntimeKey
16
- } from "./chunk-VH5OAWVG.js";
16
+ } from "./chunk-OOFW75PV.js";
17
17
  import {
18
18
  assertSafeNestedId,
19
19
  checkRecordedPidLiveness,
@@ -32,11 +32,11 @@ import {
32
32
  updateActiveRunIndex,
33
33
  validateModelResponseAliases,
34
34
  writeAsyncResultFile
35
- } from "./chunk-NRQ75MGH.js";
35
+ } from "./chunk-5ESXK62X.js";
36
36
  import {
37
37
  deliverStopRequest,
38
38
  stopInboxClosedPath
39
- } from "./chunk-OYF6AFDY.js";
39
+ } from "./chunk-BKFWQ642.js";
40
40
  import {
41
41
  SUBAGENT_STOPPED_MESSAGE,
42
42
  formatDuration,
@@ -47,10 +47,10 @@ import {
47
47
  validateAcceptanceInput,
48
48
  writeAtomicJson,
49
49
  writePrivateAtomicJson
50
- } from "./chunk-CIZQXJ5Q.js";
50
+ } from "./chunk-7F5SK2U3.js";
51
51
  import {
52
52
  DIRS
53
- } from "./chunk-5LFLVSTM.js";
53
+ } from "./chunk-JEZOSEWG.js";
54
54
  import {
55
55
  safeTerminalText,
56
56
  truncateDisplayText
@@ -292,7 +292,7 @@ function sessionMessageParts(record) {
292
292
  }
293
293
  if (entry.type === "toolCall" || entry.type === "tool_call") {
294
294
  const name = typeof entry.name === "string" ? entry.name : typeof entry.toolName === "string" ? entry.toolName : "tool";
295
- parts.push({ role, kind: "toolCall", name, text: `[tool: ${name}${entry.args === void 0 ? "" : ` ${stringifyJsonPreview(entry.args)}`}]` });
295
+ parts.push({ role, kind: "toolCall", name, text: `[tool: ${name}${entry.arguments === void 0 ? "" : ` ${stringifyJsonPreview(entry.arguments)}`}]` });
296
296
  continue;
297
297
  }
298
298
  if (entry.type === "toolResult" || entry.type === "tool_result") {
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  isTrustedRecordedSessionFile,
3
3
  resolveSubagentRunId
4
- } from "./chunk-7PCKZHR5.js";
4
+ } from "./chunk-4BW55BTL.js";
5
5
  import {
6
6
  agentStreamOptions,
7
7
  opencodeSessionHeaders,
8
8
  ownsRun,
9
9
  resolveAsyncResumeTarget
10
- } from "./chunk-VH5OAWVG.js";
10
+ } from "./chunk-OOFW75PV.js";
11
11
  import {
12
12
  currentCompletionOwnerId,
13
13
  listMissions,
@@ -16,12 +16,12 @@ import {
16
16
  reconcileAsyncRun,
17
17
  resolveAuthorityDecision,
18
18
  resolveMissionStoreLocation
19
- } from "./chunk-NRQ75MGH.js";
19
+ } from "./chunk-5ESXK62X.js";
20
20
  import {
21
21
  deliverInterruptRequest,
22
22
  queueRevivalBrief,
23
23
  requestAsyncSteer
24
- } from "./chunk-OYF6AFDY.js";
24
+ } from "./chunk-BKFWQ642.js";
25
25
  import {
26
26
  formatShellCommand
27
27
  } from "./chunk-7J4ZXMY7.js";
@@ -32,10 +32,10 @@ import {
32
32
  tryLease,
33
33
  writeAtomicJson,
34
34
  writePrivateAtomicJson
35
- } from "./chunk-CIZQXJ5Q.js";
35
+ } from "./chunk-7F5SK2U3.js";
36
36
  import {
37
37
  DIRS
38
- } from "./chunk-5LFLVSTM.js";
38
+ } from "./chunk-JEZOSEWG.js";
39
39
  import {
40
40
  previewDisplayText,
41
41
  safeTerminalText