@narumitw/pi-subagents 2.1.2 → 2.1.4
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/README.md +5 -33
- package/dist/index.ts +16 -0
- package/dist/index.ts.map +2 -2
- package/docs/implementation-notes/pi-subagents-rpc-v1.md +0 -14
- package/package.json +2 -2
- package/src/subagents-extension.ts +17 -0
- package/src/admission-benchmark.ts +0 -95
- package/src/async-subagent-benchmark.ts +0 -532
package/README.md
CHANGED
|
@@ -8,6 +8,11 @@ Use the built-in `explorer` for read-only evidence and `worker` for a clearly ow
|
|
|
8
8
|
|
|
9
9
|
The compatibility default exposes background and blocking methods, while **Keep Pi available (async)** is an optional smaller background-only surface.
|
|
10
10
|
|
|
11
|
+
> [!WARNING]
|
|
12
|
+
> `@narumitw/pi-subagents` 3.0.0 will replace this implementation with the bounded-job runtime currently developed as `pi-subagents-v3`.
|
|
13
|
+
> The release will remove `/subagents`, extension settings, local usage recording, the current `subagent` and underscore-named tool APIs, custom agent catalogs and per-agent configuration, retained conversations and messaging, persisted recovery, auto-resume completion, advanced orchestration and verification, alternate transports, trust-aware cwd policy, and extension-owned worktree isolation.
|
|
14
|
+
> It will instead expose `subagent-spawn`, `subagent-inspect`, `subagent-cancel`, `subagent-wait`, and `subagent-reply` for bounded background jobs.
|
|
15
|
+
|
|
11
16
|
## ✨ Features
|
|
12
17
|
|
|
13
18
|
- Provides blocking batches, detached reusable agents, read-only consultation, metadata inspection, and queue-only mailboxes.
|
|
@@ -1189,38 +1194,6 @@ Truncated text includes a `truncated by pi-subagents` marker and details expose
|
|
|
1189
1194
|
Inspection and consultation model-facing content also stops at 2,000 lines, whichever limit is reached first.
|
|
1190
1195
|
`PI_SUBAGENT_MAX_DEPTH` controls nested delegation depth and defaults to 1; child processes receive `PI_SUBAGENT_DEPTH` automatically.
|
|
1191
1196
|
|
|
1192
|
-
## 📡 Runtime status
|
|
1193
|
-
|
|
1194
|
-
Run the offline transport benchmark from the repository root when comparing startup overhead:
|
|
1195
|
-
|
|
1196
|
-
```bash
|
|
1197
|
-
just benchmark-subagents
|
|
1198
|
-
```
|
|
1199
|
-
|
|
1200
|
-
It reports serial median and median absolute deviation for deterministic fake fresh-subprocess and retained-RPC turns plus isolated real Pi RPC readiness, retained commands, in-process session creation, and retained in-process state access without making a provider request.
|
|
1201
|
-
Queue time starts when the registry accepts work, transport startup starts when execution begins, RPC readiness comes from `get_state`, RPC acceptance comes from the correlated `prompt` response, first activity comes from a bounded lifecycle event, settlement comes from `agent_settled`, and delivery is recorded after the parent accepts the completion message.
|
|
1202
|
-
Subprocess and in-process timing fields use the nearest public lifecycle boundary and may be coarser than RPC.
|
|
1203
|
-
Timing and progress are current-session diagnostics and are not persisted.
|
|
1204
|
-
The benchmark measures transport overhead rather than model latency or output quality.
|
|
1205
|
-
|
|
1206
|
-
Preview the paired quality benchmark without making provider requests:
|
|
1207
|
-
|
|
1208
|
-
```bash
|
|
1209
|
-
just benchmark-async-subagents --model provider/model
|
|
1210
|
-
```
|
|
1211
|
-
|
|
1212
|
-
Run three paired trials with isolated sync-only and async-only tool surfaces, fixed model and thinking settings, redacted raw records, and a hard per-trial deadline:
|
|
1213
|
-
|
|
1214
|
-
```bash
|
|
1215
|
-
just benchmark-async-subagents --run --mode quick --model provider/model --output /tmp/subagent-quick.json
|
|
1216
|
-
```
|
|
1217
|
-
|
|
1218
|
-
Use `--mode extended` for ten paired trials before any further sync deprecation decision.
|
|
1219
|
-
The runner alternates arm order, starts work deadlines only after RPC readiness, runs at most three pairs concurrently, and reports completion coverage, evidence score, premature finals, terminal outcomes, median and P95 latency, and cost when available.
|
|
1220
|
-
Quick mode targets completion within five minutes under normal provider capacity but reports external timeouts and entitlement failures rather than silently reducing the sample.
|
|
1221
|
-
Live results remain provider- and model-dependent evidence rather than deterministic CI or proof of causality.
|
|
1222
|
-
The synchronous `subagent` tool remains available whenever a quality gate fails or detached chain, fan-in, panel, or workflow compatibility is unmatched.
|
|
1223
|
-
|
|
1224
1197
|
While the `subagent` tool is running, `pi-subagents` publishes compact activity status with `ctx.ui.setStatus("subagents", "...")`.
|
|
1225
1198
|
Any statusline extension that reads Pi's generic extension status API can display it; no package-to-package dependency is required.
|
|
1226
1199
|
|
|
@@ -1311,7 +1284,6 @@ packages/pi-subagents/
|
|
|
1311
1284
|
│ ├── verification-harness.ts # Disposable deterministic check execution
|
|
1312
1285
|
│ ├── verification-receipt.ts # Strict executor-owned managed receipts
|
|
1313
1286
|
│ ├── verified-execution-benchmark.ts # Matched offline acceptance/cost fixture
|
|
1314
|
-
│ ├── async-subagent-benchmark.ts # Paired live-quality planning, scoring, and summaries
|
|
1315
1287
|
│ ├── workflow-tree-identity.ts # Bounded exact Git-visible tree identities
|
|
1316
1288
|
│ ├── integration-controller.ts # Fail-closed canonical integration admission
|
|
1317
1289
|
│ ├── adaptive-scheduler.ts # Dependency, capacity, budget, and conflict scheduling
|
package/dist/index.ts
CHANGED
|
@@ -1458,6 +1458,17 @@ function numericFields(record, fields) {
|
|
|
1458
1458
|
}
|
|
1459
1459
|
|
|
1460
1460
|
// src/subagents-extension.ts
|
|
1461
|
+
var VERSION_3_MIGRATION_WARNING = [
|
|
1462
|
+
"pi-subagents 3.0.0 will replace this runtime with the bounded-job design currently developed as pi-subagents-v3.",
|
|
1463
|
+
"The release will remove:",
|
|
1464
|
+
"\u2022 /subagents, extension settings, and local usage recording;",
|
|
1465
|
+
"\u2022 the current subagent tool and underscore-named lifecycle and consultation tools;",
|
|
1466
|
+
"\u2022 custom agent catalogs, per-agent model settings, and custom agent prompts;",
|
|
1467
|
+
"\u2022 retained conversations, follow-up turns, mailboxes, peer and nested messaging, persisted recovery, and auto-resume completion;",
|
|
1468
|
+
"\u2022 chains, fan-in, panels, workflow DAGs, dynamic scheduling, structured result contracts, and verification orchestration;",
|
|
1469
|
+
"\u2022 alternate transports, trust-aware cwd policy, and extension-owned worktree isolation.",
|
|
1470
|
+
"3.0.0 will instead expose subagent-spawn, subagent-inspect, subagent-cancel, subagent-wait, and subagent-reply for bounded background jobs."
|
|
1471
|
+
].join("\n");
|
|
1461
1472
|
function subagents_extension_default(pi, dependencies = {}) {
|
|
1462
1473
|
pi.registerMessageRenderer(SUBAGENT_COMPLETION_MESSAGE_TYPE, renderCompletionMessage);
|
|
1463
1474
|
const loadBlockingExecution = cachedModuleLoader(
|
|
@@ -1468,6 +1479,7 @@ function subagents_extension_default(pi, dependencies = {}) {
|
|
|
1468
1479
|
const settings = readSubagentSettings();
|
|
1469
1480
|
let currentSettings = settings;
|
|
1470
1481
|
let currentCatalog = "";
|
|
1482
|
+
let migrationWarningShown = false;
|
|
1471
1483
|
const blockingEnabled = settings?.blocking?.enabled !== false;
|
|
1472
1484
|
const statefulEnabled = settings?.stateful?.enabled !== false;
|
|
1473
1485
|
if (blockingEnabled) {
|
|
@@ -1482,6 +1494,10 @@ function subagents_extension_default(pi, dependencies = {}) {
|
|
|
1482
1494
|
...new Set([loadNotice, refreshedNotice].filter((value) => value !== void 0))
|
|
1483
1495
|
].join("\n");
|
|
1484
1496
|
if (notice) ctx.ui.notify(notice, "warning");
|
|
1497
|
+
if (ctx.hasUI && !migrationWarningShown) {
|
|
1498
|
+
migrationWarningShown = true;
|
|
1499
|
+
ctx.ui.notify(VERSION_3_MIGRATION_WARNING, "warning");
|
|
1500
|
+
}
|
|
1485
1501
|
currentCatalog = formatAgentCatalog(
|
|
1486
1502
|
discoverAgentCatalog(ctx.cwd, ctx.isProjectTrusted(), refreshedSettings)
|
|
1487
1503
|
).text;
|