pi-subagents 0.82.0 → 0.82.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 (37) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/README.md +1 -1
  3. package/bundle/{chunk-GC4DSPMH.js → chunk-3JCDWF4V.js} +3 -3
  4. package/bundle/{chunk-NRQ75MGH.js → chunk-46XKCPJR.js} +33 -3
  5. package/bundle/{chunk-M2CTFYT3.js → chunk-4Y2ROR7L.js} +3 -3
  6. package/bundle/{chunk-VH5OAWVG.js → chunk-6XJB7PIX.js} +2 -2
  7. package/bundle/{chunk-7PCKZHR5.js → chunk-FXUXCX2K.js} +2 -2
  8. package/bundle/{chunk-7YMXOYEU.js → chunk-G4GZD3OJ.js} +7 -6
  9. package/bundle/{chunk-WVD4UEL4.js → chunk-IVAE5Z6Q.js} +12 -12
  10. package/bundle/{chunk-SIJ4S3EN.js → chunk-JYUKW2SY.js} +5 -5
  11. package/bundle/{chunk-7IVSUMQQ.js → chunk-PBK2I7WY.js} +3 -3
  12. package/bundle/{chunk-MHZ4G23A.js → chunk-PDZWJCHD.js} +1 -1
  13. package/bundle/{chunk-B5EKXDHE.js → chunk-QE4AGIMG.js} +11 -10
  14. package/bundle/{chunk-NGGAFDL6.js → chunk-UCPP4GNU.js} +1 -1
  15. package/bundle/{chunk-ZQGSDHL6.js → chunk-UTT254JE.js} +1 -1
  16. package/bundle/{chunk-W2SZ22EM.js → chunk-VSUSLDNW.js} +2 -2
  17. package/bundle/{chunk-ZLINIYTP.js → chunk-ZIV4J4HG.js} +6 -7
  18. package/bundle/index.js +1 -1
  19. package/bundle/preflight.js +2 -2
  20. package/docs/agents.md +6 -7
  21. package/package.json +1 -1
  22. package/skills/council-mode/SKILL.md +1 -4
  23. package/skills/pi-subagents/SKILL.md +130 -107
  24. package/skills/pi-subagents/references/orchestration.md +124 -0
  25. package/skills/pi-subagents/references/prompting-and-roles.md +96 -295
  26. package/src/extension/reply-workflow-script.js +5 -2
  27. package/src/extension/subagent-guide.js +1 -2
  28. package/src/runs/background/async-status.d.ts +2 -0
  29. package/src/runs/background/async-status.js +1 -1
  30. package/src/runs/background/terminal-run-index.d.ts +1 -0
  31. package/src/runs/background/terminal-run-index.js +40 -1
  32. package/src/tui/fleet.js +1 -0
  33. package/skills/pi-subagents/references/constraints-and-recipes.md +0 -74
  34. package/skills/pi-subagents/references/execution-controls.md +0 -564
  35. package/skills/pi-subagents/references/management-authoring-rpc.md +0 -165
  36. package/skills/pi-subagents/references/multi-lane-orchestration.md +0 -61
  37. package/skills/pi-subagents/references/review-and-validation.md +0 -73
package/CHANGELOG.md CHANGED
@@ -2,6 +2,23 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.82.1] - 2026-10-24
6
+
7
+ ### Highlights
8
+
9
+ - A run with a damaged status file no longer hides your other runs from `/subagents-fleet` and status listings.
10
+ - The bundled skill costs about 3k tokens per use instead of 10.6k, and agents following it block on a child less often.
11
+ - 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.
12
+
13
+ ### Changed
14
+
15
+ - 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.
16
+ - 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.
17
+
18
+ ### Fixed
19
+
20
+ - 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.
21
+
5
22
  ## [0.82.0] - 2026-10-24
6
23
 
7
24
  ### 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
 
