pi-subagents 0.89.1 → 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 (57) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/bundle/child-tool-plan.js +1 -1
  3. package/bundle/{chunk-TDXVQPZW.js → chunk-2UCFLUE4.js} +62 -10
  4. package/bundle/{chunk-C22YEYFZ.js → chunk-464OJSDP.js} +2 -2
  5. package/bundle/{chunk-YLU5JFW2.js → chunk-4KQW5R6U.js} +1 -1
  6. package/bundle/{chunk-7J4ZXMY7.js → chunk-72334PEI.js} +6 -4
  7. package/bundle/{chunk-6D54VW3E.js → chunk-76WVWEFE.js} +24 -15
  8. package/bundle/{chunk-R3NH5XAL.js → chunk-AHGJSJYY.js} +3 -2
  9. package/bundle/{chunk-TRN65L4F.js → chunk-DGLXVN3F.js} +1 -1
  10. package/bundle/{chunk-KCDPTXHT.js → chunk-DHY5TY2Y.js} +235 -197
  11. package/bundle/{chunk-CASL47ST.js → chunk-DYBRIEIF.js} +3 -3
  12. package/bundle/{chunk-MIX3MCIF.js → chunk-FF5K5HQU.js} +8 -3
  13. package/bundle/{chunk-URKQZHVH.js → chunk-FO2GIU5F.js} +23 -14
  14. package/bundle/{chunk-OUM6SEVD.js → chunk-JEYG7CNC.js} +6 -2
  15. package/bundle/{chunk-LUNVS6KP.js → chunk-KA4MKMYT.js} +7 -7
  16. package/bundle/{chunk-IGZTXGPG.js → chunk-ME4IS3Y3.js} +15 -15
  17. package/bundle/{chunk-BERAWSQQ.js → chunk-RHKIP45B.js} +4 -4
  18. package/bundle/{chunk-4FFKVLBG.js → chunk-SRCMJY4F.js} +3 -3
  19. package/bundle/{chunk-SG3NCWZW.js → chunk-U753SUBC.js} +1 -1
  20. package/bundle/{chunk-F6PTAPQ3.js → chunk-UBPAMRVL.js} +6 -6
  21. package/bundle/index.js +1 -1
  22. package/bundle/preflight.js +7 -5
  23. package/bundle/project-panes.js +2 -2
  24. package/docs/observability.md +3 -1
  25. package/docs/watchdog.md +3 -2
  26. package/package.json +1 -1
  27. package/src/api/preflight.d.ts +1 -0
  28. package/src/api/preflight.js +2 -1
  29. package/src/inspectors/herdr/project-panes.d.ts +2 -0
  30. package/src/inspectors/herdr/project-panes.js +7 -1
  31. package/src/inspectors/shell-command.d.ts +2 -1
  32. package/src/inspectors/shell-command.js +7 -5
  33. package/src/runs/background/active-async-capacity.js +2 -1
  34. package/src/runs/background/active-run-index.d.ts +1 -0
  35. package/src/runs/background/active-run-index.js +3 -0
  36. package/src/runs/background/async-execution.d.ts +2 -0
  37. package/src/runs/background/async-execution.js +3 -2
  38. package/src/runs/background/process-terminal.d.ts +6 -0
  39. package/src/runs/background/process-terminal.js +34 -2
  40. package/src/runs/background/run-status.js +2 -1
  41. package/src/runs/background/stale-run-reconciler.d.ts +8 -0
  42. package/src/runs/background/stale-run-reconciler.js +38 -8
  43. package/src/runs/background/workflow-terminal-proof.d.ts +0 -1
  44. package/src/runs/background/workflow-terminal-proof.js +4 -4
  45. package/src/runs/foreground/execution.js +2 -2
  46. package/src/runs/foreground/subagent-executor.d.ts +2 -0
  47. package/src/runs/foreground/subagent-executor.js +10 -1
  48. package/src/runs/shared/herdr-pane-host.js +10 -2
  49. package/src/runs/shared/mcp-config-sources.d.ts +1 -0
  50. package/src/runs/shared/mcp-config-sources.js +1 -1
  51. package/src/runs/shared/mcp-direct-tool-allowlist.js +1 -0
  52. package/src/shared/types.d.ts +2 -0
  53. package/src/tui/fleet-transcript.js +21 -9
  54. package/src/watchdog/runtime.d.ts +4 -0
  55. package/src/watchdog/runtime.js +50 -12
  56. package/src/watchdog/turn-delta.d.ts +2 -0
  57. package/src/watchdog/turn-delta.js +21 -0
