pi-subagents 0.37.0 → 0.37.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.
- package/CHANGELOG.md +21 -0
- package/README.md +18 -8
- package/agents/planner.md +2 -1
- package/package.json +3 -3
- package/skills/pi-subagents/SKILL.md +18 -989
- package/skills/pi-subagents/references/constraints-and-recipes.md +256 -0
- package/skills/pi-subagents/references/execution-controls.md +411 -0
- package/skills/pi-subagents/references/management-authoring-rpc.md +140 -0
- package/skills/pi-subagents/references/prompting-and-roles.md +268 -0
- package/src/api/delegation.ts +3 -0
- package/src/extension/index.ts +14 -7
- package/src/extension/rpc.ts +25 -2
- package/src/extension/schemas.ts +2 -2
- package/src/extension/tool-description.ts +2 -2
- package/src/intercom/intercom-bridge.ts +5 -2
- package/src/runs/background/async-job-tracker.ts +19 -12
- package/src/runs/background/async-resume.ts +6 -5
- package/src/runs/background/notify.ts +3 -0
- package/src/runs/background/result-watcher.ts +9 -3
- package/src/runs/foreground/subagent-executor.ts +111 -46
- package/src/runs/shared/mcp-direct-tool-allowlist.ts +44 -11
- package/src/runs/shared/model-fallback.ts +8 -0
- package/src/runs/shared/task-intent.ts +1 -1
- package/src/shared/types.ts +14 -1
- package/src/slash/delegation-adapters.ts +5 -0
- package/src/tui/fleet-status.ts +62 -16
- package/src/tui/fleet.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,27 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [0.37.1] - 2026-07-27
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
- Added package-owned resume control to the extension RPC surface, including preserved revival metadata and native result-delivery controls. Thanks to @shaneconner for #656.
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
- Added a generous 30-minute foreground wall-clock timeout when neither the call nor selected agent provides `timeoutMs`/`maxRuntimeMs`. Explicit call values and agent timeout defaults remain authoritative.
|
|
12
|
+
- Split the bundled `pi-subagents` skill into a short router plus focused reference files to avoid truncation and unnecessary context loading. Thanks to @peedrr for #659.
|
|
13
|
+
- Added `fleetViewPlacement` so the persistent FleetView can be placed above or below the editor. Thanks to @rtbe for #660.
|
|
14
|
+
- Refreshed the bundled `pi-subagents` skill for 0.35–0.37 control and config surface: `/subagents`, `/subagents-stop`, `/subagents-watchdog`, `stop`/`append-step`, parallel `count`, watchdog overview, frontmatter `async`/`timeoutMs`/`turnBudget` defaults, `artifactDir`/`asyncWidget`, fresh/fork badges, and builtin worker/delegate ambient-tool boundaries.
|
|
15
|
+
|
|
16
|
+
### Fixed
|
|
17
|
+
- Suppressed redundant local completion notifications after acknowledged grouped intercom delivery, while preserving fallback notifications when relay delivery is unavailable. Thanks to @Wiandono for #662.
|
|
18
|
+
- Stopped the persistent FleetView from refreshing through a stale extension context after session replacement or reload. Thanks to @kylegl for #657.
|
|
19
|
+
- Invalidated the live Fleet inspector before timer-driven refreshes so cached transcript frames do not repeat stale headers. Thanks to @shaneconner for #661.
|
|
20
|
+
- Removed repository write tools from the bundled planner and marked it read-only so planning-only runs cannot modify project files while producing `plan.md`. Thanks to @DrunkenDonkey80 for #664.
|
|
21
|
+
- Kept async child model inheritance stable after parent continuation so background launches keep using the authenticated parent provider/model. Thanks to @DrunkenDonkey80 for #663.
|
|
22
|
+
- Accepted persisted async recovery descriptors that include the launch contract digest written by async execution. Thanks to @boadij for #654 and #652.
|
|
23
|
+
- Classified verification-only tasks that prohibit product/source/config files as read-only. Thanks to @git-geeky for #648.
|
|
24
|
+
- Matched pi-mcp-adapter metadata cache identity so valid direct MCP tools are not rejected as stale when tool filters, socket transport, URL interpolation, or command-backed secrets are configured. Thanks to @mattrobenolt for #649.
|
|
25
|
+
|
|
5
26
|
## [0.37.0] - 2026-07-25
|
|
6
27
|
|
|
7
28
|
### Added
|
package/README.md
CHANGED
|
@@ -272,9 +272,9 @@ To keep subagents inside a budget or compliance profile, enforce a model scope.
|
|
|
272
272
|
|
|
273
273
|
## Where running subagents show up
|
|
274
274
|
|
|
275
|
-
Foreground runs stream progress in the conversation while they run.
|
|
275
|
+
Foreground runs stream progress in the conversation while they run. They default to a generous 30-minute wall-clock timeout when neither the call nor the selected agent provides a timeout; explicit `timeoutMs`/`maxRuntimeMs` and agent defaults win.
|
|
276
276
|
|
|
277
|
-
Background runs keep working after control returns to you. Inspect active runs with `subagent({ action: "status" })`, or a specific run with `subagent({ action: "status", id: "..." })`. In the TUI, a persistent FleetView below the editor shows `main` plus active children with task, elapsed time, and token totals. When the focused editor is empty, use `↑`/`↓` or `j`/`k` to select a child and `Enter` to inspect it; normal editor input is never intercepted.
|
|
277
|
+
Background runs keep working after control returns to you. Inspect active runs with `subagent({ action: "status" })`, or a specific run with `subagent({ action: "status", id: "..." })`. In the TUI, a persistent FleetView below the editor by default shows `main` plus active children with task, elapsed time, and token totals. Set `fleetViewPlacement` to `"aboveEditor"` to move it above the editor. When the focused editor is empty, use `↑`/`↓` or `j`/`k` to select a child and `Enter` to inspect it; normal editor input is never intercepted.
|
|
278
278
|
|
|
279
279
|
`/subagents-fleet` opens the live, inspection-only fleet inspector with current-session foreground work, recent async children, structured Markdown/tool transcripts, and completed output/session paths. Use `↑`/`↓` or `j`/`k` to select a child, `Shift+K`/`Shift+J` to scroll one line, `PgUp`/`PgDn` to scroll one page, `x`/`Ctrl+O` to toggle tool details, `r` to refresh, and `Esc` to close. `Ctrl+Alt+F` opens the same inspector even while a foreground turn is active and slash input is queued. Without a TUI, `/subagents-fleet` retains the textual `subagent({ action: "status", view: "fleet" })` fallback. Mutations stay in explicit commands: run `/subagents-stop` and pick from the selector, or use `/subagents-stop <run-id>` / `subagent({ action: "stop", id: "..." })` when you already know the id. To inspect one background child in text, use `subagent({ action: "status", id: "...", view: "transcript" })`; add `index` for a specific child in a parallel or chain run.
|
|
280
280
|
|
|
@@ -294,7 +294,7 @@ Foreground and async runners share bounded child-protocol handling. A child JSON
|
|
|
294
294
|
|
|
295
295
|
The stable v1 status/result fields are `lifecycleArtifactVersion`, `runId`/`id`, `sessionId`, `mode`, `state`, `startedAt`, `lastUpdate`, `endedAt`, `durationMs`, `cwd`, `asyncDir`, `sessionFile`, `outputFile`, `workflowGraph`, `steps`, `results`, `totalTokens`, `totalCost`, `model`/`attemptedModels`/`modelAttempts`, `toolCount`, `turnCount`, and nested `children` when a child is allowed to launch subagents. `events.jsonl` records lifecycle transitions such as `subagent.run.started`, `subagent.step.started`, `subagent.step.completed`/`failed`/`paused`/`stopped`, control attention events, nested interrupt failures, and `subagent.run.completed`/`stopped`; run boundary events include the lifecycle artifact version. Consumers should read these JSON files instead of scraping terminal output; unknown fields and event types should be ignored for forward compatibility.
|
|
296
296
|
|
|
297
|
-
Other Pi extensions can use the versioned in-process event-bus RPC instead of scraping slash output or calling internal modules. Listen for `subagents:rpc:v1:ready`, send requests on `subagents:rpc:v1:request`, and read replies from `subagents:rpc:v1:reply:<requestId>`. The `ping` capability metadata also advertises `events.asyncComplete` for exact process-local completion correlation after RPC `spawn`.
|
|
297
|
+
Other Pi extensions can use the versioned in-process event-bus RPC instead of scraping slash output or calling internal modules. Listen for `subagents:rpc:v1:ready`, send requests on `subagents:rpc:v1:request`, and read replies from `subagents:rpc:v1:reply:<requestId>`. The `ping` capability metadata also advertises `events.asyncComplete` for exact process-local completion correlation after RPC `spawn`. Delegation v1/v2 progress updates carry `runId` as soon as foreground execution allocates it, so a caller can retain the package-owned revival target even if its own tool turn is interrupted before the terminal response.
|
|
298
298
|
|
|
299
299
|
```typescript
|
|
300
300
|
const requestId = crypto.randomUUID();
|
|
@@ -310,7 +310,7 @@ pi.events.emit("subagents:rpc:v1:request", {
|
|
|
310
310
|
});
|
|
311
311
|
```
|
|
312
312
|
|
|
313
|
-
The v1 methods are `ping`, `status`, `spawn`, `steer`, `interrupt`, and `
|
|
313
|
+
The v1 methods are `ping`, `status`, `spawn`, `steer`, `interrupt`, `stop`, and `resume`. `status`, `steer`, `interrupt`, and `resume` reuse the normal package-owned actions. `steer` requires an async run `id` (plus optional child `index`) and a non-empty `message`; its reply preserves the normal acknowledged-delivery result. RPC steering disables the direct tool's pause-and-revive recovery so an extension keeps authority over the exact child it spawned; `ping.capabilities.nonRecoveringSteer` advertises this guarantee. `resume` requires a run target and non-empty `message`; it delegates to the existing revival path, which validates current-session ownership, persisted session/recovery metadata, stopped/live state, capability ceilings, and the exclusive session lease before returning the new async run details. Callers may request a `file-only` output path for the revived result without overriding its model, tools, or budgets. `ping.capabilities.resume` advertises this seam. `spawn` is async-only: omit `async` or set `async: true`, omit `clarify` or set `clarify: false`, and do not pass management `action` values. It goes through the same executor as the `subagent` tool, so agent discovery, validation, session attribution, configured spawn caps, child-safety depth, artifacts, and async status all behave the same. `stop` targets current-session top-level async runs through the stop control channel and records a `stopped` lifecycle instead of reporting a timeout.
|
|
314
314
|
|
|
315
315
|
`pi.events` is in-process only. It does not reach separate Pi processes or child subagents; use the file lifecycle artifacts or `pi-intercom` for cross-process coordination.
|
|
316
316
|
|
|
@@ -791,7 +791,7 @@ Important fields:
|
|
|
791
791
|
| `defaultReads` | Files to read before running in chain/parallel behavior. |
|
|
792
792
|
| `defaultProgress` | Maintain `progress.md`. |
|
|
793
793
|
| `async` | Default a single-agent launch to background (`true`) or foreground (`false`) when the call omits `async`. Explicit call values and `forceTopLevelAsync` win. |
|
|
794
|
-
| `timeoutMs` | Positive integer default runtime deadline in milliseconds for single-agent launches.
|
|
794
|
+
| `timeoutMs` | Positive integer default runtime deadline in milliseconds for single-agent launches. Foreground launches use 30 minutes when neither the call nor agent provides a timeout; explicit `timeoutMs`/`maxRuntimeMs` and agent defaults win. |
|
|
795
795
|
| `turnBudget` | JSON object default such as `{"maxTurns":20,"graceTurns":2}` for single-agent launches. An explicit call value wins, followed by this agent default, then global `turnBudget` config. |
|
|
796
796
|
| `acceptance` | Acceptance default for single-agent launches. Use a scalar level such as `checked` or an inline/block YAML map such as `{ level: "none", reason: "lightweight lookup" }`. Explicit call values win; chain and parallel acceptance remains task/step configuration. |
|
|
797
797
|
| `acceptanceRole` | Optional `read-only` or `writer` role for automatic acceptance inference. Explicit task mutation or no-edit intent wins; otherwise the declared role replaces agent-name guessing. This does not grant or revoke tools. |
|
|
@@ -1382,7 +1382,7 @@ Agent definitions are not loaded into context by default. Management actions let
|
|
|
1382
1382
|
| `clarify` | boolean | false | Show TUI preview/edit flow. Explicit `clarify: true` keeps the run foreground for the clarify UI. |
|
|
1383
1383
|
| `agentScope` | `user \| project \| both` | `both` | Agent discovery scope. Project wins on collisions. |
|
|
1384
1384
|
| `async` | boolean | false | Background execution. For chains, `clarify: true` explicitly keeps the run foreground for the clarify UI. |
|
|
1385
|
-
| `timeoutMs` / `maxRuntimeMs` | number | none | Optional run-level max runtime in milliseconds
|
|
1385
|
+
| `timeoutMs` / `maxRuntimeMs` | number | 30 min foreground; none async | Optional run-level max runtime in milliseconds. Foreground uses 30 minutes only when neither the call nor selected agent provides a timeout. |
|
|
1386
1386
|
| `turnBudget` | object | none | Optional assistant-turn budget `{ maxTurns, graceTurns }`. At `maxTurns` the child is warned to wrap up. After the grace window (default 1), termination occurs at the next assistant boundary; a response that starts tool work records `termination-deferred` until a later boundary. Partial output is returned on abort. |
|
|
1387
1387
|
| `toolBudget` | object | none | Optional child tool-call budget `{ soft?, hard, block? }`. At `soft` the child is nudged to finalize. After `hard`, configured tools are blocked; `block` defaults to `read`, `grep`, `find`, and `ls`, while `"*"` blocks every tool call. Final assistant text is never blocked. |
|
|
1388
1388
|
| `cwd` | string | runtime cwd | Override working directory. |
|
|
@@ -1495,7 +1495,15 @@ Makes top-level calls use background execution when the request does not explici
|
|
|
1495
1495
|
{ "fleetView": false }
|
|
1496
1496
|
```
|
|
1497
1497
|
|
|
1498
|
-
Controls the persistent, navigable FleetView
|
|
1498
|
+
Controls the persistent, navigable FleetView. The default is `true`. Set it to `false` to hide FleetView without disabling status tracking, completion notifications, `/subagents-fleet`, or lifecycle events.
|
|
1499
|
+
|
|
1500
|
+
### `fleetViewPlacement`
|
|
1501
|
+
|
|
1502
|
+
```json
|
|
1503
|
+
{ "fleetViewPlacement": "aboveEditor" }
|
|
1504
|
+
```
|
|
1505
|
+
|
|
1506
|
+
Places the persistent FleetView either `"belowEditor"` or `"aboveEditor"`. The default is `"belowEditor"`; invalid values fall back to `"belowEditor"`.
|
|
1499
1507
|
|
|
1500
1508
|
### `asyncWidget`
|
|
1501
1509
|
|
|
@@ -1600,7 +1608,8 @@ Overrides the command used to launch child Pi processes. Package wrappers can se
|
|
|
1600
1608
|
{
|
|
1601
1609
|
"intercomBridge": {
|
|
1602
1610
|
"mode": "always",
|
|
1603
|
-
"instructionFile": "./intercom-bridge.md"
|
|
1611
|
+
"instructionFile": "./intercom-bridge.md",
|
|
1612
|
+
"resultDelivery": true
|
|
1604
1613
|
}
|
|
1605
1614
|
}
|
|
1606
1615
|
```
|
|
@@ -1611,6 +1620,7 @@ Fields:
|
|
|
1611
1620
|
|
|
1612
1621
|
- `mode`: default `always`; use `fork-only` to inject only for forked runs, or `off` to disable the bridge.
|
|
1613
1622
|
- `instructionFile`: optional Markdown template replacing the default bridge instructions. `{orchestratorTarget}` is interpolated. Relative paths resolve from `~/.pi/agent/extensions/subagent/`.
|
|
1623
|
+
- `resultDelivery`: default `true`; attempts acknowledged grouped completion delivery through an external `subagent:result-intercom` listener. Set `false` when native parent notifications own completion delivery. Supervisor asks/progress remain active, and genuine enabled-transport acknowledgement failures remain visible.
|
|
1614
1624
|
|
|
1615
1625
|
Bridge activation requires a targetable current parent session id, which `pi-subagents` passes to children automatically. It no longer depends on an external `pi-intercom` installation or per-agent extension allowlists.
|
|
1616
1626
|
|
package/agents/planner.md
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: planner
|
|
3
3
|
description: Creates implementation plans from context and requirements
|
|
4
|
-
tools: read, grep, find, ls,
|
|
4
|
+
tools: read, grep, find, ls, intercom
|
|
5
5
|
thinking: high
|
|
6
|
+
acceptanceRole: read-only
|
|
6
7
|
systemPromptMode: replace
|
|
7
8
|
inheritProjectContext: true
|
|
8
9
|
inheritSkills: false
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-subagents",
|
|
3
|
-
"version": "0.37.
|
|
3
|
+
"version": "0.37.1",
|
|
4
4
|
"description": "Pi extension for delegating tasks to subagents with chains, parallel execution, and TUI clarification",
|
|
5
5
|
"author": "Nico Bailon",
|
|
6
6
|
"license": "MIT",
|
|
@@ -45,8 +45,8 @@
|
|
|
45
45
|
"scripts": {
|
|
46
46
|
"test": "npm run test:unit",
|
|
47
47
|
"test:unit": "node --experimental-strip-types --test test/unit/*.test.ts",
|
|
48
|
-
"test:integration": "node --experimental-
|
|
49
|
-
"test:e2e": "node --experimental-
|
|
48
|
+
"test:integration": "node --experimental-strip-types --import ./test/support/register-loader.mjs --test test/integration/*.test.ts",
|
|
49
|
+
"test:e2e": "node --experimental-strip-types --import ./test/support/register-loader.mjs --test test/e2e/*.test.ts",
|
|
50
50
|
"test:all": "npm run test:unit && npm run test:integration && npm run test:e2e"
|
|
51
51
|
},
|
|
52
52
|
"pi": {
|