@@ -15,15 +15,15 @@ import {
15
15
  resolveCurrentSessionId,
16
16
  resolveWatchdogReviewModel,
17
17
  startWatchdogDiffBaselineCapture
18
- } from "./chunk-W2SZ22EM.js";
18
+ } from "./chunk-VSUSLDNW.js";
19
19
  import {
20
20
  MODEL_ONLY_TOOL,
21
21
  agentStreamOptions,
22
22
  opencodeSessionHeaders
23
- } from "./chunk-VH5OAWVG.js";
23
+ } from "./chunk-6XJB7PIX.js";
24
24
  import {
25
25
  inheritedNestedRouteOf
26
- } from "./chunk-NRQ75MGH.js";
26
+ } from "./chunk-46XKCPJR.js";
27
27
  import {
28
28
  CHILD_WATCHDOG_STATUS_EVENT,
29
29
  MISSING_STRUCTURED_ACCEPTANCE_REPORT_ERROR,
@@ -109,6 +109,28 @@ var TOOL_CALL_INDEX_DIR = "@tool-calls";
109
109
  function isTerminalState(state) {
110
110
  return state === "complete" || state === "failed" || state === "partial" || state === "paused" || state === "stopped" || state === "rejected";
111
111
  }
112
+ function isCorruptStatusError(error, statusPath) {
113
+ const message = error instanceof Error ? error.message : String(error);
114
+ return message.startsWith(`Failed to parse async status file '${statusPath}'`) || message.startsWith(`Failed to validate async status file '${statusPath}'`);
115
+ }
116
+ var reportedCorruptTerminalStatus = /* @__PURE__ */ new Map();
117
+ function warnCorruptTerminalStatus(runId, statusPath, error, onCorruptStatus) {
118
+ let fileSignature = "unavailable";
119
+ try {
120
+ const stat = fs.statSync(statusPath);
121
+ fileSignature = `${stat.size}:${stat.mtimeMs}:${stat.ctimeMs}:${stat.ino}`;
122
+ } catch (statError) {
123
+ if (statError.code !== "ENOENT") throw statError;
124
+ }
125
+ const message = error instanceof Error ? error.message : String(error);
126
+ const signature = `${fileSignature}
127
+ ${message}`;
128
+ if (reportedCorruptTerminalStatus.get(statusPath) === signature) return;
129
+ reportedCorruptTerminalStatus.set(statusPath, signature);
130
+ const warning = `Skipping indexed terminal run '${runId}' with corrupt status at '${statusPath}': ${message}`;
131
+ if (onCorruptStatus) onCorruptStatus(warning);
132
+ else console.error(`[pi-subagents] ${warning}`);
133
+ }
112
134
  function indexRoot(asyncDirRoot) {
113
135
  return path2.join(asyncDirRoot, TERMINAL_RUN_INDEX_DIR);
114
136
  }
@@ -221,7 +243,15 @@ function readRecentTerminalRunIndex(asyncDirRoot, options = {}) {
221
243
  continue;
222
244
  }
223
245
  const asyncDir = path2.join(asyncDirRoot, entry.runId);
224
- const status = readStatus(asyncDir);
246
+ const statusPath = path2.join(asyncDir, "status.json");
247
+ let status;
248
+ try {
249
+ status = readStatus(asyncDir);
250
+ } catch (error) {
251
+ if (!isCorruptStatusError(error, statusPath)) throw error;
252
+ warnCorruptTerminalStatus(entry.runId, statusPath, error, options.onCorruptStatus);
253
+ continue;
254
+ }
225
255
  if (!status || !isTerminalState(status.state) || status.sessionId !== entry.sessionId || status.runId && status.runId !== entry.runId) {
226
256
  removeInvalidMarker(marker);
227
257
  continue;
@@ -1936,7 +1966,7 @@ async function executeWorkflowHostCommand(input) {
1936
1966
  }
1937
1967
 
1938
1968
  // src/workflows/scripted-workflow.ts
1939
- import { accessSync, constants as constants2, readFileSync as readFileSync6, realpathSync as realpathSync3, statSync as statSync3 } from "node:fs";
1969
+ import { accessSync, constants as constants2, readFileSync as readFileSync6, realpathSync as realpathSync3, statSync as statSync4 } from "node:fs";
1940
1970
  import { createRequire } from "node:module";
1941
1971
  import { dirname as dirname6, resolve as resolvePath } from "node:path";
1942
1972
  import { Worker } from "node:worker_threads";
@@ -3703,7 +3733,7 @@ async function runWorkflowScript(options) {
3703
3733
  if (staleCwd) process.chdir(options.processCwd);
3704
3734
  else {
3705
3735
  const target = realpathSync3(options.processCwd);
3706
- if (!statSync3(target).isDirectory()) {
3736
+ if (!statSync4(target).isDirectory()) {
3707
3737
  const error = new Error(`ENOTDIR: not a directory, access '${target}'`);
3708
3738
  error.code = "ENOTDIR";
3709
3739
  throw error;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  buildWorkflowChatProgressRows
3
- } from "./chunk-7PCKZHR5.js";
3
+ } from "./chunk-FXUXCX2K.js";
4
4
  import {
5
5
  aggregateStepStatus,
6
6
  contextModeBadge,
@@ -25,13 +25,13 @@ import {
25
25
  projectWorkflowChecklist,
26
26
  withCachedUiContext,
27
27
  workflowGraphStageNodes
28
- } from "./chunk-VH5OAWVG.js";
28
+ } from "./chunk-6XJB7PIX.js";
29
29
  import {
30
30
  flatToLogicalStepIndex,
31
31
  formatWorkflowJsonPreview,
32
32
  hostStepReportName,
33
33
  hostStepVerdictLabel
34
- } from "./chunk-NRQ75MGH.js";
34
+ } from "./chunk-46XKCPJR.js";
35
35
  import {
36
36
  snapshotExternalRuns
37
37
  } from "./chunk-UKG4V45O.js";
@@ -39,7 +39,7 @@ import {
39
39
  validateModelResponseAliases,
40
40
  withWorkflowChildRunModel,
41
41
  withWorktreeTransaction
42
- } from "./chunk-NRQ75MGH.js";
42
+ } from "./chunk-46XKCPJR.js";
43
43
  import {
44
44
  validateIntercomBridgeConfig
45
45
  } from "./chunk-XSWOTIA3.js";
@@ -2454,7 +2454,7 @@ function listAsyncRuns(asyncDirRoot, options = {}, observeStatus) {
2454
2454
  }
2455
2455
  if (wantsTerminal) {
2456
2456
  for (const sessionId of owners ?? [void 0]) {
2457
- for (const entry of readRecentTerminalRunIndex(asyncDirRoot, { sessionId, ...options.entryLimit !== void 0 ? { limit: options.entryLimit } : {} })) indexed.add(entry);
2457
+ for (const entry of readRecentTerminalRunIndex(asyncDirRoot, { sessionId, onCorruptStatus: options.onCorruptStatus, ...options.entryLimit !== void 0 ? { limit: options.entryLimit } : {} })) indexed.add(entry);
2458
2458
  }
2459
2459
  }
2460
2460
  entries = [...indexed];
@@ -13,7 +13,7 @@ import {
13
13
  summarizeContextModes,
14
14
  utf8Tail,
15
15
  workflowPreflightLaneForRuntimeKey
16
- } from "./chunk-VH5OAWVG.js";
16
+ } from "./chunk-6XJB7PIX.js";
17
17
  import {
18
18
  assertSafeNestedId,
19
19
  checkRecordedPidLiveness,
@@ -32,7 +32,7 @@ import {
32
32
  updateActiveRunIndex,
33
33
  validateModelResponseAliases,
34
34
  writeAsyncResultFile
35
- } from "./chunk-NRQ75MGH.js";
35
+ } from "./chunk-46XKCPJR.js";
36
36
  import {
37
37
  deliverStopRequest,
38
38
  stopInboxClosedPath
@@ -6,25 +6,25 @@ import {
6
6
  resolveWorkflowForegroundSteeringTarget,
7
7
  steerAsyncRun,
8
8
  steerWorkflowForegroundTarget
9
- } from "./chunk-7IVSUMQQ.js";
9
+ } from "./chunk-PBK2I7WY.js";
10
10
  import {
11
11
  FLEET_STATUS_WIDGET_KEY,
12
12
  reportFleetWarning,
13
13
  runningTone,
14
14
  stepTaskSummary
15
- } from "./chunk-M2CTFYT3.js";
15
+ } from "./chunk-4Y2ROR7L.js";
16
16
  import {
17
17
  foregroundChildStateLabel,
18
18
  formatAsyncRunTranscript,
19
19
  stopAsyncRun
20
- } from "./chunk-7PCKZHR5.js";
20
+ } from "./chunk-FXUXCX2K.js";
21
21
  import {
22
22
  contextModeBadge,
23
23
  contextModeLabel,
24
24
  decodeUtf8Tail,
25
25
  listAsyncRuns
26
- } from "./chunk-VH5OAWVG.js";
27
- import "./chunk-NRQ75MGH.js";
26
+ } from "./chunk-6XJB7PIX.js";
27
+ import "./chunk-46XKCPJR.js";
28
28
  import "./chunk-OYF6AFDY.js";