package/CHANGELOG.md CHANGED
@@ -2,6 +2,26 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.89.2] - 2026-11-20
6
+
7
+ ### Highlights
8
+
9
+ - Subagents in a Herdr pane (`machine: "local"`) no longer fail to start, and Herdr project panes on Windows now work in Git Bash.
10
+ - In `/subagents-fleet`, expanded tool details show a `bash` call's whole command, including multiline scripts.
11
+ - A workflow child with a `label` is named by that label in its session name, terminal title and Fleet row.
12
+ - The child watchdog no longer tells you to undo work the supervisor approved.
13
+ - Subagents can use MCP servers configured with `"openUi": false`.
14
+
15
+ ### Fixed
16
+
17
+ - A subagent placed in a Herdr pane (`machine: "local"`) no longer fails to start with `is not an active named agent`. Herdr holds a newly started agent as pending until something asks for its state, so retrying the first prompt alone never got through. pi-subagents now waits for the agent to be ready before it prompts again. Thanks to [@TheEdgeOfRage](https://github.com/TheEdgeOfRage) for #3312.
18
+ - On Windows, a Herdr project pane now starts Pi when the pane runs Git Bash or another POSIX shell. The launch command was always written for PowerShell, so a Git Bash pane failed with `syntax error near unexpected token '&'` and never started. Thanks to [@mystery4f](https://github.com/mystery4f) for #3306.
19
+ - In `/subagents-fleet`, expanding tool details (`x` or `Ctrl+O`) now shows a `bash` call's whole command, every line wrapped to the pane, while it runs and after it finishes. Before, a multiline script such as a heredoc was cut to one line. When the saved arguments were too large to keep in full, the expanded view shows what was saved and says it was truncated. Thanks to [@power22c](https://github.com/power22c) for the report (#3308).
20
+ - A subagent started from a workflow script with a short `label` (for example `runs.run("tests", { label: "Validate sanitizer tests", agent: "worker", task: "…" })`) is now named by that label: its session name and Pi terminal title read `worker: Validate sanitizer tests`, and its Fleet row reads `Validate sanitizer tests (worker)`. Before, only the workflow's own row used the label, and the subagent was named after the first words of its task, so several children of the same agent were hard to tell apart. Thanks to [@power22c](https://github.com/power22c) for the report (#3309).
21
+ - The child watchdog no longer warns that a change the supervisor approved was unauthorised. When a subagent asks its supervisor a question and follows the answer, the watchdog now always sees that question and answer, even in a long run whose earlier turns no longer fit in its review. Before, the answer could drop out, and the watchdog reported the instruction as missing and suggested undoing correct work. The watchdog is also told when earlier turns were left out, so it doesn't treat missing evidence as proof. Thanks to [@mannainsect](https://github.com/mannainsect) for the report (#3307).
22
+ - A subagent that lists `mcp:<server>` in its `tools` now starts when that server's MCP config sets `"openUi": false`. Before, it failed with `Unresolved MCP direct-tool selectors` even though the server was connected, because pi-mcp-adapter 7 counts that setting when it checks its cached tool list and pi-subagents did not (#3310). Thanks to [@carlesba](https://github.com/carlesba) for #3311.
23
+ - A workflow no longer waits forever when one of its background subagents finishes after the Pi that started it has exited, for example because Pi was restarted. Once the subagent's process is confirmed gone, the workflow treats it as finished. Thanks to [@tdslot](https://github.com/tdslot) for the report (#3304).
24
+
5
25
  ## [0.89.1] - 2026-11-18
6
26
 
7
27
  ### Highlights
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  resolvePiLaunchToolPlan
3
- } from "./chunk-R3NH5XAL.js";
3
+ } from "./chunk-AHGJSJYY.js";
4
4
  import "./chunk-YARY7JWU.js";
5
5
  import "./chunk-LWH7IGI3.js";
6
6
  import "./chunk-JEZOSEWG.js";
