@vicary/pi-subagents 0.89.0 → 0.89.2

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 (79) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/bundle/agents.js +3 -3
  3. package/bundle/child-tool-plan.js +2 -2
  4. package/bundle/{chunk-7W2IQFP4.js → chunk-464OJSDP.js} +4 -4
  5. package/bundle/{chunk-ETDE2VYK.js → chunk-4KQW5R6U.js} +2 -2
  6. package/bundle/{chunk-PFZZMVD5.js → chunk-4X3T5CPK.js} +12 -12
  7. package/bundle/{chunk-JRO2CU4D.js → chunk-5TXWZB73.js} +1 -1
  8. package/bundle/{chunk-CFIYO2IV.js → chunk-62OHSCQ6.js} +64 -12
  9. package/bundle/{chunk-7J4ZXMY7.js → chunk-72334PEI.js} +6 -4
  10. package/bundle/{chunk-S77ZKDLS.js → chunk-77VQEATI.js} +1 -1
  11. package/bundle/{chunk-HZDLR73C.js → chunk-AHGJSJYY.js} +4 -3
  12. package/bundle/{chunk-4ALRHKGE.js → chunk-DGLXVN3F.js} +1 -1
  13. package/bundle/{chunk-SLLZJ5EC.js → chunk-DHY5TY2Y.js} +237 -199
  14. package/bundle/{chunk-OVBUEVOT.js → chunk-DNDNLHTL.js} +11 -11
  15. package/bundle/{chunk-NQ26PJSQ.js → chunk-FF5K5HQU.js} +11 -6
  16. package/bundle/{chunk-HSHLPYCQ.js → chunk-FO2GIU5F.js} +27 -18
  17. package/bundle/{chunk-JFACGAJT.js → chunk-JEYG7CNC.js} +8 -4
  18. package/bundle/{chunk-7JLNWAMO.js → chunk-LODNNILA.js} +99 -30
  19. package/bundle/{chunk-GHJ6BH5U.js → chunk-LWH7IGI3.js} +8 -0
  20. package/bundle/{chunk-UQT2EQ4U.js → chunk-Q4VH72JI.js} +2 -2
  21. package/bundle/{chunk-443LPCRI.js → chunk-RHKIP45B.js} +6 -6
  22. package/bundle/{chunk-SWL2EITY.js → chunk-RHMU7SXN.js} +2 -2
  23. package/bundle/{chunk-WW6GQBBS.js → chunk-SRCMJY4F.js} +4 -4
  24. package/bundle/{chunk-KOLLMZ2X.js → chunk-SWGB2P5J.js} +1 -1
  25. package/bundle/{chunk-ZSCIHMUI.js → chunk-TXC7WIPL.js} +3 -2
  26. package/bundle/{chunk-6JD4XCA4.js → chunk-U753SUBC.js} +14 -6
  27. package/bundle/{chunk-A3INCQ6Z.js → chunk-UUW7P6KJ.js} +1 -1
  28. package/bundle/{chunk-MJHQIUU7.js → chunk-V4543APA.js} +33 -24
  29. package/bundle/{chunk-EPMRDKQT.js → chunk-VEEUXJDO.js} +1 -1
  30. package/bundle/{chunk-LEPIY76E.js → chunk-W7NDPDDJ.js} +8 -8
  31. package/bundle/{chunk-NONHDYXE.js → chunk-YJIU5WF4.js} +1 -1
  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 +4 -4
  37. package/docs/agents.md +2 -2
  38. package/docs/observability.md +3 -1
  39. package/docs/watchdog.md +3 -2
  40. package/package.json +2 -2
  41. package/src/api/preflight.d.ts +1 -0
  42. package/src/api/preflight.js +2 -1
  43. package/src/extension/herdr-pi-bridge.js +1 -1
  44. package/src/inspectors/herdr/project-panes.d.ts +2 -0
  45. package/src/inspectors/herdr/project-panes.js +7 -1
  46. package/src/inspectors/shell-command.d.ts +2 -1
  47. package/src/inspectors/shell-command.js +7 -5
  48. package/src/runs/background/active-async-capacity.js +2 -1
  49. package/src/runs/background/active-run-index.d.ts +1 -0
  50. package/src/runs/background/active-run-index.js +3 -0
  51. package/src/runs/background/async-execution.d.ts +2 -0
  52. package/src/runs/background/async-execution.js +3 -2
  53. package/src/runs/background/async-job-tracker.js +85 -9
  54. package/src/runs/background/async-status.d.ts +2 -0
  55. package/src/runs/background/async-status.js +8 -3
  56. package/src/runs/background/process-terminal.d.ts +6 -0
  57. package/src/runs/background/process-terminal.js +34 -2
  58. package/src/runs/background/run-status.js +2 -1
  59. package/src/runs/background/stale-run-reconciler.d.ts +8 -0
  60. package/src/runs/background/stale-run-reconciler.js +38 -8
  61. package/src/runs/background/workflow-terminal-proof.d.ts +0 -1
  62. package/src/runs/background/workflow-terminal-proof.js +4 -4
  63. package/src/runs/foreground/execution.js +2 -2
  64. package/src/runs/foreground/subagent-executor.d.ts +2 -0
  65. package/src/runs/foreground/subagent-executor.js +10 -1
  66. package/src/runs/shared/herdr-machine.js +3 -1
  67. package/src/runs/shared/herdr-pane-host.js +10 -2
  68. package/src/runs/shared/mcp-config-sources.d.ts +1 -0
  69. package/src/runs/shared/mcp-config-sources.js +1 -1
  70. package/src/runs/shared/mcp-direct-tool-allowlist.js +1 -0
  71. package/src/runs/shared/subagent-prompt-runtime.js +6 -5
  72. package/src/shared/types.d.ts +2 -0
  73. package/src/shared/utils.d.ts +2 -0
  74. package/src/shared/utils.js +9 -0
  75. package/src/tui/fleet-transcript.js +21 -9
  76. package/src/watchdog/runtime.d.ts +4 -0
  77. package/src/watchdog/runtime.js +50 -12
  78. package/src/watchdog/turn-delta.d.ts +2 -0
  79. package/src/watchdog/turn-delta.js +21 -0
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  buildWorkflowChatProgressRows
3
- } from "./chunk-7W2IQFP4.js";
3
+ } from "./chunk-464OJSDP.js";
4
4
  import {
5
5
  aggregateStepStatus,
6
6
  contextModeBadge,
@@ -22,7 +22,7 @@ import {
22
22
  projectAsyncWorkflowRows,
23
23
  projectWorkflowChecklist,
24
24
  workflowGraphStageNodes
25
- } from "./chunk-6JD4XCA4.js";
25
+ } from "./chunk-U753SUBC.js";
26
26
  import {
27
27
  isStaleExtensionContextError,
28
28
  isUnboundExtensionRuntimeError,
@@ -34,7 +34,7 @@ import {
34
34
  formatWorkflowJsonPreview,
35
35
  hostStepReportName,
36
36
  hostStepVerdictLabel
37
- } from "./chunk-SLLZJ5EC.js";
37
+ } from "./chunk-DHY5TY2Y.js";
38
38
  import {
39
39
  snapshotExternalRuns
40
40
  } from "./chunk-UKG4V45O.js";