29
29
  import "./chunk-NIXWDZZV.js";
30
30
  import "./chunk-XSWOTIA3.js";
@@ -302,7 +302,8 @@ function collectFleetSnapshot(state, options = {}) {
302
302
  ...state.currentSessionId ? { sessionId: state.currentSessionId } : {},
303
303
  entryLimit: MAX_FLEET_HISTORY_CANDIDATES,
304
304
  resultsDir: options.resultsDir ?? DIRS.results,
305
- reconcile: false
305
+ reconcile: false,
306
+ onCorruptStatus: (warning) => reportFleetWarning(state, warning)
306
307
  }).filter((run) => !trackedIds.has(run.id));
307
308
  runs = [...trackedRuns, ...history];
308
309
  } else {
@@ -10,10 +10,10 @@ import {
10
10
  setInlineWorkflowCoverage,
11
11
  setMainThinkingLevelSource,
12
12
  widgetRenderKey
13
- } from "./chunk-M2CTFYT3.js";
13
+ } from "./chunk-4Y2ROR7L.js";
14
14
  import {
15
15
  package_default
16
- } from "./chunk-ZQGSDHL6.js";
16
+ } from "./chunk-UTT254JE.js";
17
17
  import {
18
18
  EXTERNAL_JOB_BRIDGE_REQUEST_DIR,
19
19
  REVIVAL_ORIGIN_FILE,
@@ -61,7 +61,7 @@ import {
61
61
  snapshotProviderDiagnostics,
62
62
  workflowResumeClaimState,
63
63
  workflowResumeRefusal
64
- } from "./chunk-ZLINIYTP.js";
64
+ } from "./chunk-ZIV4J4HG.js";
65
65
  import {
66
66
  CONTACT_SUPERVISOR_TOOL_NAME,
67
67
  NATIVE_SUPERVISOR_TOOL_NAME,
@@ -89,14 +89,14 @@ import {
89
89
  resolveWaitToolConfig,
90
90
  setDeclarationPinning,
91
91
  topLevelSupervisorTool
92
- } from "./chunk-W2SZ22EM.js";
92
+ } from "./chunk-VSUSLDNW.js";
93
93
  import {
94
94
  deliverAsyncRunStop,
95
95
  ownerConfirmedDead,
96
96
  readSessionMessagesTail,
97
97
  resolveSubagentRunId,
98
98
  restoreForegroundRunHistory
99
- } from "./chunk-7PCKZHR5.js";
99
+ } from "./chunk-FXUXCX2K.js";
100
100
  import {
101
101
  ASYNC_STATUS_SNAPSHOT_KIND,
102
102
  ASYNC_STATUS_SNAPSHOT_VERSION,
@@ -118,7 +118,7 @@ import {
118
118
  resolveAsyncStatusChild,
119
119
  stopStoppableAsyncStatusChildren,
120
120
  withCachedUiContext
121
- } from "./chunk-VH5OAWVG.js";
121
+ } from "./chunk-6XJB7PIX.js";
122
122
  import "./chunk-NF7IEKBH.js";