@@ -8,7 +8,7 @@ import {
8
8
  projectTimeoutRecovery,
9
9
  readAsyncRecoveryDescriptor,
10
10
  utf8Tail
11
- } from "./chunk-SG3NCWZW.js";
11
+ } from "./chunk-U753SUBC.js";
12
12
  import {
13
13
  MAX_ARGS_BYTES,
14
14
  MAX_ARGS_DEPTH,
@@ -21,7 +21,7 @@ import {
21
21
  resultFilePath,
22
22
  resultPayloadMatchesSessionRun,
23
23
  resultPayloadPathForSessionRun
24
- } from "./chunk-KCDPTXHT.js";
24
+ } from "./chunk-DHY5TY2Y.js";
25
25
  import {
26
26
  PROJECT_SUBAGENTS_RELATIVE_DIR
27
27
  } from "./chunk-77VQEATI.js";
@@ -3364,12 +3364,30 @@ function formatWatchdogOrchestrationActivity(event) {
3364
3364
  }
3365
3365
  return sections.join("\n\n");
3366
3366
  }
3367
+ function formatWatchdogSupervisorReplies(event) {
3368
+ const turn = event;
3369
+ if (turn?.type !== "turn_end" || !Array.isArray(turn.message?.content) || !Array.isArray(turn.toolResults)) return [];
3370
+ const entries = [];
3371
+ for (const call of turn.message.content) {
3372
+ if (call?.type !== "toolCall" || call.name !== "contact_supervisor" || typeof call.id !== "string") continue;
3373
+ const args2 = call.arguments;
3374
+ if (!args2 || typeof args2 !== "object" || !["need_decision", "interview_request"].includes(args2.reason)) continue;
3375
+ const result2 = turn.toolResults.find((value) => {
3376
+ const result3 = value;
3377
+ return result3?.role === "toolResult" && result3.toolCallId === call.id && result3.toolName === call.name && result3.isError !== true && !result3.error;
3378
+ });
3379
+ if (result2) entries.push([formatToolCall(call.name, args2), formatWatchdogReviewMessage(result2) ?? ""].join("\n\n"));
3380
+ }
3381
+ return entries;
3382
+ }
3367
3383
 
3368
3384
  // src/watchdog/runtime.ts
3369
3385
  var DEFAULT_REVIEW = () => ({ warnings: [] });
3370
3386
  var MAX_REVIEW_INPUT_CHARS = 24e3;
3371
3387
  var REVIEW_INPUT_HEAD_CHARS = 6e3;
3372
3388
  var REVIEW_DELTA_SEPARATOR = "\n\n---\n\n";