@@ -52,7 +52,7 @@ import {
52
52
  getSingleResultOutput,
53
53
  shortenPath,
54
54
  unresolvedChildWatchdogBlockers
55
- } from "./chunk-GHJ6BH5U.js";
55
+ } from "./chunk-LWH7IGI3.js";
56
56
  import {
57
57
  MAX_WIDGET_JOBS,
58
58
  WIDGET_ANIMATION_INTERVAL_MS,
@@ -8,7 +8,7 @@ import {
8
8
  validateCodeOwnedProfileRunner,
9
9
  validatePermissionRules,
10
10
  validateToolBudgetConfig
11
- } from "./chunk-GHJ6BH5U.js";
11
+ } from "./chunk-LWH7IGI3.js";
12
12
 
13
13
  // src/agents/runtime-agent-registry.ts
14
14
  var RUNTIME_AGENT_REGISTRY_KEY = "pi-subagents.runtime-agents.v1";
@@ -5,7 +5,7 @@ import {
5
5
  getProjectConfigDir,
6
6
  resolveLocalLaunchCwd,
7
7
  resolveRexLocalPlacement
8
- } from "./chunk-GHJ6BH5U.js";
8
+ } from "./chunk-LWH7IGI3.js";
9
9
 
10
10
  // src/runs/shared/herdr-machine.ts
11
11
  import { spawnSync as spawnSync2 } from "node:child_process";
@@ -542,7 +542,8 @@ function resolveMachinePlacement(input) {
542
542
  const env = input.env ?? process.env;
543
543
  if (env.HERDR_ENV === "1" && env.HERDR_PANE_ID?.trim()) return { machine: resolveHerdrLocalPlacement({ cwd: input.cwd, stepCwd: input.stepCwd, env, herdrBin: input.herdrBin }) };
544
544
  if (env.REX_SESSION?.trim()) return { machine: resolveRexLocalPlacement({ cwd: input.cwd, stepCwd: input.stepCwd, env }) };
545
- throw new Error("Machine 'local' opens the child in a new tab of the terminal this Pi runs in, but this Pi is running in neither Herdr (HERDR_ENV=1 with HERDR_PANE_ID) nor Rex (REX_SESSION).");
545
+ const core = env.HC_TERMINAL_ID?.trim() ? " It runs in a Herdr Core terminal (HC_TERMINAL_ID), which machine 'local' does not support." : "";
546
+ throw new Error(`Machine 'local' opens the child in a new tab of the terminal this Pi runs in, but this Pi is running in neither Herdr (HERDR_ENV=1 with HERDR_PANE_ID) nor Rex (REX_SESSION).${core}`);
546
547
  }
547
548
  if (settings?.rex) return { machine: { provider: "rex", id: requested, target: settings.rex.ssh, cwd: validateRemoteCwd(remoteMachineCwd(input.stepCwd, settings.cwd, requested), requested) } };
548
549
  return resolveHerdrMachinePlacement(input);
@@ -47,10 +47,10 @@ import {
47
47
  validateModelResponseAliases,
48
48
  withWorkflowChildRunModel,
49
49
  withWorktreeTransaction
50
- } from "./chunk-SLLZJ5EC.js";
50
+ } from "./chunk-DHY5TY2Y.js";
51
51
  import {
52
52
  validateIntercomBridgeConfig
53
- } from "./chunk-NONHDYXE.js";
53
+ } from "./chunk-YJIU5WF4.js";
54
54
  import {
55
55
  stableJsonDigest
56
56
  } from "./chunk-7F6RKT6W.js";
@@ -59,7 +59,7 @@ import {
59
59
  } from "./chunk-YARY7JWU.js";