123
123
  import {
124
124
  disabledFeatureUseError,
@@ -129,7 +129,7 @@ import {
129
129
  resolveDisabledFeatureSurface,
130
130
  resolveMaxActiveAsyncRunsPerSession,
131
131
  resolveScheduledStoreRoot
132
- } from "./chunk-NGGAFDL6.js";
132
+ } from "./chunk-UCPP4GNU.js";
133
133
  import {
134
134
  ACTIVE_RUN_INDEX_DIR,
135
135
  MissionNotFoundError,
@@ -178,7 +178,7 @@ import {
178
178
  withWorkflowChildRunModel,
179
179
  writeAsyncResultFile,
180
180
  writeResultIndexForData
181
- } from "./chunk-NRQ75MGH.js";
181
+ } from "./chunk-46XKCPJR.js";
182
182
  import "./chunk-OYF6AFDY.js";
183
183
  import {
184
184
  shouldUseNativeFsWatch
@@ -5180,7 +5180,7 @@ function registerSlashCommands(pi, state, options = {}) {
5180
5180
  }
5181
5181
  fleetOpen = true;
5182
5182
  try {
5183
- const { openSubagentFleet } = await import("./chunk-7YMXOYEU.js");
5183
+ const { openSubagentFleet } = await import("./chunk-G4GZD3OJ.js");
5184
5184
  await openSubagentFleet(ctx, state, { asyncDirRoot: DIRS.async, inspectorPlugins: () => getInspectorPlugins(pi), resultsDir: DIRS.results, fleetKeybindings: options.fleetKeybindings });
5185
5185
  } finally {
5186
5186
  fleetOpen = false;
@@ -8567,7 +8567,7 @@ function registerSubagentExtension(pi) {
8567
8567
  const ctx = withLastUiContext((current) => current);
8568
8568
  if (!ctx) return;
8569
8569
  try {
8570
- const { openSubagentFleet } = await import("./chunk-7YMXOYEU.js");
8570
+ const { openSubagentFleet } = await import("./chunk-G4GZD3OJ.js");
8571
8571
  await openSubagentFleet(ctx, state, { initialKey: itemKey, asyncDirRoot: DIRS.async, resultsDir: DIRS.results, fleetKeybindings: config.fleetKeybindings, inspectorPlugins: () => getInspectorPlugins(pi) });
8572
8572
  } catch (error) {
8573
8573
  if (isStaleExtensionContextError(error)) {
@@ -8763,7 +8763,7 @@ function registerSubagentExtension(pi) {
8763
8763
  let executor;
8764
8764
  let executorPromise;
8765
8765
  let executorModulePromise;
8766
- const loadExecutorModule = () => executorModulePromise ??= import("./chunk-B5EKXDHE.js");
8766
+ const loadExecutorModule = () => executorModulePromise ??= import("./chunk-QE4AGIMG.js");
8767
8767
  const getExecutor = () => {
8768
8768
  executorPromise ??= loadExecutorModule().then(({ createSubagentExecutor }) => {
8769
8769
  executor = createSubagentExecutor(executorDeps);
@@ -8777,7 +8777,7 @@ function registerSubagentExtension(pi) {
8777
8777
  modulePreloadTimer = setTimeout(() => {
8778
8778
  loadExecutorModule().catch(() => {
8779
8779
  });
8780
- if (fleetViewEnabled) import("./chunk-7YMXOYEU.js").catch(() => {
8780
+ if (fleetViewEnabled) import("./chunk-G4GZD3OJ.js").catch(() => {
8781
8781
  });
8782
8782
  }, MODULE_PRELOAD_DELAY_MS);
8783
8783
  modulePreloadTimer.unref?.();
@@ -1,18 +1,18 @@
1
1
  import {
2
2
  rewriteSubagentPrompt
3
- } from "./chunk-GC4DSPMH.js";
3
+ } from "./chunk-3JCDWF4V.js";
4
4
  import {
5
5
  package_default
6
- } from "./chunk-ZQGSDHL6.js";
7
- import "./chunk-W2SZ22EM.js";
6
+ } from "./chunk-UTT254JE.js";
7
+ import "./chunk-VSUSLDNW.js";
8
8
  import {
9
9
  MODEL_ONLY_TOOL
10
- } from "./chunk-VH5OAWVG.js";
10
+ } from "./chunk-6XJB7PIX.js";
11
11
  import "./chunk-NF7IEKBH.js";
12
12
  import {
13
13
  appendAgentRefinementOverlay
14
14
  } from "./chunk-PLCCBLPY.js";
15
- import "./chunk-NRQ75MGH.js";
15
+ import "./chunk-46XKCPJR.js";
16
16
  import "./chunk-NIXWDZZV.js";
17
17
  import "./chunk-XSWOTIA3.js";
18
18
  import "./chunk-7F6RKT6W.js";
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  isTrustedRecordedSessionFile,
3
3
  resolveSubagentRunId
4
- } from "./chunk-7PCKZHR5.js";
4
+ } from "./chunk-FXUXCX2K.js";
5
5
  import {
6
6
  agentStreamOptions,
7
7
  opencodeSessionHeaders,
8
8
  ownsRun,
9
9
  resolveAsyncResumeTarget
10
- } from "./chunk-VH5OAWVG.js";
10
+ } from "./chunk-6XJB7PIX.js";
11
11
  import {
12
12
  currentCompletionOwnerId,
13
13
  listMissions,
@@ -16,7 +16,7 @@ import {
16
16
  reconcileAsyncRun,
17
17
  resolveAuthorityDecision,
18
18
  resolveMissionStoreLocation
19
- } from "./chunk-NRQ75MGH.js";
19
+ } from "./chunk-46XKCPJR.js";
20
20
  import {
21
21
  deliverInterruptRequest,
22
22
  queueRevivalBrief,
@@ -15,7 +15,7 @@ import {
15
15
  } from "./chunk-RMQFMMAT.js";
16
16
  import {
17
17
  package_default
18
- } from "./chunk-ZQGSDHL6.js";
18
+ } from "./chunk-UTT254JE.js";
19
19
  import {
20
20
  HERDR_PI_MODE_ENV,
21
21
  HERDR_PI_PROTOCOL,
@@ -3,7 +3,7 @@ import {
3
3
  projectRuntimeAcknowledgedExtensions,
4
4
  registerSubagentPromptBoundary,
5
5
  registerSubagentPromptRuntime
6
- } from "./chunk-GC4DSPMH.js";
6
+ } from "./chunk-3JCDWF4V.js";
7
7
  import {
8
8
  INSPECTOR_ACTIONS,
9
9
  canQueueRetainedAsyncFollowUp,
@@ -25,7 +25,7 @@ import {
25
25
  updateSteeringTarget,
26
26
  waitForSteeringAction,
27
27
  workflowAsyncChildSteeringGuidance
28
- } from "./chunk-7IVSUMQQ.js";
28
+ } from "./chunk-PBK2I7WY.js";
29
29
  import {
30
30
  REX_LOCAL_MACHINE,
31
31
  isRexLocalMachine,
@@ -119,7 +119,7 @@ import {
119
119
  workflowStopCause,
120
120
  writeWorkflowLaunchRecord,
121
121
  writeWorkflowReceipt
122
- } from "./chunk-ZLINIYTP.js";
122
+ } from "./chunk-ZIV4J4HG.js";
123
123
  import {
124
124
  NATIVE_SUPERVISOR_TOOL_NAME,
125
125
  SUBAGENT_PARENT_SESSION_ENV,
@@ -135,7 +135,7 @@ import {
135
135
  resolveWatchdogConfig,
136
136
  sendRuleViolationWarning,
137
137
  writeWatchdogModelSettings
138
- } from "./chunk-W2SZ22EM.js";
138
+ } from "./chunk-VSUSLDNW.js";
139
139
  import {
140
140
  MAX_REMEMBERED_FOREGROUND_RUNS,
141
141
  discardRunningForegroundRun,
@@ -148,7 +148,7 @@ import {
148
148
  resolveSubagentRunId,
149
149
  resolveWorkflowChatProgress,
150
150
  stopAsyncRun
151
- } from "./chunk-7PCKZHR5.js";
151
+ } from "./chunk-FXUXCX2K.js";
152
152
  import {
153
153
  MODEL_ONLY_TOOL,
154
154
  RunFanoutLimitError,
@@ -210,7 +210,7 @@ import {
210
210
  writeParallelHandoffGroup,
211
211
  writeRunFanoutBudgetDescriptor,
212
212
  writeWorktreeSetupHandoff
213
- } from "./chunk-VH5OAWVG.js";
213
+ } from "./chunk-6XJB7PIX.js";
214
214
  import {
215
215
  authorizeWorkflowResourceHost,
216
216
  claimWorkflowChildPermit,
@@ -244,7 +244,7 @@ import {
244
244
  resolveDisabledFeatureSurface,
245
245
  resolveMaxActiveAsyncRunsPerSession,
246
246
  transferActiveAsyncCapacity
247
- } from "./chunk-NGGAFDL6.js";
247
+ } from "./chunk-UCPP4GNU.js";
248
248
  import {
249
249
  DEFAULT_STALE_TERMINAL_ACTIVE_MARKER_MS,
250
250
  MACHINE_DIFF_OPTIONS,
@@ -323,7 +323,7 @@ import {
323
323
  writeNestedControlRequest,
324
324
  writeNestedControlResult,
325
325
  writeNestedEvent
326
- } from "./chunk-NRQ75MGH.js";
326
+ } from "./chunk-46XKCPJR.js";
327
327
  import {
328
328
  closeSteerInbox,
329
329
  consumeSteerRequests,
@@ -3987,7 +3987,8 @@ var WORKFLOW_FENCE = /^```(?:js|javascript) workflow[ \t]*$/;
3987
3987
  var PLAIN_JS_FENCE = /^```(?:js|javascript)[ \t]*$/;
3988
3988
  var OPEN_FENCE = /^(`{3,}|~{3,})/;
3989
3989
  var CLOSE_FENCE = /^(`{3,}|~{3,})[ \t]*$/;
3990
- var FILE_FALLBACK = 'Or write the script to a file and pass its path, such as workflow: "./script.js".';
3990
+ var SUMMARY_NOTE = 'On some models, text written after a tool call in the same turn reaches the session only as a summary without code blocks, so for the rest of this turn write the script to a file and pass its path, such as workflow: "./script.js".';
3991
+ var FILE_FALLBACK = `If the block is in your reply: ${SUMMARY_NOTE}`;
3991
3992
  function readReplyWorkflowScript(sessionManager, toolCallId) {
3992
3993
  const branch = sessionManager.getBranch();
3993
3994
  for (let index = branch.length - 1; index >= 0; index--) {
@@ -4003,7 +4004,7 @@ function readReplyWorkflowScript(sessionManager, toolCallId) {
4003
4004
  function scriptFromReply(content) {
4004
4005
  const replyCalls = content.filter((block) => block.type === "toolCall" && block.name === "subagent" && (block.arguments?.workflow === true || block.arguments?.workflow === "true")).length;
4005
4006
  if (replyCalls > 1) return { error: `This reply has ${replyCalls} subagent calls with workflow: true; a reply can carry only one. Pass other scripts as workflow file paths.` };
4006
- if (!content.some((block) => block.type === "text")) return { error: 'The assistant message that issued this call has no text in the session, so the reply\'s visible text, including any ```js workflow block, never reached it. Write the script to a file and pass its path, such as workflow: "./script.js".' };
4007
+ if (!content.some((block) => block.type === "text")) return { error: `The assistant message that issued this call has no text in the session, so the reply's visible text, including any \`\`\`js workflow block, never reached it. ${SUMMARY_NOTE}` };
4007
4008
  const text = content.flatMap((block) => block.type === "text" && typeof block.text === "string" ? [block.text] : []).join("\n");
4008
4009
  const { tagged, plain, unclosed } = workflowBlocks(text);
4009
4010
  if (unclosed) return { error: "The script's fenced block in this reply is not closed." };
@@ -11,7 +11,7 @@ import {
11
11
  validateAuthorityPolicy,
12
12
  validateMissionStoreConfig,
13
13
  validateModelResponseAliases
14
- } from "./chunk-NRQ75MGH.js";
14
+ } from "./chunk-46XKCPJR.js";
15
15
  import {
16
16
  getAgentDir,
17
17
  readStatus,
@@ -1,7 +1,7 @@
1
1
  // package.json
2
2
  var package_default = {
3
3
  name: "pi-subagents",
4
- version: "0.82.0",
4
+ version: "0.82.1",
5
5
  private: true,
6
6
  description: "Pi extension for single-agent delegation and scripted multi-agent workflows",
7
7
  author: "Nico Bailon",
@@ -11,7 +11,7 @@ import {
11
11
  projectTimeoutRecovery,
12
12
  readAsyncRecoveryDescriptor,
13
13
  utf8Tail
14
- } from "./chunk-VH5OAWVG.js";
14
+ } from "./chunk-6XJB7PIX.js";
15
15
  import {
16
16
  MAX_ARGS_BYTES,
17
17
  MAX_ARGS_DEPTH,
@@ -24,7 +24,7 @@ import {
24
24
  resultFilePath,
25
25
  resultPayloadMatchesSessionRun,
26
26
  resultPayloadPathForSessionRun
27
- } from "./chunk-NRQ75MGH.js";
27
+ } from "./chunk-46XKCPJR.js";
28
28
  import {
29
29
  shouldUseNativeFsWatch
30
30
  } from "./chunk-NIXWDZZV.js";
@@ -11,10 +11,10 @@ import {
11
11
  startWatchdogDiffBaselineCapture,
12
12
  writeUserWatchdogEnabled,
13
13
  writeWatchdogModelSettings
14
- } from "./chunk-W2SZ22EM.js";
14
+ } from "./chunk-VSUSLDNW.js";
15
15
  import {
16
16
  resolveGitRepositoryIdentity
17
- } from "./chunk-7PCKZHR5.js";
17
+ } from "./chunk-FXUXCX2K.js";
18
18
  import {
19
19
  listAsyncRuns,
20
20
  ownsRun,
@@ -22,7 +22,7 @@ import {
22
22
  parseWorkflowChildSummary,
23
23
  readAsyncRecoveryDescriptor,
24
24
  resolveRetainedWorktreeCwd
25
- } from "./chunk-VH5OAWVG.js";
25
+ } from "./chunk-6XJB7PIX.js";
26
26
  import {
27
27
  deepFreezeWorkflowArgs,
28
28
  normalizeWorkflowArgs
@@ -50,7 +50,7 @@ import {
50
50
  resolveMissionStoreLocation,
51
51
  validateMissionId,
52
52
  workflowRunParamsFingerprint
53
- } from "./chunk-NRQ75MGH.js";
53
+ } from "./chunk-46XKCPJR.js";
54
54
  import {
55
55
  requestAsyncCommand,
56
56
  watchAsyncControlInbox
@@ -4207,8 +4207,7 @@ var SUBAGENT_GUIDE_SECTION_MAX_CHARS = 8e3;
4207
4207
  var packageRoot = path7.resolve(path7.dirname(fileURLToPath(new URL("../src/extension/subagent-guide.js", import.meta.url).href)), "..", "..");
4208
4208
  var COUNCIL_FILES = [
4209
4209
  "skills/council-mode/SKILL.md",
4210
- "skills/council-mode/references/pass-contracts.md",
4211
- "skills/pi-subagents/references/execution-controls.md"
4210
+ "skills/council-mode/references/pass-contracts.md"
4212
4211
  ];
4213
4212
  function isGuideTopic(value) {
4214
4213
  return SUBAGENT_GUIDE_TOPICS.includes(value);
@@ -7710,7 +7709,7 @@ function childSessionFactory() {
7710
7709
  }
7711
7710
  function createLazyPlacementFactory(local) {
7712
7711
  let placed;
7713
- const factory = async () => placed ??= (await import("./chunk-MHZ4G23A.js")).createPlacementAwareChildSessionFactory(local);
7712
+ const factory = async () => placed ??= (await import("./chunk-PDZWJCHD.js")).createPlacementAwareChildSessionFactory(local);
7714
7713
  return {
7715
7714
  async create(launch) {
7716
7715
  return launch.machine ? (await factory()).create(launch) : local.create(launch);
package/bundle/index.js CHANGED
@@ -17,7 +17,7 @@ function readInstalledPackageVersion() {
17
17
  var loadedPackageVersion = readInstalledPackageVersion();
18
18
 
19
19
  // index.ts
20
- var registerExtension = process.env[HERDR_PI_MODE_ENV] === "1" ? (await import("./chunk-SIJ4S3EN.js")).default : process.env.PI_SUBAGENT_CHILD === "1" ? void 0 : (await import("./chunk-WVD4UEL4.js")).default;
20
+ var registerExtension = process.env[HERDR_PI_MODE_ENV] === "1" ? (await import("./chunk-JYUKW2SY.js")).default : process.env.PI_SUBAGENT_CHILD === "1" ? void 0 : (await import("./chunk-IVAE5Z6Q.js")).default;
21
21
  function registerSubagentExtension(pi) {
22
22
  const installedVersion = readInstalledPackageVersion();
23
23
  if (installedVersion !== loadedPackageVersion) {
@@ -6,13 +6,13 @@ import {
6
6
  import "./chunk-PLCCBLPY.js";
7
7
  import {
8
8
  loadConfig
9
- } from "./chunk-NGGAFDL6.js";
9
+ } from "./chunk-UCPP4GNU.js";
10
10
  import {
11
11
  nestedResultsPath,
12
12
  processTerminalCandidatePath,
13
13
  processTerminalPath,
14
14
  resultFilePath
15
- } from "./chunk-NRQ75MGH.js";
15
+ } from "./chunk-46XKCPJR.js";
16
16
  import {
17
17
  applyIntercomBridgeToAgent,
18
18
  resolveIntercomBridge,
package/docs/agents.md CHANGED
@@ -43,7 +43,7 @@ Builtins load at the lowest priority, so a user or project agent with the same n
43
43
  | `researcher` | Web/docs research with sources: official docs, specs, benchmarks, recent changes, and a concise research brief. |
44
44
  | `evidence-auditor` | Independent evidence review of important claims in an existing research brief. |
45
45
  | `worker` | Implementation work, including approved oracle handoffs. It edits files, validates, and escalates unapproved decisions instead of guessing. |
46
- | `reviewer` | Code review and small fixes. It checks the implementation against the task/plan, tests, edge cases, and simplicity. |
46
+ | `reviewer` | Read-only code review. It checks the implementation against the task/plan, tests, edge cases, and simplicity. |
47
47
  | `oracle` | A second opinion before acting. It challenges assumptions, catches drift, and recommends the safest next move without editing. |
48
48
  | `delegate` | A lightweight general delegate when you want a child agent that behaves close to the parent session. |
49
49
 
@@ -650,11 +650,10 @@ The package bundles a `pi-subagents` skill that is automatically available to th
650
650
 
651
651
  What it covers:
652
652
 
653
- - **Delegation patterns**: how to select a bounded agent and single, parallel, scripted, or async shape after delegation is authorized, including fresh or forked context.
654
- - **Prompt workflow recipes**: how to apply the packaged techniques directly with `subagent(...)` when the user describes the workflow in natural language instead of invoking a slash command. This includes parallel review, review-loop, parallel research, parallel context-build, parallel handoff-plan, gather-context-and-clarify, and parallel cleanup.
655
- - **Role-agent prompting guidance**: compact contract prompts instead of long scripts, what to include in role-specific meta prompts, and retrieval budgets for researchers.
656
- - **Safety boundaries**: child agents must not run subagents unless their resolved builtin tools explicitly include `subagent`, must not invent intercom targets, and must escalate unapproved decisions.
657
- - **Intercom conventions**: when to ask vs send, and how parent-side supervisor/result delivery works through the native channel.
658
- - **Control and diagnostics**: attention signals, soft interrupts, status, and the `doctor` action.
653
+ - **Calls**: the common `subagent` calls, workflow script and resume shapes, and async waiting rules.
654
+ - **Delegation rules**: when to delegate at all, what every child brief contains, one writer per worktree, fresh or forked context, and what to do when a lane fails.
655
+ - **Prompt workflow recipes**: how to apply the packaged techniques directly with `subagent(...)` when the user describes the workflow in natural language instead of invoking a slash command: parallel review, review loop, parallel research, gather-context-and-clarify, parallel cleanup, and oracle consultation.
656
+ - **Orchestration**: splitting work into lanes, review loops, finding disposition, and gate-failure triage.
657
+ - **Lookups**: which `guide` section answers each rarer question, so the skill does not copy this reference.
659
658
 
660
659
  If you are writing an agent that has been asked to orchestrate subagents, the bundled skill helps it behave correctly without guessing the patterns. If you are a human user, you do not need to read it; the README and prompt shortcuts encode the same workflows in user-facing form.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "pi-subagents",
4
- "version": "0.82.0",
4
+ "version": "0.82.1",
5
5
  "description": "Pi extension for single-agent delegation and scripted multi-agent workflows",
6
6
  "author": "Nico Bailon",
7
7
  "license": "MIT",
@@ -9,10 +9,7 @@ Council mode is parent-supervised advice for a material decision with real trade
9
9
 
10
10
  The parent selects the roster, relays only curated claims, decides validity, and writes the memo. Advisors stay read-only and do not see peer transcripts by default.
11
11
 
12
- Before launch, read:
13
-
14
- - `skills/pi-subagents/references/execution-controls.md`
15
- - `skills/council-mode/references/pass-contracts.md`
12
+ Before launch, read `skills/council-mode/references/pass-contracts.md`.
16
13
 
17
14
  ## Roster
18
15