3389
+ var MAX_SUPERVISOR_REPLY_CHARS = 3e3;
3390
+ var MAX_SUPERVISOR_REPLIES_CHARS = 6e3;
3373
3391
  function boundWatchdogReviewText(text, cap = MAX_REVIEW_INPUT_CHARS) {
3374
3392
  if (text.length <= cap) return text;
3375
3393
  const head = Math.min(REVIEW_INPUT_HEAD_CHARS, Math.floor(cap / 4));
@@ -3380,6 +3398,11 @@ function boundWatchdogReviewText(text, cap = MAX_REVIEW_INPUT_CHARS) {
3380
3398
  `;
3381
3399
  return `${text.slice(0, head)}${marker}${text.slice(text.length - (cap - head - marker.length))}`;
3382
3400
  }
3401
+ function omittedDeltaNote(chars) {
3402
+ return `[Parts of this run's turn delta omitted: about ${chars} characters are not shown, to fit the review input limit. Do not report an instruction, authorization, or action as absent unless the supplied evidence shows it; it may be in an omitted part.]`;
3403
+ }
3404
+ var OMITTED_NOTE_RESERVE = omittedDeltaNote(Number.MAX_SAFE_INTEGER).length + 2;
3405
+ var MAX_RETAINED_DELTA_CHARS = MAX_REVIEW_INPUT_CHARS - OMITTED_NOTE_RESERVE;
3383
3406
  function errorMessage2(error) {
3384
3407
  return error instanceof Error ? error.message : String(error);
3385
3408
  }
@@ -3411,6 +3434,7 @@ var MainWatchdogRuntime = class {
3411
3434
  status = "idle";
3412
3435
  pendingDeltas = [];
3413
3436
  pendingDeltaChars = 0;
3437
+ omittedDeltaChars = 0;
3414
3438
  guard = new WatchdogEmissionGuard();
3415
3439
  guardMaxWarnings = null;
3416
3440
  epoch = 0;
@@ -3449,6 +3473,7 @@ var MainWatchdogRuntime = class {
3449
3473
  activityTail = "";
3450
3474
  activityPending = false;
3451
3475
  activityReviewUsed = false;
3476
+ supervisorReplies = [];
3452
3477
  constructor(options = {}) {
3453
3478
  this.cwd = options.cwd ?? process.cwd();
3454
3479
  this.resolveConfig = options.resolveConfig ?? resolveWatchdogConfig;
@@ -3551,7 +3576,10 @@ var MainWatchdogRuntime = class {
3551
3576
  this.lspLedger.reset();
3552
3577
  this.lastLspSnapshot = void 0;
3553
3578
  }
3554
- if (options.clearScope) this.scope.reset();
3579
+ if (options.clearScope) {
3580
+ this.scope.reset();
3581
+ this.supervisorReplies = [];
3582
+ }
3555
3583
  if (options.clearScope || options.clearActivity) this.clearActivity();
3556
3584
  if (options.clearReviewInputSignature) this.lastReviewInputSignature = void 0;
3557
3585
  if (options.resetChangeSignature) this.resetRepoChangeBaseline({ reviewed: true });
@@ -3575,6 +3603,7 @@ var MainWatchdogRuntime = class {
3575
3603
  this.lastLspSnapshot = void 0;
3576
3604
  this.lspLedger.reset();
3577
3605
  this.scope.reset();
3606
+ this.supervisorReplies = [];
3578
3607
  this.observedRepoEditThisTurn = false;
3579
3608
  this.toolResultsThisRun = 0;
3580
3609
  this.midRunReviewing = false;
@@ -3609,6 +3638,7 @@ var MainWatchdogRuntime = class {
3609
3638
  this.activityPending = true;
3610
3639
  }
3611
3640
  }
3641
+ this.retainSupervisorReplies(event);
3612
3642
  this.observedRepoEditThisTurn ||= eventIndicatesRepoEdit(event);
3613
3643
  const delta = formatWatchdogTurnDelta({
3614
3644
  includeUserPrompt: this.includeUserPromptInNextDelta,
@@ -4056,37 +4086,59 @@ var MainWatchdogRuntime = class {
4056
4086
  appendBoundedDelta(delta) {
4057
4087
  let entry = delta.trim();
4058
4088
  if (!entry) return;
4059
- if (entry.length > MAX_REVIEW_INPUT_CHARS) entry = boundWatchdogReviewText(entry);
4089
+ if (entry.length > MAX_RETAINED_DELTA_CHARS) {
4090
+ this.omittedDeltaChars += entry.length - MAX_RETAINED_DELTA_CHARS;
4091
+ entry = boundWatchdogReviewText(entry, MAX_RETAINED_DELTA_CHARS);
4092
+ }
4060
4093
  this.pendingDeltas.push(entry);
4061
4094
  this.pendingDeltaChars += entry.length;
4062
- while (this.pendingDeltas.length > 1 && this.pendingDeltaChars + (this.pendingDeltas.length - 1) * REVIEW_DELTA_SEPARATOR.length > MAX_REVIEW_INPUT_CHARS) {
4095
+ while (this.pendingDeltas.length > 1 && this.pendingDeltaChars + (this.pendingDeltas.length - 1) * REVIEW_DELTA_SEPARATOR.length > MAX_RETAINED_DELTA_CHARS) {
4063
4096
  const removed = this.pendingDeltas.shift();
4064
- if (removed) this.pendingDeltaChars -= removed.length;
4097
+ if (removed) {
4098
+ this.pendingDeltaChars -= removed.length;
4099
+ this.omittedDeltaChars += removed.length;
4100
+ }
4065
4101
  }
4066
4102
  }
4103
+ // Kept outside the rolling delta so a long run cannot push the supervisor's instruction out of the review input.
4104
+ retainSupervisorReplies(event) {
4105
+ for (const reply of formatWatchdogSupervisorReplies(event)) this.supervisorReplies.push(boundWatchdogReviewText(reply, MAX_SUPERVISOR_REPLY_CHARS));
4106
+ let total = this.supervisorReplies.reduce((sum, reply) => sum + reply.length, 0);
4107
+ while (this.supervisorReplies.length > 1 && total > MAX_SUPERVISOR_REPLIES_CHARS) total -= this.supervisorReplies.shift().length;
4108
+ }
4067
4109
  buildReviewInput(changeSignature, lspBlock = "") {
4068
4110
  const input = this.pendingDeltas.join(REVIEW_DELTA_SEPARATOR);
4069
4111
  const scopeBlock = this.scopeBlock();
4070
4112
  const changes = changeSignature?.changedPaths.length ? ["Changed repo paths: every dirty path in the working tree. Authorship is not verified; a path may predate this session or come from another session.", ...changeSignature.changedPaths.slice(0, 200).map((file) => `- ${file}`)].join("\n") : "";
4071
4113
  const activity = this.activityTail ? `Recent delivered orchestration activity (oldest first; bounded observations, not a task board; waits/holds are not evidence of neglect):
4072
4114
  ${this.activityTail}` : "";
4115
+ const supervisor = this.configResult.config.scope.enabled && this.supervisorReplies.length ? `Supervisor replies this agent received through contact_supervisor (oldest first; the orchestrator's answers to this agent's questions, which can authorize or redirect its work):
4116
+ ${this.supervisorReplies.join(REVIEW_DELTA_SEPARATOR)}` : "";
4073
4117
  const contextPieces = [scopeBlock, changes, lspBlock, activity].filter(Boolean);
4074
- if (!contextPieces.length) return boundWatchdogReviewText(input);
4118
+ if (!contextPieces.length && !supervisor) return this.boundDeltaInput(input, MAX_REVIEW_INPUT_CHARS);
4075
4119
  const maxContextLength = Math.floor(MAX_REVIEW_INPUT_CHARS / 2);
4076
4120
  const maxPieceLength = Math.max(1e3, Math.floor(maxContextLength / contextPieces.length));
4077
- const boundedContext = contextPieces.map((piece) => piece.length > maxPieceLength ? piece === activity ? boundWatchdogReviewText(piece, maxPieceLength) : `${piece.slice(0, maxPieceLength - 6)}
4078
- - ...` : piece).join(REVIEW_DELTA_SEPARATOR);
4121
+ const boundedContext = [...contextPieces.map((piece) => piece.length > maxPieceLength ? piece === activity ? boundWatchdogReviewText(piece, maxPieceLength) : `${piece.slice(0, maxPieceLength - 6)}
4122
+ - ...` : piece), supervisor].filter(Boolean).join(REVIEW_DELTA_SEPARATOR);
4079
4123
  const separatorLength = input ? REVIEW_DELTA_SEPARATOR.length : 0;
4080
4124
  const inputBudget = MAX_REVIEW_INPUT_CHARS - boundedContext.length - separatorLength;
4081
- const boundedInput = inputBudget <= 0 ? "" : boundWatchdogReviewText(input, inputBudget);
4125
+ const boundedInput = inputBudget <= 0 ? "" : this.boundDeltaInput(input, inputBudget);
4082
4126
  return [boundedContext, boundedInput].filter(Boolean).join(REVIEW_DELTA_SEPARATOR);
4083
4127
  }
4128
+ boundDeltaInput(input, cap) {
4129
+ if (!input || this.omittedDeltaChars === 0 && input.length <= cap) return input;
4130
+ const bodyCap = cap - OMITTED_NOTE_RESERVE;
4131
+ return `${omittedDeltaNote(this.omittedDeltaChars + Math.max(0, input.length - bodyCap))}
4132
+
4133
+ ${boundWatchdogReviewText(input, bodyCap)}`;
4134
+ }
4084
4135
  scopeBlock() {
4085
4136
  return this.configResult.config.scope.enabled ? this.scope.render() : "";
4086
4137
  }
4087
4138
  clearPendingDeltas() {
4088
4139
  this.pendingDeltas = [];
4089
4140
  this.pendingDeltaChars = 0;
4141
+ this.omittedDeltaChars = 0;
4090
4142
  }
4091
4143
  clearActivity() {
4092
4144
  if (!this.activityTail) return;
@@ -12,7 +12,7 @@ import {
12
12
  summarizeContextModes,
13
13
  utf8Tail,
14
14
  workflowPreflightLaneForRuntimeKey
15
- } from "./chunk-SG3NCWZW.js";
15
+ } from "./chunk-U753SUBC.js";
16
16
  import {
17
17
  ownsRun
18
18
  } from "./chunk-HXRB42AF.js";
@@ -34,7 +34,7 @@ import {
34
34
  updateActiveRunIndex,
35
35
  validateModelResponseAliases,
36
36
  writeAsyncResultFile
37
- } from "./chunk-KCDPTXHT.js";
37
+ } from "./chunk-DHY5TY2Y.js";
38
38
  import {
39
39
  deliverStopRequest,
40
40
  stopInboxClosedPath
@@ -11,7 +11,7 @@ import {
11
11
  validateAuthorityPolicy,
12
12
  validateMissionStoreConfig,
13
13
  validateModelResponseAliases
14
- } from "./chunk-KCDPTXHT.js";
14
+ } from "./chunk-DHY5TY2Y.js";
15
15
  import {
16
16
  getAgentDir,
17
17
  readStatus,
@@ -6,10 +6,12 @@ function shellQuote(value, platform) {
6
6
  function isBareExecutable(value) {
7
7
  return /^[\w./@:-]+$/.test(value);
8
8
  }
9
- function formatShellCommand(exe, args, platform = process.platform) {
10
- const quotedArgs = args.map((arg) => shellQuote(arg, platform));
11
- if (platform === "win32") return `& ${[shellQuote(exe, platform), ...quotedArgs].join(" ")}`;
12
- const invocation = isBareExecutable(exe) ? exe : `sh -c 'exec "$0" "$@"' ${shellQuote(exe, platform)}`;
9
+ function formatShellCommand(exe, args, platform = process.platform, flavor = "auto") {
10
+ const posix = flavor === "posix" || flavor === "auto" && platform !== "win32";
11
+ const quotePlatform = posix ? "linux" : platform;
12
+ const quotedArgs = args.map((arg) => shellQuote(arg, quotePlatform));
13
+ if (!posix) return `& ${[shellQuote(exe, quotePlatform), ...quotedArgs].join(" ")}`;
14
+ const invocation = isBareExecutable(exe) ? exe : `sh -c 'exec "$0" "$@"' ${shellQuote(exe, quotePlatform)}`;
13
15
  return [invocation, ...quotedArgs].join(" ");
14
16
  }
15
17
 
@@ -3,7 +3,7 @@ import {
3
3
  projectRuntimeAcknowledgedExtensions,
4
4
  registerSubagentPromptBoundary,
5
5
  registerSubagentPromptRuntime
6
- } from "./chunk-CASL47ST.js";
6
+ } from "./chunk-DYBRIEIF.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-BERAWSQQ.js";
28
+ } from "./chunk-RHKIP45B.js";
29
29
  import {
30
30
  PLACED_RESTORE_UNSUPPORTED,
31
31
  formatHerdrMachineRunnerUnsupported,
@@ -119,7 +119,7 @@ import {
119
119
  workflowScriptDigest,
120
120
  workflowStopCause,
121
121
  writeWorkflowReceipt
122
- } from "./chunk-LUNVS6KP.js";
122
+ } from "./chunk-KA4MKMYT.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-TDXVQPZW.js";
135
+ } from "./chunk-2UCFLUE4.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-C22YEYFZ.js";
148
+ } from "./chunk-464OJSDP.js";
149
149
  import {
150
150
  RunFanoutLimitError,
151
151
  annotateWorkflowPreflightTrace,
@@ -209,7 +209,7 @@ import {
209
209
  writeRunFanoutBudgetDescriptor,
210
210
  writeWorkflowLaunchRecord,
211
211
  writeWorktreeSetupHandoff
212
- } from "./chunk-SG3NCWZW.js";
212
+ } from "./chunk-U753SUBC.js";
213
213
  import {
214
214
  NATIVE_SUPERVISOR_TOOL_NAME,
215
215
  createNativeSupervisorChannel,
@@ -256,7 +256,7 @@ import {
256
256
  resolveDisabledFeatureSurface,
257
257
  resolveMaxActiveAsyncRunsPerSession,
258
258
  transferActiveAsyncCapacity
259
- } from "./chunk-YLU5JFW2.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-KCDPTXHT.js";
347
+ } from "./chunk-DHY5TY2Y.js";
347
348
  import {
348
349
  closeSteerInbox,
349
350
  consumeSteerRequests,
@@ -375,7 +376,7 @@ import {
375
376
  resolvePiLaunchToolPlan,
376
377
  resolveRuntimeModulePath,
377
378
  supervisorChannelDir
378
- } from "./chunk-R3NH5XAL.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-OUM6SEVD.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,
@@ -3330,6 +3331,7 @@ function executeAsyncSingle(id, params) {
3330
3331
  ...capabilityCeiling ? { capabilityCeiling } : {},
3331
3332
  agent,
3332
3333
  task: taskText,
3334
+ ...params.label ? { label: params.label } : {},
3333
3335
  ...agentConfig.runner ? { runner: agentConfig.runner } : {},
3334
3336
  ...singleClaudeCodeOverride ? { claudeCodeOverrideArgs: singleClaudeCodeOverride.args } : {},
3335
3337
  ...machine ? { machine } : {},
@@ -3453,7 +3455,7 @@ function executeAsyncSingle(id, params) {
3453
3455
  chainStepCount: 1,
3454
3456
  ...lane ? { lane } : {},
3455
3457
  ...launcher ? { launcher } : {},
3456
- steps: [{ agent, status: "pending", ...lane ? { lane } : {}, ...model ? { model } : {}, ...contextLimit !== void 0 ? { contextLimit } : {} }]
3458
+ steps: [{ agent, status: "pending", ...params.label ? { label: params.label } : {}, ...lane ? { lane } : {}, ...model ? { model } : {}, ...contextLimit !== void 0 ? { contextLimit } : {} }]
3457
3459
  },
3458
3460
  path5.join(asyncDir, "status.json"),
3459
3461
  launchParentSessionId,
@@ -5382,7 +5384,7 @@ async function runSingleAttempt(runtimeCwd, agent, task, model, options, shared)
5382
5384
  assertThinkingWithinCeiling({ model: modelArg, configThinking: effectiveThinking, ceiling: options.thinkingCeiling, agent: agent.name, runId: options.runId });
5383
5385
  const expectedModelForVerification = shared.verifyModel ? modelArg : void 0;
5384
5386
  const resolvedThinking = resolveEffectiveThinking(modelArg, effectiveThinking);
5385
- const childSessionName = deriveChildSessionName({ agent: agent.name, task: shared.originalTask ?? task });
5387
+ const childSessionName = deriveChildSessionName({ agent: agent.name, task: shared.originalTask ?? task, label: options.label });
5386
5388
  const watchdogConfig = resolveWatchdogConfig(options.cwd ?? runtimeCwd);
5387
5389
  const childWatchdog = watchdogConfig.ok ? resolveChildWatchdogConfig({
5388
5390
  config: watchdogConfig.config,
@@ -6613,7 +6615,7 @@ async function runSyncCompletionInner(runtimeCwd, agents, agentName, task, optio
6613
6615
  ...options,
6614
6616
  capabilityCeiling: intersectSubagentCapabilityCeilings(options.capabilityCeiling ?? resolveCurrentSubagentCapabilityCeiling(options.parentSessionId), options.childRuntime?.capabilityCeiling)
6615
6617
  };
6616
- const childSessionName = deriveChildSessionName({ agent: agentName, task });
6618
+ const childSessionName = deriveChildSessionName({ agent: agentName, task, label: options.label });
6617
6619
  const agent = agents.find((a) => a.name === agentName);
6618
6620
  if (!agent) {
6619
6621
  const diagnosticContext = options.unknownAgentDiagnosticContext ?? unknownAgentDiagnosticContext(discoverAgents(path10.resolve(options.cwd ?? runtimeCwd), "both"));
@@ -8451,6 +8453,7 @@ function formatRunLifecycleDebug(input) {
8451
8453
  `Status file: ${path15.join(asyncDir, "status.json")}`,
8452
8454
  status.workflowReceiptPath ? `Workflow receipt: ${status.workflowReceiptPath}` : void 0,
8453
8455
  `Process terminal file: ${path15.join(asyncDir, "process-terminal.json")}`,
8456
+ `Unobserved runner exit file: ${unobservedRunnerExitPath(asyncDir)}`,
8454
8457
  `Session: ${status.sessionId ?? "unknown"}`,
8455
8458
  `State: ${status.state}`,
8456
8459
  `Mode: ${status.mode}`,
@@ -12736,6 +12739,8 @@ async function runAsyncPath(data, deps) {
12736
12739
  runFanoutBudget: data.runFanoutBudget,
12737
12740
  parentWorkflowRunId: params.workflowParentRunId,
12738
12741
  workflowKey: params.workflowKey,
12742
+ // Top-level calls pass unknown keys through; only a workflow child's label is normalized.
12743
+ label: params.workflowParentRunId !== void 0 ? params.label : void 0,
12739
12744
  lane: params.lane,
12740
12745
  workflowAwaitAsync: params.workflowAwaitAsync
12741
12746
  }));
@@ -13329,6 +13334,7 @@ async function runSinglePath(data, deps) {
13329
13334
  runFanoutBudget: params.runFanoutAdmitted ? data.runFanoutBudget : { ...data.runFanoutBudget, parentPath: `${data.runFanoutBudget.parentPath ? `${data.runFanoutBudget.parentPath}/` : ""}single` },
13330
13335
  cwd: singleCwd,
13331
13336
  requestedCwd: data.requestedCwd,
13337
+ label: params.workflowParentRunId !== void 0 ? params.label : void 0,
13332
13338
  signal,
13333
13339
  abortedAsStopped: params.workflowParentRunId !== void 0,
13334
13340
  interruptSignal: interruptController.signal,
@@ -13977,6 +13983,9 @@ function prepareWorkflowLaunchParams(workflowDefaults, childParams, parentWorkfl
13977
13983
  ...options.suppressRoutineResultIntercom ? { suppressRoutineResultIntercom: true } : {},
13978
13984
  ...capabilityCeiling ? { capabilityCeiling } : {}
13979
13985
  };
13986
+ const label = typeof childParams.label === "string" ? childParams.label.trim() : "";
13987
+ if (label) launchParams.label = label;
13988
+ else delete launchParams.label;
13980
13989
  if (launchParams.extensionBindings !== void 0) launchParams.extensionBindings = normalizeExtensionBindings(launchParams.extensionBindings).value;
13981
13990
  const normalizedGate = normalizeGateParams(launchParams);
13982
13991
  if (!normalizedGate.ok) throw new Error(normalizedGate.error);
@@ -16705,7 +16714,7 @@ ${item.text}` } : item)
16705
16714
  }
16706
16715
  if (workflowLaunchObserver) {
16707
16716
  const singleTask = hasTasks && effectiveParams.tasks?.length === 1 ? effectiveParams.tasks[0] : void 0;
16708
- const singleSessionName = hasSingle ? deriveChildSessionName({ agent: effectiveParams.agent, task: effectiveParams.task }) : singleTask ? deriveChildSessionName({ agent: singleTask.agent, task: singleTask.task }) : void 0;
16717
+ const singleSessionName = hasSingle ? deriveChildSessionName({ agent: effectiveParams.agent, task: effectiveParams.task, label: effectiveParams.label }) : singleTask ? deriveChildSessionName({ agent: singleTask.agent, task: singleTask.task }) : void 0;
16709
16718
  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;
16710
16719
  if (launch) {
16711
16720
  workflowLaunchObservers.delete(params);
@@ -51,7 +51,7 @@ function isMcpServerDefinition(value) {
51
51
  for (const field of ["env", "headers"]) {
52
52
  if (value[field] !== void 0 && !isStringRecord(value[field])) return false;
53
53
  }
54
- for (const field of ["exposeResources", "literalEnv", "inheritEnv"]) {
54
+ for (const field of ["exposeResources", "literalEnv", "inheritEnv", "openUi"]) {
55
55
  if (value[field] !== void 0 && typeof value[field] !== "boolean") return false;
56
56
  }
57
57
  if (value.requestHeadersCommand !== void 0 && !isRequestHeadersCommand(value.requestHeadersCommand)) return false;
@@ -802,7 +802,8 @@ function computeMcpServerHash(definition) {
802
802
  exposeResources: definition.exposeResources,
803
803
  includeTools: definition.includeTools,
804
804
  excludeTools: definition.excludeTools,
805
- protocolVersion: definition.protocolVersion
805
+ protocolVersion: definition.protocolVersion,
806
+ ...definition.openUi === false ? { openUi: false } : {}
806
807
  };
807
808
  return createHash("sha256").update(stableStringify(identity)).digest("hex");
808
809
  }
@@ -1,7 +1,7 @@
1
1
  // package.json
2
2
  var package_default = {
3
3
  name: "pi-subagents",
4
- version: "0.89.1",
4
+ version: "0.89.2",
5
5
  private: true,
6
6
  description: "Pi extension for single-agent delegation and scripted multi-agent workflows",
7
7
  author: "Nico Bailon",