60
60
  import {
61
61
  missingForkCopyNote
62
- } from "./chunk-S77ZKDLS.js";
62
+ } from "./chunk-77VQEATI.js";
63
63
  import {
64
64
  DEFAULT_FILE_SYSTEM_RETRY_DELAYS_MS,
65
65
  assertWorkflowLaneKey,
@@ -72,6 +72,7 @@ import {
72
72
  intersectThinkingCeilings,
73
73
  isDynamicParallelStep,
74
74
  isParallelStep,
75
+ isStatusAccessError,
75
76
  normalizeExtensionBindings,
76
77
  normalizeWorkflowLaneMetadata,
77
78
  parseThinkingLevel,
@@ -84,7 +85,7 @@ import {
84
85
  validateToolBudgetConfig,
85
86
  waitForFileSystemRetry,
86
87
  writeAtomicJson
87
- } from "./chunk-GHJ6BH5U.js";
88
+ } from "./chunk-LWH7IGI3.js";
88
89
  import {
89
90
  DIRS,
90
91
  RUNNER_LAUNCHER_NAME_PATTERN,
@@ -2172,9 +2173,11 @@ function isolateCorruptActiveRun(asyncDir, runId, error, now) {
2172
2173
  }
2173
2174
  const markerCanBeReleased = processTerminal?.state === "observed" || markerAge !== void 0 && markerAge > DEFAULT_STALE_TERMINAL_ACTIVE_MARKER_MS;
2174
2175
  let markerAction = "active marker retained because runner liveness is unknown";
2176
+ let retained = true;
2175
2177
  if (markerCanBeReleased) {
2176
2178
  try {
2177
2179
  releaseActiveRunIndex(asyncDir);
2180
+ retained = false;
2178
2181
  markerAction = processTerminal?.state === "observed" ? "active marker released after observed process-terminal proof" : "stale active marker released";
2179
2182
  } catch (releaseError) {
2180
2183
  markerAction = `failed to release active marker: ${getErrorMessage(releaseError)}`;
@@ -2189,9 +2192,10 @@ function isolateCorruptActiveRun(asyncDir, runId, error, now) {
2189
2192
  }
2190
2193
  const signature = `${fileSignature}
2191
2194
  ${line}`;
2192
- if (reportedCorruptStatus.get(statusPath) === signature) return;
2195
+ if (reportedCorruptStatus.get(statusPath) === signature) return retained;
2193
2196
  reportedCorruptStatus.set(statusPath, signature);
2194
2197
  console.error(line);
2198
+ return retained;
2195
2199
  }
2196
2200
  function isNotFoundError(error) {
2197
2201
  return typeof error === "object" && error !== null && "code" in error && error.code === "ENOENT";
@@ -2424,6 +2428,9 @@ function statusToSummary(asyncDir, status, nestedWarnings = [], nestedRoute) {
2424
2428
  ...status.sessionFile ? { sessionFile: status.sessionFile } : {}
2425
2429
  };
2426
2430
  }
2431
+ function summarizeAsyncStatus(asyncDir, status) {
2432
+ return statusToSummary(asyncDir, status);
2433
+ }
2427
2434
  function sortRuns(runs) {
2428
2435
  const rank = (state) => {
2429
2436
  switch (state) {
@@ -2523,7 +2530,7 @@ function listAsyncRuns(asyncDirRoot, options = {}, observeStatus) {
2523
2530
  } catch (error) {
2524
2531
  observeStatus?.(null);
2525
2532
  if (!activeEntries.has(entry) || !isAsyncStatusIsolationError(asyncDir, error)) throw error;
2526
- isolateCorruptActiveRun(asyncDir, entry, error, options.now);
2533
+ if (isolateCorruptActiveRun(asyncDir, entry, error, options.now) && isStatusAccessError(error, asyncDir)) options.onUnreadableActiveRun?.(entry, asyncDir);
2527
2534
  continue;
2528
2535
  }
2529
2536
  if (!status) {
@@ -4228,6 +4235,7 @@ export {
4228
4235
  formatWorkflowChecklistPhase,
4229
4236
  formatWorkflowChecklistBottleneck,
4230
4237
  formatWorkflowChecklistText,
4238
+ summarizeAsyncStatus,
4231
4239
  listAsyncRuns,
4232
4240
  formatWorkflowStageLine,
4233
4241
  formatAsyncRunOutputPath,
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  resolveWatchPath,
6
6
  writeAtomicJson
7
- } from "./chunk-GHJ6BH5U.js";
7
+ } from "./chunk-LWH7IGI3.js";
8
8
  import {
9
9
  POLL_INTERVAL_MS
10
10
  } from "./chunk-JEZOSEWG.js";
@@ -3,7 +3,7 @@ import {
3
3
  projectRuntimeAcknowledgedExtensions,
4
4
  registerSubagentPromptBoundary,
5
5
  registerSubagentPromptRuntime
6
- } from "./chunk-LEPIY76E.js";
6
+ } from "./chunk-W7NDPDDJ.js";
7
7
  import {
8
8
  INSPECTOR_ACTIONS,
9
9
  canQueueRetainedAsyncFollowUp,
@@ -25,12 +25,12 @@ import {
25
25
  updateSteeringTarget,
26
26
  waitForSteeringAction,
27
27
  workflowAsyncChildSteeringGuidance
28
- } from "./chunk-443LPCRI.js";
28
+ } from "./chunk-RHKIP45B.js";
29
29
  import {
30
30
  PLACED_RESTORE_UNSUPPORTED,
31
31
  formatHerdrMachineRunnerUnsupported,
32
32
  resolveMachinePlacement
33
- } from "./chunk-ZSCIHMUI.js";
33
+ } from "./chunk-TXC7WIPL.js";
34
34
  import {
35
35
  COMPLETION_ACTION,
36
36
  DEFAULT_CONTROL_CONFIG,
@@ -119,7 +119,7 @@ import {
119
119
  workflowScriptDigest,
120
120
  workflowStopCause,
121
121
  writeWorkflowReceipt
122
- } from "./chunk-OVBUEVOT.js";
122
+ } from "./chunk-DNDNLHTL.js";
123
123
  import {
124
124
  SUBAGENT_PARENT_SESSION_ENV,
125
125
  applyWatchdogLaunchRules,
@@ -132,7 +132,7 @@ import {
132
132
  resolveWatchdogConfig,
133
133
  sendRuleViolationWarning,
134
134
  writeWatchdogModelSettings
135
- } from "./chunk-CFIYO2IV.js";
135
+ } from "./chunk-62OHSCQ6.js";
136
136
  import {
137
137
  MAX_REMEMBERED_FOREGROUND_RUNS,
138
138
  discardRunningForegroundRun,
@@ -145,7 +145,7 @@ import {
145
145
  resolveSubagentRunId,
146
146
  resolveWorkflowChatProgress,
147
147
  stopAsyncRun
148
- } from "./chunk-7W2IQFP4.js";
148
+ } from "./chunk-464OJSDP.js";
149
149
  import {
150
150
  RunFanoutLimitError,
151
151
  annotateWorkflowPreflightTrace,
@@ -209,12 +209,12 @@ import {
209
209
  writeRunFanoutBudgetDescriptor,
210
210
  writeWorkflowLaunchRecord,
211
211
  writeWorktreeSetupHandoff
212
- } from "./chunk-6JD4XCA4.js";
212
+ } from "./chunk-U753SUBC.js";
213
213
  import {
214
214
  NATIVE_SUPERVISOR_TOOL_NAME,
215
215
  createNativeSupervisorChannel,
216
216
  resolveSupervisorChannelDir
217
- } from "./chunk-EPMRDKQT.js";
217
+ } from "./chunk-VEEUXJDO.js";
218
218
  import {
219
219
  MODEL_ONLY_TOOL,
220
220
  inheritedSessionIds,
@@ -237,10 +237,10 @@ import {
237
237
  canPreferFork,
238
238
  createForkContextResolver,
239
239
  resolveSubagentLaunchContext
240
- } from "./chunk-SWL2EITY.js";
240
+ } from "./chunk-RHMU7SXN.js";
241
241
  import {
242
242
  handleRefinementAction
243
- } from "./chunk-UQT2EQ4U.js";
243
+ } from "./chunk-Q4VH72JI.js";
244
244
  import {
245
245
  ActiveAsyncCapacityError,
246
246
  acquireActiveAsyncCapacity,
@@ -256,7 +256,7 @@ import {
256
256
  resolveDisabledFeatureSurface,
257
257
  resolveMaxActiveAsyncRunsPerSession,
258
258
  transferActiveAsyncCapacity
259
- } from "./chunk-ETDE2VYK.js";
259
+ } from "./chunk-4KQW5R6U.js";
260
260
  import {
261
261
  DEFAULT_STALE_TERMINAL_ACTIVE_MARKER_MS,
262
262
  MACHINE_DIFF_OPTIONS,
@@ -329,6 +329,7 @@ import {
329
329
  sanitizeProcessTerminal,
330
330
  shouldDeferWorktreeCwd,
331
331
  snapshotNestedEventFiles,
332
+ unobservedRunnerExitPath,
332
333
  updateActiveRunIndex,
333
334
  updateForegroundNestedProjection,
334
335
  updateMission,
@@ -343,7 +344,7 @@ import {
343
344
  writeNestedControlRequest,
344
345
  writeNestedControlResult,
345
346
  writeNestedEvent
346
- } from "./chunk-SLLZJ5EC.js";
347
+ } from "./chunk-DHY5TY2Y.js";
347
348
  import {
348
349
  closeSteerInbox,
349
350
  consumeSteerRequests,
@@ -351,7 +352,7 @@ import {
351
352
  readRevivalBriefs,
352
353
  requestAsyncSteer,
353
354
  watchAsyncControlInbox
354
- } from "./chunk-A3INCQ6Z.js";
355
+ } from "./chunk-UUW7P6KJ.js";
355
356
  import "./chunk-NIXWDZZV.js";
356
357
  import {
357
358
  INTERCOM_BRIDGE_MARKER,
@@ -360,7 +361,7 @@ import {
360
361
  resolveIntercomBridge,
361
362
  resolveIntercomSessionTarget,
362
363
  resolveSubagentIntercomTarget
363
- } from "./chunk-NONHDYXE.js";
364
+ } from "./chunk-YJIU5WF4.js";
364
365
  import {
365
366
  agentDefinitionDigest,
366
367
  resolveLaunchBinding,
@@ -375,7 +376,7 @@ import {
375
376
  resolvePiLaunchToolPlan,
376
377
  resolveRuntimeModulePath,
377
378
  supervisorChannelDir
378
- } from "./chunk-HZDLR73C.js";
379
+ } from "./chunk-AHGJSJYY.js";
379
380
  import {
380
381
  assertRequiredChildExtensionsAdmitted,
381
382
  createRequiredChildExtensionIdentity,
@@ -387,8 +388,8 @@ import {
387
388
  import {
388
389
  HERDR_PROJECT_PANE_ACTIONS,
389
390
  handleHerdrProjectPaneAction
390
- } from "./chunk-JFACGAJT.js";
391
- import "./chunk-7J4ZXMY7.js";
391
+ } from "./chunk-JEYG7CNC.js";
392
+ import "./chunk-72334PEI.js";
392
393
  import {
393
394
  PROJECT_SUBAGENTS_RELATIVE_DIR,
394
395
  appendJsonl,
@@ -401,12 +402,12 @@ import {
401
402
  missingForkCopyNote,
402
403
  writeArtifact,
403
404
  writeMetadata
404
- } from "./chunk-S77ZKDLS.js";
405
+ } from "./chunk-77VQEATI.js";
405
406
  import "./chunk-XA3DY6UG.js";
406
407
  import {
407
408
  getExternalJobProvider
408
409
  } from "./chunk-YYREO77V.js";
409
- import "./chunk-KOLLMZ2X.js";
410
+ import "./chunk-SWGB2P5J.js";
410
411
  import {
411
412
  ChainOutputValidationError,
412
413
  DEFAULT_WAIT_TOOL_NAME,
@@ -560,7 +561,7 @@ import {
560
561
  writeAtomicJson,
561
562
  writeInitialProgressFile,
562
563
  writePrivateAtomicJson
563
- } from "./chunk-GHJ6BH5U.js";
564
+ } from "./chunk-LWH7IGI3.js";
564
565
  import {
565
566
  CHAIN_RUNS_DIR,
566
567
  DEFAULT_ARTIFACT_CONFIG,
@@ -3329,6 +3330,7 @@ function executeAsyncSingle(id, params) {
3329
3330
  ...capabilityCeiling ? { capabilityCeiling } : {},
3330
3331
  agent,
3331
3332
  task: taskText,
3333
+ ...params.label ? { label: params.label } : {},
3332
3334
  ...agentConfig.runner ? { runner: agentConfig.runner } : {},
3333
3335
  ...singleClaudeCodeOverride ? { claudeCodeOverrideArgs: singleClaudeCodeOverride.args } : {},
3334
3336
  ...machine ? { machine } : {},
@@ -3452,7 +3454,7 @@ function executeAsyncSingle(id, params) {
3452
3454
  chainStepCount: 1,
3453
3455
  ...lane ? { lane } : {},
3454
3456
  ...launcher ? { launcher } : {},
3455
- steps: [{ agent, status: "pending", ...lane ? { lane } : {}, ...model ? { model } : {}, ...contextLimit !== void 0 ? { contextLimit } : {} }]
3457
+ steps: [{ agent, status: "pending", ...params.label ? { label: params.label } : {}, ...lane ? { lane } : {}, ...model ? { model } : {}, ...contextLimit !== void 0 ? { contextLimit } : {} }]
3456
3458
  },
3457
3459
  path5.join(asyncDir, "status.json"),
3458
3460
  launchParentSessionId,
@@ -5381,7 +5383,7 @@ async function runSingleAttempt(runtimeCwd, agent, task, model, options, shared)
5381
5383
  assertThinkingWithinCeiling({ model: modelArg, configThinking: effectiveThinking, ceiling: options.thinkingCeiling, agent: agent.name, runId: options.runId });
5382
5384
  const expectedModelForVerification = shared.verifyModel ? modelArg : void 0;
5383
5385
  const resolvedThinking = resolveEffectiveThinking(modelArg, effectiveThinking);
5384
- const childSessionName = deriveChildSessionName({ agent: agent.name, task: shared.originalTask ?? task });
5386
+ const childSessionName = deriveChildSessionName({ agent: agent.name, task: shared.originalTask ?? task, label: options.label });
5385
5387
  const watchdogConfig = resolveWatchdogConfig(options.cwd ?? runtimeCwd);
5386
5388
  const childWatchdog = watchdogConfig.ok ? resolveChildWatchdogConfig({
5387
5389
  config: watchdogConfig.config,
@@ -6612,7 +6614,7 @@ async function runSyncCompletionInner(runtimeCwd, agents, agentName, task, optio
6612
6614
  ...options,
6613
6615
  capabilityCeiling: intersectSubagentCapabilityCeilings(options.capabilityCeiling ?? resolveCurrentSubagentCapabilityCeiling(options.parentSessionId), options.childRuntime?.capabilityCeiling)
6614
6616
  };
6615
- const childSessionName = deriveChildSessionName({ agent: agentName, task });
6617
+ const childSessionName = deriveChildSessionName({ agent: agentName, task, label: options.label });
6616
6618
  const agent = agents.find((a) => a.name === agentName);
6617
6619
  if (!agent) {
6618
6620
  const diagnosticContext = options.unknownAgentDiagnosticContext ?? unknownAgentDiagnosticContext(discoverAgents(path10.resolve(options.cwd ?? runtimeCwd), "both"));
@@ -8450,6 +8452,7 @@ function formatRunLifecycleDebug(input) {
8450
8452
  `Status file: ${path15.join(asyncDir, "status.json")}`,
8451
8453
  status.workflowReceiptPath ? `Workflow receipt: ${status.workflowReceiptPath}` : void 0,
8452
8454
  `Process terminal file: ${path15.join(asyncDir, "process-terminal.json")}`,
8455
+ `Unobserved runner exit file: ${unobservedRunnerExitPath(asyncDir)}`,
8453
8456
  `Session: ${status.sessionId ?? "unknown"}`,
8454
8457
  `State: ${status.state}`,
8455
8458
  `Mode: ${status.mode}`,
@@ -12732,6 +12735,8 @@ async function runAsyncPath(data, deps) {
12732
12735
  runFanoutBudget: data.runFanoutBudget,
12733
12736
  parentWorkflowRunId: params.workflowParentRunId,
12734
12737
  workflowKey: params.workflowKey,
12738
+ // Top-level calls pass unknown keys through; only a workflow child's label is normalized.
12739
+ label: params.workflowParentRunId !== void 0 ? params.label : void 0,
12735
12740
  lane: params.lane,
12736
12741
  workflowAwaitAsync: params.workflowAwaitAsync
12737
12742
  }));
@@ -13325,6 +13330,7 @@ async function runSinglePath(data, deps) {
13325
13330
  runFanoutBudget: params.runFanoutAdmitted ? data.runFanoutBudget : { ...data.runFanoutBudget, parentPath: `${data.runFanoutBudget.parentPath ? `${data.runFanoutBudget.parentPath}/` : ""}single` },
13326
13331
  cwd: singleCwd,
13327
13332
  requestedCwd: data.requestedCwd,
13333
+ label: params.workflowParentRunId !== void 0 ? params.label : void 0,
13328
13334
  signal,
13329
13335
  abortedAsStopped: params.workflowParentRunId !== void 0,
13330
13336
  interruptSignal: interruptController.signal,
@@ -13973,6 +13979,9 @@ function prepareWorkflowLaunchParams(workflowDefaults, childParams, parentWorkfl
13973
13979
  ...options.suppressRoutineResultIntercom ? { suppressRoutineResultIntercom: true } : {},
13974
13980
  ...capabilityCeiling ? { capabilityCeiling } : {}
13975
13981
  };
13982
+ const label = typeof childParams.label === "string" ? childParams.label.trim() : "";
13983
+ if (label) launchParams.label = label;
13984
+ else delete launchParams.label;
13976
13985
  if (launchParams.extensionBindings !== void 0) launchParams.extensionBindings = normalizeExtensionBindings(launchParams.extensionBindings).value;
13977
13986
  const normalizedGate = normalizeGateParams(launchParams);
13978
13987
  if (!normalizedGate.ok) throw new Error(normalizedGate.error);
@@ -16703,7 +16712,7 @@ ${item.text}` } : item)
16703
16712
  }
16704
16713
  if (workflowLaunchObserver) {
16705
16714
  const singleTask = hasTasks && effectiveParams.tasks?.length === 1 ? effectiveParams.tasks[0] : void 0;
16706
- const singleSessionName = hasSingle ? deriveChildSessionName({ agent: effectiveParams.agent, task: effectiveParams.task }) : singleTask ? deriveChildSessionName({ agent: singleTask.agent, task: singleTask.task }) : void 0;
16715
+ const singleSessionName = hasSingle ? deriveChildSessionName({ agent: effectiveParams.agent, task: effectiveParams.task, label: effectiveParams.label }) : singleTask ? deriveChildSessionName({ agent: singleTask.agent, task: singleTask.task }) : void 0;
16707
16716
  const launch = hasSingle ? { agent: effectiveParams.agent, ...singleSessionName ? { sessionName: singleSessionName } : {}, sessionFile: childSessionFileForTask(effectiveParams.agent, 0, effectiveParams.model), async: effectiveAsync, runId: effectiveAsync ? asyncRunId : runId } : singleTask ? { agent: singleTask.agent, ...singleSessionName ? { sessionName: singleSessionName } : {}, sessionFile: childSessionFileForTask(singleTask.agent, 0, singleTask.model), async: effectiveAsync, runId: effectiveAsync ? asyncRunId : runId } : void 0;
16708
16717
  if (launch) {
16709
16718
  workflowLaunchObservers.delete(params);
@@ -11,7 +11,7 @@ import {
11
11
  readStatus,
12
12
  writeAtomicJson,
13
13
  writePrivateAtomicJson
14
- } from "./chunk-GHJ6BH5U.js";
14
+ } from "./chunk-LWH7IGI3.js";
15
15
  import {
16
16
  ASYNC_DIR,
17
17
  INTERCOM_DETACH_REQUEST_EVENT,
@@ -14,20 +14,20 @@ import {
14
14
  resolveCurrentSessionId,
15
15
  resolveWatchdogReviewModel,
16
16
  startWatchdogDiffBaselineCapture
17
- } from "./chunk-CFIYO2IV.js";
17
+ } from "./chunk-62OHSCQ6.js";
18
18
  import {
19
19
  agentStreamOptions,
20
20
  opencodeSessionHeaders
21
- } from "./chunk-6JD4XCA4.js";
21
+ } from "./chunk-U753SUBC.js";
22
22
  import {
23
23
  registerNativeSupervisorClient
24
- } from "./chunk-EPMRDKQT.js";
24
+ } from "./chunk-VEEUXJDO.js";
25
25
  import {
26
26
  MODEL_ONLY_TOOL
27
27
  } from "./chunk-HXRB42AF.js";
28
28
  import {
29
29
  inheritedNestedRouteOf
30
- } from "./chunk-SLLZJ5EC.js";
30
+ } from "./chunk-DHY5TY2Y.js";
31
31
  import {
32
32
  CHILD_WATCHDOG_STATUS_EVENT,
33
33
  DEFAULT_WAIT_TOOL_NAME,
@@ -46,7 +46,7 @@ import {
46
46
  toolBudgetSoftNudge,
47
47
  validateAcceptanceReport,
48
48
  validateStructuredOutputValue
49
- } from "./chunk-GHJ6BH5U.js";
49
+ } from "./chunk-LWH7IGI3.js";
50
50
  import {
51
51
  INTERCOM_SESSION_IDENTITY_EVENT
52
52
  } from "./chunk-JEZOSEWG.js";
@@ -544,10 +544,10 @@ function registerDeclaredToolCheck(pi, config, required) {
544
544
  pi.on("context_with_system", (event, ctx) => {
545
545
  const declared = new Set(getCurrentTools(event.messages).map((tool) => tool.name));
546
546
  if (required.every((name) => declared.has(name))) return void 0;
547
- const registered = new Set(pi.getAllTools().map((tool) => tool.name));
548
- const undeclared = required.filter((name) => registered.has(name) && !declared.has(name));
549
- if (undeclared.length === 0) return void 0;
550
547
  const active = new Set(pi.getActiveTools());
548
+ const undeclared = required.filter((name) => active.has(name) && !declared.has(name));
549
+ if (undeclared.length === 0) return void 0;
550
+ const registered = new Set(pi.getAllTools().map((tool) => tool.name));
551
551
  const uncallable = config.forkCacheKey ? [] : [...declared].filter((name) => !active.has(name));
552
552
  config.toolDiagnostic?.({
553
553
  ...config.agent ? { agent: config.agent } : {},
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-7F6RKT6W.js";
4
4
  import {
5
5
  getAgentDir
6
- } from "./chunk-GHJ6BH5U.js";
6
+ } from "./chunk-LWH7IGI3.js";
7
7
 
8
8
  // src/intercom/intercom-bridge.ts
9
9
  import * as fs from "node:fs";
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  requestAsyncStop
3
- } from "./chunk-A3INCQ6Z.js";
3
+ } from "./chunk-UUW7P6KJ.js";
4
4
  import "./chunk-NIXWDZZV.js";
5
- import "./chunk-GHJ6BH5U.js";
5
+ import "./chunk-LWH7IGI3.js";
6
6
  import "./chunk-JEZOSEWG.js";
7
7
  import "./chunk-YFCK7H2S.js";
8
8
  import "./chunk-QXASAHIA.js";
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-PFZZMVD5.js")).default : process.env.PI_SUBAGENT_CHILD === "1" ? void 0 : (await import("./chunk-7JLNWAMO.js")).default;
20
+ var registerExtension = process.env[HERDR_PI_MODE_ENV] === "1" ? (await import("./chunk-4X3T5CPK.js")).default : process.env.PI_SUBAGENT_CHILD === "1" ? void 0 : (await import("./chunk-LODNNILA.js")).default;
21
21
  function registerSubagentExtension(pi) {
22
22
  const installedVersion = readInstalledPackageVersion();
23
23
  if (installedVersion !== loadedPackageVersion) {
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  resolveIntercomSessionTarget
3
- } from "./chunk-NONHDYXE.js";
3
+ } from "./chunk-YJIU5WF4.js";
4
4
  import "./chunk-7F6RKT6W.js";
5
- import "./chunk-GHJ6BH5U.js";
5
+ import "./chunk-LWH7IGI3.js";
6
6
  import "./chunk-JEZOSEWG.js";
7
7
  import "./chunk-YFCK7H2S.js";
8
8
  import "./chunk-QXASAHIA.js";
@@ -2,22 +2,23 @@ import {
2
2
  buildEffectiveSystemPrompt,
3
3
  canPreferForkFromSnapshot,
4
4
  resolveSubagentLaunchContext
5
- } from "./chunk-SWL2EITY.js";
6
- import "./chunk-UQT2EQ4U.js";
5
+ } from "./chunk-RHMU7SXN.js";
6
+ import "./chunk-Q4VH72JI.js";
7
7
  import {
8
8
  loadConfig
9
- } from "./chunk-ETDE2VYK.js";
9
+ } from "./chunk-4KQW5R6U.js";
10
10
  import {
11
11
  nestedResultsPath,
12
12
  processTerminalCandidatePath,
13
13
  processTerminalPath,
14
- resultFilePath
15
- } from "./chunk-SLLZJ5EC.js";
14
+ resultFilePath,
15
+ unobservedRunnerExitPath
16
+ } from "./chunk-DHY5TY2Y.js";
16
17
  import {
17
18
  applyIntercomBridgeToAgent,
18
19
  resolveIntercomBridge,
19
20
  validateIntercomBridgeConfig
20
- } from "./chunk-NONHDYXE.js";
21
+ } from "./chunk-YJIU5WF4.js";
21
22
  import {
22
23
  AGENT_DEFINITION_PROJECTION_VERSION,
23
24
  resolveLaunchBinding,
@@ -26,7 +27,7 @@ import {
26
27
  import {
27
28
  applyThinkingSuffix,
28
29
  resolvePiLaunchToolPlan
29
- } from "./chunk-HZDLR73C.js";
30
+ } from "./chunk-AHGJSJYY.js";
30
31
  import {
31
32
  assertRequiredChildExtensionsAdmitted,
32
33
  resolveRequiredChildExtensions
@@ -34,7 +35,7 @@ import {
34
35
  import {
35
36
  getArtifactPaths,
36
37
  getArtifactsDir
37
- } from "./chunk-S77ZKDLS.js";
38
+ } from "./chunk-77VQEATI.js";
38
39
  import {
39
40
  assertClaudeCodeModelScope,
40
41
  assertThinkingWithinCeiling,
@@ -61,7 +62,7 @@ import {
61
62
  resolveSkillsWithFallback,
62
63
  resolveStepBehavior,
63
64
  unknownAgentDiagnosticContext
64
- } from "./chunk-GHJ6BH5U.js";
65
+ } from "./chunk-LWH7IGI3.js";
65
66
  import {
66
67
  DIRS,
67
68
  SUBAGENT_LIFECYCLE_ARTIFACT_VERSION,
@@ -409,7 +410,8 @@ async function resolveSubagentLaunchContract(input) {
409
410
  statusPath: path.join(lifecycleAsyncDir, "status.json"),
410
411
  eventsPath: path.join(lifecycleAsyncDir, "events.jsonl"),
411
412
  processTerminalPath: processTerminalPath(lifecycleAsyncDir),
412
- processTerminalCandidatePath: processTerminalCandidatePath(lifecycleAsyncDir)
413
+ processTerminalCandidatePath: processTerminalCandidatePath(lifecycleAsyncDir),
414
+ unobservedRunnerExitPath: unobservedRunnerExitPath(lifecycleAsyncDir)
413
415
  }
414
416
  },
415
417
  protocol: {
@@ -8,10 +8,10 @@ import {
8
8
  openProjectPane,
9
9
  projectPaneBindingPath,
10
10
  readProjectPaneBinding
11
- } from "./chunk-JFACGAJT.js";
12
- import "./chunk-7J4ZXMY7.js";
13
- import "./chunk-S77ZKDLS.js";
14
- import "./chunk-GHJ6BH5U.js";
11
+ } from "./chunk-JEYG7CNC.js";
12
+ import "./chunk-72334PEI.js";
13
+ import "./chunk-77VQEATI.js";
14
+ import "./chunk-LWH7IGI3.js";
15
15
  import "./chunk-JEZOSEWG.js";
16
16
  import "./chunk-YFCK7H2S.js";
17
17
  import "./chunk-QXASAHIA.js";
package/docs/agents.md CHANGED
@@ -269,7 +269,7 @@ A custom agent file that shadows a bundled agent replaces the bundled definition
269
269
 
270
270
  Native Pi and the six code-owned Claude Code, Codex, and Cursor profiles can run on a Herdr machine (`herdr machine add <target> --label <name>`). Herdr owns each visible agent process in a fresh no-focus pane; SSH is used only as bounded transport for Herdr RPC and ownership checks. Herdr's catalog is the host allowlist; raw ssh targets are rejected.
271
271
 
272
- For a pane on this machine you don't need a saved machine: run Pi inside Herdr and use `machine: "local"`.
272
+ For a pane on this machine you don't need a saved machine: run Pi inside Herdr and use `machine: "local"`. This means the herdr terminal multiplexer; terminals of Herdr Core (`hc`, the Herdr app's terminal server) are not supported.
273
273
 
274
274
  `machine` is a top-level frontmatter key, a settings override (`subagents.agentOverrides.<agent>.machine`, project beats user, `false` clears a pin), and a launch option on the `subagent` tool, workflow `runs.run`, chain, parallel, and dynamic-fanout steps. The launch option wins. Placement survives `subagent({ action: "disable" })`, `reset`, and model profile switches.
275
275
 
@@ -575,7 +575,7 @@ How `tools` behaves:
575
575
 
576
576
  An allowlisted name does not load the extension that registers it. Load that provider through `extensions`, `subagentOnlyExtensions`, a path-like `tools` entry, or (background children only) normal Pi extension discovery. Pi's built-in `codemode` is the exception: native children register the host SDK's official factory when codemode is permitted, without enabling it in the main session. On older Pi hosts without that factory, a child that requests codemode still reports it as unavailable; a capability ceiling that denies extensions prevents its registration.
577
577
 
578
- An extension loaded in the child can also replace the tools sent to the model, as pi-fabric's code mode does when it offers only `fabric_exec`. A child with a `tools` allowlist then fails before its first model request, and the error names the allowlisted tools the request left out. Set `extensions: []` or list only the extensions the child needs, or omit `tools` to use that extension's tool surface.
578
+ An extension loaded in the child can also replace the tools sent to the model, as pi-fabric's code mode does when it offers only `fabric_exec`. A child with a `tools` allowlist then fails before its first model request, and the error names the active allowlisted tools the request left out. Set `extensions: []` or list only the extensions the child needs, or omit `tools` to use that extension's tool surface. An allowlisted tool that an extension keeps inactive, such as pi-web-access's `web_enable` loader, can be left out of a request without failing the child.
579
579
 
580
580
  Ambient extensions depend on where the child runs. Local foreground children are sessions inside the parent Pi process and never load the parent's ambient extensions; otherwise the parent would start a second copy of each ambient extension, including this one. Background children are sessions inside the detached runner process and load the ambient extensions unless the agent sets `extensions` or the capability ceiling denies extensions. Local foreground children do inherit the providers the parent's extensions registered (`pi.registerProvider`), so their models resolve without loading those extensions again. The child gets the provider but not the registering extension's session hooks, so a provider that relies on its own hooks (for example to record each session's system prompt) can fail the child's first request; the foreground error then says so. Use `async: true` or list that extension in the agent's `subagentOnlyExtensions` or `extensions`. Pane-native remote foreground children instead use the remote machine's provider discovery and configuration. Agents that need MCP tools from an ambient adapter such as pi-mcp-adapter (including `mcp:` entries the adapter resolves) must therefore run as background children (`async: true`). A foreground launch of such an agent fails with a diagnostic that says exactly that.
581
581
 
@@ -120,7 +120,7 @@ Default keys:
120
120
  - `↑`/`↓` or `j`/`k` — select a child
121
121
  - `K`/`J` (Shift+k / Shift+j) — scroll output one line
122
122
  - `PgUp`/`PgDn` — scroll output one body viewport page (structured headers stay pinned)
123
- - `x`/`Ctrl+O` — toggle tool details
123
+ - `x`/`Ctrl+O` — toggle tool details, including the full `bash` command (multiline commands show every line)
124
124
  - `r` — refresh
125
125
  - `Esc` — close
126
126
  - `Enter` — open the selected inspectable async child through the available Inspect plugin
@@ -271,6 +271,8 @@ Lifecycle artifacts include `process-terminal-candidate.json` (private runner ev
271
271
 
272
272
  A proof is `observed` only after the live parent observes the exact detached runner's `close` event and any tracked canonical-session lease is free. Children run inside the runner process, so the candidate records no separate writer processes. If the observer is unavailable, the proof is `unknown`; do not infer process exit from `endedAt`, result-file existence, PID disappearance, or lease-directory absence.
273
273
 
274
+ When a finished run's runner PID is confirmed dead and `process-terminal.json` is still `pending`, for example because the Pi that launched it has exited, a status read writes `process-terminal-unobserved.json` with an `unknown` proof (reason `observer-unavailable`). It never touches `process-terminal.json`; status readers report it only while `process-terminal.json` is still `pending` for the same runner, so a close that is observed later still wins.
275
+
274
276
  The `subagent:process-terminal` event and RPC `ping.capabilities.processTerminalProof` expose this status. Process proof is point-in-time evidence and remains separate from execution success or stopped/non-resumable state.
275
277
 
276
278
  ### Child session events
package/docs/watchdog.md CHANGED
@@ -69,8 +69,9 @@ Child watchdog findings are lifted into the parent in three ways:
69
69
 
70
70
  ## What the reviewer is given
71
71
 
72
- - **Turn delta** with changed repo paths. Over-long input keeps the first 6,000 characters and the tail.
72
+ - **Turn delta** with changed repo paths. Over-long input keeps up to the first 6,000 characters and the tail. Whenever any of the run's turn text was left out to fit (whole turns dropped, or one long turn or the delta cut), the delta starts with a note saying how much, and the reviewer is told not to report an instruction as missing when it may be in an omitted part.
73
73
  - **Current scope** (`scope.enabled`, default on): bounded real user prompts. Side questions are additive; only explicit changes supersede older requirements. Scope survives compaction within the current session.
74
+ - **Supervisor replies** (with scope, child watchdogs): paired `contact_supervisor` decision and interview requests with their non-error replies, kept outside the turn delta so a long run cannot drop them. Each entry is bounded to 3,000 characters, with a 6,000-character recent tail kept for the session like scope.
74
75
  - **`watchdog_diff`** when inside git: diff since the session-start commit, including later commits, plus untracked paths to inspect with `read`; accepts `path` and `stat:true`.
75
76
  - **`WATCHDOG.md`** standing instructions, read fresh on every review: `<project>/.pi/WATCHDOG.md` first, then `~/.pi/agent/WATCHDOG.md`, capped at 8,000 characters. Set `guidance.watchdogMd: false` to ignore them.
76
77
  - **LSP diagnostics** from `typescript-language-server`, auto-detected in `node_modules/.bin` or `PATH`; it is never installed and never run over the whole workspace. Errors become blockers, warnings concerns, and info/hints stay in status.
@@ -122,7 +123,7 @@ With this opt-in, completed `turn_end` events retain a recent actual-activity ta
122
123
 
123
124
  New unreviewed activity permits at most one additional boundary review per user prompt even with no local edit. Side questions keep earlier authorized task evidence available; they do not themselves trigger a model call. Activity gathered after that prompt's extra review remains available for the next prompt. Warning continuations cannot supply fresh triggering activity. No polling, task scheduling, cross-worktree scans or idle calls are added.
124
125
 
125
- **Visibility limit:** external task/gate completions are visible when returned through those parent tool results. Standalone native completion notifications, arbitrary custom messages, direct shell/CI output, and events not delivered to the parent through these contracts are not ingested by this activity tail. Existing scope retains at most eight prompts (2,000 characters each); new streaming user input cancels an active review but is not added to scope unless `before_agent_start` fires. Reminders depend on retained evidence and model judgment, not an exhaustive view of running work.
126
+ **Visibility limit:** external task/gate completions are visible when returned through those parent tool results. Standalone native completion notifications, arbitrary custom messages, direct shell/CI output, and events not delivered to the parent through these contracts are not ingested by this activity tail. Existing scope retains at most eight prompts (2,000 characters each); new streaming user input cancels an active review and is added to scope. Reminders depend on retained evidence and model judgment, not an exhaustive view of running work.
126
127
 
127
128
  Set `subagents.watchdog.clarification: true` in Pi settings alongside `enabled: true`. It defaults to `false` and applies **only to the main watchdog**, not child watchdogs or child permission arbitration.
128
129