pi-subagents 0.85.0 → 0.86.0

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 (51) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/bundle/agents.js +3 -3
  3. package/bundle/child-tool-plan.js +2 -2
  4. package/bundle/{chunk-JWYG26RE.js → chunk-2IYBCYFU.js} +24 -23
  5. package/bundle/{chunk-KEY3UQMQ.js → chunk-374MZFF4.js} +1 -1
  6. package/bundle/{chunk-CS4O36CZ.js → chunk-3RKFH2UZ.js} +5 -5
  7. package/bundle/{chunk-7MAE3DJV.js → chunk-5H4BICQZ.js} +1 -1
  8. package/bundle/{chunk-RV5OGHLO.js → chunk-6VD7BGIC.js} +2 -2
  9. package/bundle/{chunk-KDMFBYFM.js → chunk-77ASNIEM.js} +1 -1
  10. package/bundle/{chunk-JNXT3MPI.js → chunk-7ADDXUGF.js} +5 -5
  11. package/bundle/{chunk-O7CPL6H4.js → chunk-7QA7ZA46.js} +9 -9
  12. package/bundle/{chunk-HFTBF7SG.js → chunk-7ZUFN6ME.js} +1 -1
  13. package/bundle/{chunk-RQAUNAWG.js → chunk-A637IMAO.js} +2 -2
  14. package/bundle/{chunk-LTPH2DXH.js → chunk-BGXEAYUM.js} +3 -3
  15. package/bundle/{chunk-JO67XSKD.js → chunk-BU6PFPVX.js} +4 -4
  16. package/bundle/{chunk-WOVMHDES.js → chunk-BWC2LVII.js} +39 -45
  17. package/bundle/{chunk-LGMILZNE.js → chunk-GJGTMLPE.js} +2 -2
  18. package/bundle/{chunk-PHZP3KHB.js → chunk-GRJHIXYF.js} +1 -1
  19. package/bundle/{chunk-QO75KJBT.js → chunk-LGINOOY5.js} +2 -2
  20. package/bundle/{chunk-GCSLVFCX.js → chunk-NAFLUJ26.js} +1 -1
  21. package/bundle/{chunk-3UZ5FVVJ.js → chunk-O3YH7XIY.js} +35 -31
  22. package/bundle/{chunk-PVIVCDG2.js → chunk-PYOAIN3V.js} +2 -2
  23. package/bundle/{chunk-UX4SCV5N.js → chunk-QGO6HXHG.js} +80 -35
  24. package/bundle/{chunk-DV2NCNPR.js → chunk-QM3JGE4W.js} +11 -11
  25. package/bundle/{chunk-H2NLFTC5.js → chunk-S2Q75LP3.js} +1 -1
  26. package/bundle/{chunk-KZ34KQQH.js → chunk-UR7OW5S7.js} +4 -4
  27. package/bundle/{chunk-L2ENOFVZ.js → chunk-WN2E5XHN.js} +66 -26
  28. package/bundle/{chunk-N7B2KD74.js → chunk-YK3QYNLE.js} +1 -1
  29. package/bundle/{chunk-IQIWF2VX.js → chunk-ZJJCPV3L.js} +4 -4
  30. package/bundle/{chunk-T5V5BRCL.js → chunk-ZPY5QZCS.js} +1 -1
  31. package/bundle/control-channel.js +2 -2
  32. package/bundle/index.js +1 -1
  33. package/bundle/intercom-bridge.js +2 -2
  34. package/bundle/preflight.js +8 -8
  35. package/bundle/project-panes.js +3 -3
  36. package/docs/agents.md +6 -0
  37. package/docs/configuration.md +2 -2
  38. package/docs/tool-reference.md +2 -0
  39. package/package.json +1 -1
  40. package/src/extension/tool-activation.js +10 -1
  41. package/src/extension/tool-description.d.ts +1 -1
  42. package/src/extension/tool-description.js +8 -8
  43. package/src/runs/background/run-status.js +5 -4
  44. package/src/runs/background/subagent-runner.js +6 -6
  45. package/src/runs/shared/acceptance.js +69 -26
  46. package/src/runs/shared/external-cli-contract.d.ts +49 -0
  47. package/src/runs/shared/external-cli-contract.js +18 -13
  48. package/src/runs/shared/structured-output.js +10 -3
  49. package/src/shared/types.d.ts +57 -48
  50. package/src/tui/render.js +83 -22
  51. package/src/workflows/workflow-receipt.js +36 -53
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  buildWorkflowChatProgressRows
3
- } from "./chunk-KZ34KQQH.js";
3
+ } from "./chunk-UR7OW5S7.js";
4
4
  import {
5
5
  aggregateStepStatus,
6
6
  contextModeBadge,
@@ -21,7 +21,7 @@ import {
21
21
  projectAsyncWorkflowRows,
22
22
  projectWorkflowChecklist,
23
23
  workflowGraphStageNodes
24
- } from "./chunk-LTPH2DXH.js";
24
+ } from "./chunk-BGXEAYUM.js";
25
25
  import {
26
26
  isStaleExtensionContextError,
27
27
  isUnboundExtensionRuntimeError,
@@ -33,7 +33,7 @@ import {
33
33
  formatWorkflowJsonPreview,
34
34
  hostStepReportName,
35
35
  hostStepVerdictLabel
36
- } from "./chunk-LGMILZNE.js";
36
+ } from "./chunk-GJGTMLPE.js";
37
37
  import {
38
38
  snapshotExternalRuns
39
39
  } from "./chunk-UKG4V45O.js";
@@ -51,7 +51,7 @@ import {
51
51
  getSingleResultOutput,
52
52
  shortenPath,
53
53
  unresolvedChildWatchdogBlockers
54
- } from "./chunk-UX4SCV5N.js";
54
+ } from "./chunk-QGO6HXHG.js";
55
55
  import {
56
56
  MAX_WIDGET_JOBS,
57
57
  WIDGET_ANIMATION_INTERVAL_MS,
@@ -337,6 +337,27 @@ function compactTaskText(task, label) {
337
337
  if (!normalized) return void 0;
338
338
  return previewDisplayText(normalized, COMPACT_TASK_MAX_CHARS);
339
339
  }
340
+ var EXPANDED_TASK_MAX_LINES = 8;
341
+ function expandedTaskLines(task, label, width) {
342
+ const taskText = task?.trim();
343
+ if (!taskText || taskText === PROMPT_REDACTED || width <= 0) return void 0;
344
+ const shown = truncateDisplayText(taskText, EXPANDED_TASK_MAX_LINES * width);
345
+ const labelText = label?.trim() && label.trim() !== PROMPT_REDACTED ? sanitizeDisplayText(label) : "";
346
+ const head = labelText && labelText !== sanitizeDisplayText(shown) ? `${labelText} \u2014 ` : "";
347
+ const lines = [];
348
+ for (const rawLine of `task: ${head}${shown}`.split("\n")) {
349
+ const content = sanitizeDisplayText(rawLine);
350
+ if (!content) {
351
+ if (lines.length > 0 && lines[lines.length - 1] !== "") lines.push("");
352
+ continue;
353
+ }
354
+ const indent = rawLine.match(/^[ \t]*/)[0].replace(/\t/g, " ").slice(0, Math.floor(width / 2));
355
+ for (const part of wrapPlainText(content, width - indent.length)) lines.push(`${indent}${part}`);
356
+ if (lines.length > EXPANDED_TASK_MAX_LINES) break;
357
+ }
358
+ if (lines.length <= EXPANDED_TASK_MAX_LINES && shown.length === taskText.length) return lines;
359
+ return [...lines.slice(0, EXPANDED_TASK_MAX_LINES), "\u2026"];
360
+ }
340
361
  var LANE_VALUE_MAX_CHARS = 48;
341
362
  function boundedLaneValue(value, maxChars = LANE_VALUE_MAX_CHARS) {
342
363
  if (!value?.trim() || value.trim() === PROMPT_REDACTED) return void 0;
@@ -1400,14 +1421,14 @@ function widgetStepActivity(step, snapshotNow) {
1400
1421
  if (activity) return activity;
1401
1422
  return facts.join(" \xB7 ");
1402
1423
  }
1403
- function widgetChainDetails(job, theme, expanded = false, width = getTermWidth(), frame) {
1424
+ function widgetChainDetails(job, theme, expanded = false, width = getTermWidth(), frame, fullTask = false) {
1404
1425
  if (!job.steps?.length) return [];
1405
1426
  const total = job.chainStepCount ?? job.steps.length;
1406
1427
  const lines = [];
1407
1428
  for (const span of buildAsyncChainStepSpans(total, job.steps.length, job.parallelGroups)) {
1408
1429
  const steps = job.steps.slice(span.start, span.start + span.count);
1409
1430
  if (span.isParallel) {
1410
- lines.push(...parallelWidgetGroupDetails(job, theme, { steps, total: span.count, stepIndex: span.stepIndex, chainTotal: total }, expanded, width, frame, false));
1431
+ lines.push(...parallelWidgetGroupDetails(job, theme, { steps, total: span.count, stepIndex: span.stepIndex, chainTotal: total }, expanded, width, frame, false, fullTask));
1411
1432
  continue;
1412
1433
  }
1413
1434
  const step = steps[0];
@@ -1415,16 +1436,18 @@ function widgetChainDetails(job, theme, expanded = false, width = getTermWidth()
1415
1436
  lines.push(` ${theme.fg("dim", `\u25E6 Step ${span.stepIndex + 1}/${total}: pending`)}`);
1416
1437
  continue;
1417
1438
  }
1418
- lines.push(...foregroundStyleWidgetStepLines(job, theme, step, "Step", span.stepIndex + 1, total, expanded, width, frame));
1439
+ lines.push(...foregroundStyleWidgetStepLines(job, theme, step, "Step", span.stepIndex + 1, total, expanded, width, frame, { fullTask }));
1419
1440
  }
1420
1441
  return lines;
1421
1442
  }
1422
- function widgetParallelAgentDetails(job, theme, expanded = false, width = getTermWidth(), frame) {
1443
+ function widgetParallelAgentDetails(job, theme, expanded = false, width = getTermWidth(), frame, fullTask = false) {
1423
1444
  if (!job.steps?.length) return [];
1445
+ const taskLines = (step, indent) => expanded && fullTask && step.status === "running" ? (expandedTaskLines(step.description, step.label, width - indent.length - 4) ?? []).map((line) => `${indent}${theme.fg("dim", line)}`) : [];
1446
+ if (job.mode === "single") return job.steps.flatMap((step) => taskLines(step, " "));
1424
1447
  if (job.mode !== "parallel" && job.mode !== "chain") return [];
1425
- if (job.mode === "chain" && !job.activeParallelGroup && job.parallelGroups?.length) return widgetChainDetails(job, theme, expanded, width, frame);
1448
+ if (job.mode === "chain" && !job.activeParallelGroup && job.parallelGroups?.length) return widgetChainDetails(job, theme, expanded, width, frame, fullTask);
1426
1449
  const group = activeParallelWidgetGroup(job);
1427
- if (group) return parallelWidgetGroupDetails(job, theme, group, expanded, width, frame, Boolean(job.activeParallelGroup));
1450
+ if (group) return parallelWidgetGroupDetails(job, theme, group, expanded, width, frame, Boolean(job.activeParallelGroup), fullTask);
1428
1451
  const total = job.stepsTotal ?? job.steps.length;
1429
1452
  const lines = [];
1430
1453
  for (const [index, step] of job.steps.entries()) {
@@ -1436,6 +1459,7 @@ function widgetParallelAgentDetails(job, theme, expanded = false, width = getTer
1436
1459
  const display = step.sessionName?.trim() || (label ? `${label} (${step.agent})` : step.agent);
1437
1460
  const thinking = childThinkingLevel(step);
1438
1461
  lines.push(` ${theme.fg("dim", `${marker} ${widgetStepGlyph(step.status, theme, widgetStepRunningSeed(step, index), frame, thinking)} ${itemTitle} ${index + 1}/${total}: ${display} \xB7 ${widgetStepStatus(step.status, theme, thinking)}${modelDisplay}${activity ? ` \xB7 ${activity}` : ""}`)}`);
1462
+ lines.push(...taskLines(step, " "));
1439
1463
  const lane = projectAsyncLane(job, step);
1440
1464
  if (lane) lines.push(...formatLaneProjectionLines(lane, theme, " "));
1441
1465
  for (const nestedLine of formatNestedWidgetLines(step.children, theme, width, expanded, job.updatedAt, expanded ? 8 : 6)) lines.push(` ${nestedLine}`);
@@ -1560,7 +1584,7 @@ function parallelWidgetGroupHeader(group, theme, frame) {
1560
1584
  const label = group.stepIndex !== void 0 && group.chainTotal !== void 0 ? `Step ${group.stepIndex + 1}/${group.chainTotal}: parallel group` : "parallel group";
1561
1585
  return ` ${widgetStepGlyph(status, theme, widgetStepsRunningSeed(group.steps), frame)} ${themeBold(theme, label)} ${theme.fg("dim", "\xB7")} ${theme.fg("dim", formatParallelOutcome(group.steps, group.total))}`;
1562
1586
  }
1563
- function parallelWidgetGroupDetails(job, theme, group, expanded, width, frame, prioritizeActive) {
1587
+ function parallelWidgetGroupDetails(job, theme, group, expanded, width, frame, prioritizeActive, fullTask = false) {
1564
1588
  const lines = [parallelWidgetGroupHeader(group, theme, frame)];
1565
1589
  const rows = parallelWidgetStepRows(group.steps, group.total, prioritizeActive);
1566
1590
  for (const [rowIndex, row] of rows.entries()) {
@@ -1570,7 +1594,8 @@ function parallelWidgetGroupDetails(job, theme, group, expanded, width, frame, p
1570
1594
  rowIndent: " ",
1571
1595
  detailIndent: " ",
1572
1596
  rowMarker: marker,
1573
- includeCurrentPath: true
1597
+ includeCurrentPath: true,
1598
+ fullTask
1574
1599
  }));
1575
1600
  }
1576
1601
  for (let index = rows.length; index < group.total; index++) {
@@ -1973,7 +1998,9 @@ function foregroundStyleWidgetStepLines(job, theme, step, itemTitle, index, tota
1973
1998
  const lines = [`${rowIndent}${rowMarker}${widgetStepGlyph(step.status, theme, widgetStepRunningSeed(step, index - 1), frame, thinking)} ${themeBold(theme, rowLabel)}${contextModeBadge(theme, step.context)} ${theme.fg("dim", "\xB7")} ${status}${modelDisplay}${stats ? ` ${theme.fg("dim", "\xB7")} ${stats}` : ""}`];
1974
1999
  const lane = projectAsyncLane(job, step);
1975
2000
  if (lane) lines.push(...formatLaneProjectionLines(lane, theme, detailIndent));
1976
- const task = collapseDetails ? stepTaskSummary(step, displayName) : compactTaskText(step.description, step.label);
2001
+ const fullTask = expanded && options?.fullTask && step.status === "running" ? expandedTaskLines(step.description, step.label, width - detailIndent.length - 4) : void 0;
2002
+ const task = fullTask ? void 0 : collapseDetails ? stepTaskSummary(step, displayName) : compactTaskText(step.description, step.label);
2003
+ for (const line of fullTask ?? []) lines.push(`${detailIndent}${theme.fg("dim", line)}`);
1977
2004
  if (task) lines.push(`${detailIndent}${theme.fg("dim", `task: ${task}`)}`);
1978
2005
  const activity = widgetStepActivityLine(step, width, expanded, job.updatedAt);
1979
2006
  const currentPath = options?.includeCurrentPath && step.currentPath ? shortenPath(step.currentPath) : void 0;
@@ -2023,7 +2050,7 @@ function hostStepWidgetLines(job, theme, indent) {
2023
2050
  if (rows.length > visible.length) lines.push(`${indent}${theme.fg("dim", `\u2026 +${rows.length - visible.length} host steps hidden`)}`);
2024
2051
  return lines;
2025
2052
  }
2026
- function foregroundStyleWidgetDetails(job, theme, expanded, width, frame, projection = buildWorkflowWidgetProjection(job)) {
2053
+ function foregroundStyleWidgetDetails(job, theme, expanded, width, frame, projection = buildWorkflowWidgetProjection(job), fullTask = false) {
2027
2054
  const steps = projection.steps.filter((step) => !projection.materializedKeys?.has(step.workflowKey ?? "") && !projection.materializedKeys?.has(step.runId ?? ""));
2028
2055
  const checklist = widgetChecklistWithoutMaterializedChildren(projection);
2029
2056
  if (!expanded && job.mode === "workflow") {
@@ -2040,14 +2067,14 @@ function foregroundStyleWidgetDetails(job, theme, expanded, width, frame, projec
2040
2067
  ...formatNestedWidgetLines(job.nestedChildren, theme, width, expanded, job.updatedAt, expanded ? 12 : 6).map((line) => ` ${line}`)
2041
2068
  ];
2042
2069
  }
2043
- if (job.mode === "chain" && !job.activeParallelGroup && job.parallelGroups?.length) return widgetChainDetails(job, theme, expanded, width, frame);
2070
+ if (job.mode === "chain" && !job.activeParallelGroup && job.parallelGroups?.length) return widgetChainDetails(job, theme, expanded, width, frame, fullTask);
2044
2071
  const lines = [
2045
2072
  ...expanded ? workflowPreflightLines(job) : [],
2046
2073
  ...workflowChecklistWidgetLines(checklist, theme, " ", expanded, frame, { includeItemErrors: !expanded, liveWidget: true })
2047
2074
  ];
2048
2075
  const group = activeParallelWidgetGroup(job);
2049
2076
  if (group) {
2050
- lines.push(...parallelWidgetGroupDetails(job, theme, group, expanded, width, frame, Boolean(job.activeParallelGroup)));
2077
+ lines.push(...parallelWidgetGroupDetails(job, theme, group, expanded, width, frame, Boolean(job.activeParallelGroup), fullTask));
2051
2078
  } else {
2052
2079
  const { stageProgress, plannedKeys } = projection;
2053
2080
  const total = job.mode === "chain" ? job.chainStepCount ?? job.stepsTotal ?? steps.length : stageProgress?.total ?? job.stepsTotal ?? steps.length;
@@ -2059,7 +2086,7 @@ function foregroundStyleWidgetDetails(job, theme, expanded, width, frame, projec
2059
2086
  const itemTitle = isPlannedStage ? "Stage" : "Step";
2060
2087
  const displayIndex = isPlannedStage ? (step.index ?? index) + 1 : plannedKeys ? ++extraStepIndex : index + 1;
2061
2088
  const displayTotal = isPlannedStage ? stageTotal : extraStepCount;
2062
- lines.push(...foregroundStyleWidgetStepLines(job, theme, step, itemTitle, displayIndex, displayTotal, expanded, width, frame));
2089
+ lines.push(...foregroundStyleWidgetStepLines(job, theme, step, itemTitle, displayIndex, displayTotal, expanded, width, frame, { fullTask }));
2063
2090
  }
2064
2091
  }
2065
2092
  lines.push(...hostStepWidgetLines(job, theme, " "));
@@ -2070,7 +2097,7 @@ function foregroundStyleWidgetDetails(job, theme, expanded, width, frame, projec
2070
2097
  }
2071
2098
  return lines;
2072
2099
  }
2073
- function buildSingleWidgetLines(job, theme, width, expanded, frame, projection = buildWorkflowWidgetProjection(job), reservedLines = 0) {
2100
+ function buildSingleWidgetLines(job, theme, width, expanded, frame, projection = buildWorkflowWidgetProjection(job), reservedLines = 0, fullTask = false) {
2074
2101
  if ((!expanded || projection.inlineFleetCovered) && job.mode === "workflow") return [compactWorkflowHeaderLine(job, theme, width), ...compactWorkflowWidgetBodyLines(job, theme, frame, projection, widgetLineBudget(expanded) - 1 - reservedLines)].map((line) => truncLine(line, width));
2075
2102
  const stats = widgetStats(job, theme, projection, !expanded);
2076
2103
  const count = job.mode === "workflow" ? projection.checklist?.total ?? projection.stageProgress?.total ?? job.stepsTotal ?? job.agents?.length ?? job.steps?.length : job.mode === "chain" ? job.chainStepCount : projection.stageProgress?.total ?? job.stepsTotal ?? job.agents?.length ?? job.steps?.length;
@@ -2082,7 +2109,7 @@ function buildSingleWidgetLines(job, theme, width, expanded, frame, projection =
2082
2109
  return [
2083
2110
  `${theme.fg("toolTitle", themeBold(theme, title))} ${theme.fg("dim", "\xB7 background")}`,
2084
2111
  ...collapseDetails ? [] : [summary],
2085
- ...foregroundStyleWidgetDetails(job, theme, expanded, width, frame, projection)
2112
+ ...foregroundStyleWidgetDetails(job, theme, expanded, width, frame, projection, fullTask)
2086
2113
  ].map((line) => truncLine(line, width));
2087
2114
  }
2088
2115
  function compactSingleWidgetLines(job, theme, width, frame, projection = buildWorkflowWidgetProjection(job)) {
@@ -2441,7 +2468,7 @@ function widgetChecklistWithoutMaterializedChildren(projection) {
2441
2468
  if (!checklist || !materializedKeys) return checklist;
2442
2469
  return { ...checklist, phases: checklist.phases.map((phase) => ({ ...phase, items: phase.items.filter((item) => !materializedKeys.has(item.key)) })) };
2443
2470
  }
2444
- function materializedWidgetChildLines(job, theme, width, expanded, frame, projectionFor) {
2471
+ function materializedWidgetChildLines(job, theme, width, expanded, frame, projectionFor, fullTask = false) {
2445
2472
  const { children, inlineFleetCovered } = projectionFor(job);
2446
2473
  if (inlineFleetCovered || !children?.length) return [];
2447
2474
  const lines = [];
@@ -2452,8 +2479,8 @@ function materializedWidgetChildLines(job, theme, width, expanded, frame, projec
2452
2479
  const identity = child.workflowKey ?? child.asyncId;
2453
2480
  const stats = widgetStats(child, theme, projection, !expanded);
2454
2481
  lines.push(` ${last ? "\u2514\u2500" : "\u251C\u2500"} ${theme.bold(identity)} ${widgetStatusGlyph(child, theme, frame)} ${themeBold(theme, widgetJobName(child))}${contextModeBadge(theme, child.context)}${stats ? ` ${theme.fg("dim", "\xB7")} ${stats}` : ""}`);
2455
- for (const detail of foregroundStyleWidgetDetails(child, theme, expanded, Math.max(0, width - 6), frame, projection)) lines.push(` ${last ? " " : "\u2502 "}${detail}`);
2456
- for (const detail of materializedWidgetChildLines(child, theme, Math.max(0, width - 4), expanded, frame, projectionFor)) lines.push(` ${detail}`);
2482
+ for (const detail of foregroundStyleWidgetDetails(child, theme, expanded, Math.max(0, width - 6), frame, projection, fullTask)) lines.push(` ${last ? " " : "\u2502 "}${detail}`);
2483
+ for (const detail of materializedWidgetChildLines(child, theme, Math.max(0, width - 4), expanded, frame, projectionFor, fullTask)) lines.push(` ${detail}`);
2457
2484
  }
2458
2485
  if (shown.length < children.length) lines.push(` +${children.length - shown.length} more workflow children`);
2459
2486
  return lines;
@@ -2537,11 +2564,24 @@ function buildWidgetComponent(jobs, ui, initiallyCollapsed = false, layout) {
2537
2564
  return component;
2538
2565
  };
2539
2566
  }
2567
+ function runningWidgetChildCount(jobs, projectionFor) {
2568
+ let running = 0;
2569
+ for (const job of jobs) {
2570
+ const { steps, materializedKeys, children } = projectionFor(job);
2571
+ if (!steps.length && job.status === "running") running++;
2572
+ for (const step of steps) {
2573
+ if (step.status === "running" && !materializedKeys?.has(step.workflowKey ?? "") && !materializedKeys?.has(step.runId ?? "")) running++;
2574
+ }
2575
+ if (children?.length) running += runningWidgetChildCount(children, projectionFor);
2576
+ }
2577
+ return running;
2578
+ }
2540
2579
  function buildWidgetLinesWithProjection(jobs, theme, width = getTermWidth(), expanded = false, frame, projectionFor = workflowWidgetProjectionLookup()) {
2541
2580
  if (jobs.length === 0) return [];
2581
+ const fullTask = expanded && runningWidgetChildCount(jobs, projectionFor) === 1;
2542
2582
  if (jobs.length === 1) {
2543
- const childLines = materializedWidgetChildLines(jobs[0], theme, width, expanded, frame, projectionFor).map((line) => truncLine(line, width));
2544
- return [...buildSingleWidgetLines(jobs[0], theme, width, expanded, frame, projectionFor(jobs[0]), childLines.length), ...childLines];
2583
+ const childLines = materializedWidgetChildLines(jobs[0], theme, width, expanded, frame, projectionFor, fullTask).map((line) => truncLine(line, width));
2584
+ return [...buildSingleWidgetLines(jobs[0], theme, width, expanded, frame, projectionFor(jobs[0]), childLines.length, fullTask), ...childLines];
2545
2585
  }
2546
2586
  const running = jobs.filter((job) => job.status === "running");
2547
2587
  const queued = jobs.filter((job) => job.status === "queued");
@@ -2565,12 +2605,12 @@ function buildWidgetLinesWithProjection(jobs, theme, width = getTermWidth(), exp
2565
2605
  ` ${theme.fg("dim", `\u23BF ${widgetActivity(job)}`)}`,
2566
2606
  ...widgetLaneDetailLines(job, theme, projection),
2567
2607
  ...workflowChecklistWidgetLines(widgetChecklistWithoutMaterializedChildren(projection), theme, " ", expanded, frame, { includeItemErrors: !expanded || !job.steps?.length, liveWidget: true }),
2568
- ...widgetParallelAgentDetails(job, theme, expanded, width, frame)
2608
+ ...widgetParallelAgentDetails(job, theme, expanded, width, frame, fullTask)
2569
2609
  ];
2570
2610
  const item = [
2571
2611
  compactWorkflow ? compactWorkflowHeaderLine(job, theme, width) : `${widgetStatusGlyph(job, theme, frame)} ${themeBold(theme, widgetJobName(job))}${contextModeBadge(theme, job.context)}${stats ? ` ${theme.fg("dim", "\xB7")} ${stats}` : ""}`,
2572
2612
  ...details,
2573
- ...materializedWidgetChildLines(job, theme, width, expanded, frame, projectionFor)
2613
+ ...materializedWidgetChildLines(job, theme, width, expanded, frame, projectionFor, fullTask)
2574
2614
  ];
2575
2615
  items.push(item);
2576
2616
  if (compactWorkflow) compactCards.push({ item, job, projection, bodyLength: details.length });
@@ -4,7 +4,7 @@ import {
4
4
  getAgentDir,
5
5
  getProjectConfigDir,
6
6
  resolveRexLocalPlacement
7
- } from "./chunk-UX4SCV5N.js";
7
+ } from "./chunk-QGO6HXHG.js";
8
8
 
9
9
  // src/runs/shared/herdr-machine.ts
10
10
  import { spawnSync as spawnSync2 } from "node:child_process";
@@ -8,7 +8,7 @@ import {
8
8
  projectTimeoutRecovery,
9
9
  readAsyncRecoveryDescriptor,
10
10
  utf8Tail
11
- } from "./chunk-LTPH2DXH.js";
11
+ } from "./chunk-BGXEAYUM.js";
12
12
  import {
13
13
  MAX_ARGS_BYTES,
14
14
  MAX_ARGS_DEPTH,
@@ -21,10 +21,10 @@ import {
21
21
  resultFilePath,
22
22
  resultPayloadMatchesSessionRun,
23
23
  resultPayloadPathForSessionRun
24
- } from "./chunk-LGMILZNE.js";
24
+ } from "./chunk-GJGTMLPE.js";
25
25
  import {
26
26
  PROJECT_SUBAGENTS_RELATIVE_DIR
27
- } from "./chunk-PHZP3KHB.js";
27
+ } from "./chunk-GRJHIXYF.js";
28
28
  import {
29
29
  listBackgroundWorkWakeChannels,
30
30
  snapshotBackgroundWork
@@ -49,7 +49,7 @@ import {
49
49
  waitToolName,
50
50
  withSettingsFileLease,
51
51
  writePrivateAtomicJson
52
- } from "./chunk-UX4SCV5N.js";
52
+ } from "./chunk-QGO6HXHG.js";
53
53
  import {
54
54
  DIRS,
55
55
  INTERCOM_DETACH_REQUEST_EVENT,
@@ -11,7 +11,7 @@ import {
11
11
  readStatus,
12
12
  writeAtomicJson,
13
13
  writePrivateAtomicJson
14
- } from "./chunk-UX4SCV5N.js";
14
+ } from "./chunk-QGO6HXHG.js";
15
15
  import {
16
16
  ASYNC_DIR,
17
17
  INTERCOM_DETACH_REQUEST_EVENT,
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  requestAsyncStop
3
- } from "./chunk-7MAE3DJV.js";
3
+ } from "./chunk-5H4BICQZ.js";
4
4
  import "./chunk-NIXWDZZV.js";
5
- import "./chunk-UX4SCV5N.js";
5
+ import "./chunk-QGO6HXHG.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-DV2NCNPR.js")).default : process.env.PI_SUBAGENT_CHILD === "1" ? void 0 : (await import("./chunk-3UZ5FVVJ.js")).default;
20
+ var registerExtension = process.env[HERDR_PI_MODE_ENV] === "1" ? (await import("./chunk-QM3JGE4W.js")).default : process.env.PI_SUBAGENT_CHILD === "1" ? void 0 : (await import("./chunk-O3YH7XIY.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-KDMFBYFM.js";
3
+ } from "./chunk-77ASNIEM.js";
4
4
  import "./chunk-7F6RKT6W.js";
5
- import "./chunk-UX4SCV5N.js";
5
+ import "./chunk-QGO6HXHG.js";
6
6
  import "./chunk-JEZOSEWG.js";
7
7
  import "./chunk-YFCK7H2S.js";
8
8
  import "./chunk-QXASAHIA.js";
@@ -2,22 +2,22 @@ import {
2
2
  buildEffectiveSystemPrompt,
3
3
  canPreferForkFromSnapshot,
4
4
  resolveSubagentLaunchContext
5
- } from "./chunk-RQAUNAWG.js";
6
- import "./chunk-QO75KJBT.js";
5
+ } from "./chunk-A637IMAO.js";
6
+ import "./chunk-LGINOOY5.js";
7
7
  import {
8
8
  loadConfig
9
- } from "./chunk-RV5OGHLO.js";
9
+ } from "./chunk-6VD7BGIC.js";
10
10
  import {
11
11
  nestedResultsPath,
12
12
  processTerminalCandidatePath,
13
13
  processTerminalPath,
14
14
  resultFilePath
15
- } from "./chunk-LGMILZNE.js";
15
+ } from "./chunk-GJGTMLPE.js";
16
16
  import {
17
17
  applyIntercomBridgeToAgent,
18
18
  resolveIntercomBridge,
19
19
  validateIntercomBridgeConfig
20
- } from "./chunk-KDMFBYFM.js";
20
+ } from "./chunk-77ASNIEM.js";
21
21
  import {
22
22
  AGENT_DEFINITION_PROJECTION_VERSION,
23
23
  resolveLaunchBinding,
@@ -26,7 +26,7 @@ import {
26
26
  import {
27
27
  applyThinkingSuffix,
28
28
  resolvePiLaunchToolPlan
29
- } from "./chunk-KEY3UQMQ.js";
29
+ } from "./chunk-374MZFF4.js";
30
30
  import {
31
31
  assertRequiredChildExtensionsAdmitted,
32
32
  resolveRequiredChildExtensions
@@ -34,7 +34,7 @@ import {
34
34
  import {
35
35
  getArtifactPaths,
36
36
  getArtifactsDir
37
- } from "./chunk-PHZP3KHB.js";
37
+ } from "./chunk-GRJHIXYF.js";
38
38
  import {
39
39
  assertClaudeCodeModelScope,
40
40
  assertThinkingWithinCeiling,
@@ -61,7 +61,7 @@ import {
61
61
  resolveSkillsWithFallback,
62
62
  resolveStepBehavior,
63
63
  unknownAgentDiagnosticContext
64
- } from "./chunk-UX4SCV5N.js";
64
+ } from "./chunk-QGO6HXHG.js";
65
65
  import {
66
66
  DIRS,
67
67
  SUBAGENT_LIFECYCLE_ARTIFACT_VERSION,
@@ -8,10 +8,10 @@ import {
8
8
  openProjectPane,
9
9
  projectPaneBindingPath,
10
10
  readProjectPaneBinding
11
- } from "./chunk-PVIVCDG2.js";
11
+ } from "./chunk-PYOAIN3V.js";
12
12
  import "./chunk-7J4ZXMY7.js";
13
- import "./chunk-PHZP3KHB.js";
14
- import "./chunk-UX4SCV5N.js";
13
+ import "./chunk-GRJHIXYF.js";
14
+ import "./chunk-QGO6HXHG.js";
15
15
  import "./chunk-JEZOSEWG.js";
16
16
  import "./chunk-YFCK7H2S.js";
17
17
  import "./chunk-QXASAHIA.js";
package/docs/agents.md CHANGED
@@ -194,6 +194,12 @@ node --experimental-strip-types --import ./test/support/register-loader.mjs \
194
194
 
195
195
  The read-only smoke must report `writeCanaryExists: false`. The writer smoke must report `writeCanaryMatches: true`. Both reports record `workspaceTrust: "operator-managed-saved"`, confirm that the external prompt root was added, and include startup duration and terminal proof without raw protocol output, prompts, or credentials. A trust-required error remains terminal; the harness does not retry with a trust, force, or yolo flag.
196
196
 
197
+ #### Safety record and wrapper commands
198
+
199
+ Each code-owned adapter run records a `safety` block in its runner status, in `subagent({ action: "status" })`, and in its workflow receipt entry. The block is the adapter's profile: the access its own argv asks the CLI for. Nothing in it is measured from the launched process, and status labels it `Safety (adapter profile, not measured)`.
200
+
201
+ The record carries `safetySource: { "measured": false, "command": "..." }` beside it. `command` is the launch command as configured; a run on a Herdr saved machine records none, because the remote pane runs the adapter's own binary. When `runner.command` is a wrapper script that changes argv before it starts the CLI, the wrapper can grant more or less than the profile shows, so read the wrapper to know the real grant. Receipts written before `safetySource` existed are read as profile values.
202
+
197
203
  #### Native oracle compared with external advisors
198
204
 
199
205
  Native `oracle` runs inside Pi and can use its configured read tools. The Claude profiles send the assembled prompt to the local Claude Code CLI through stdin. An external-job agent sends the assembled prompt to its registered provider. Provider options and a prompt digest are persisted in Pi run state. The prompt text is delivered through the local host bridge to the provider and is not stored in the public result payload. Do not place secrets in advisory prompts unless the target provider is approved to receive them.
@@ -108,7 +108,7 @@ The choice is made at session start or tree navigation, and only for a session w
108
108
 
109
109
  Controls the parent-facing `subagent` tool description registered at startup. The default registers the short execution/safety description, which states the delegation authorization rule, plus a one-line `promptSnippet`. Explicit `"compact"` uses the same description without the snippet; `"full"` adds workflow and management detail, also without the snippet. All modes retain the same flat parameter schema. Extended examples and recipes are available on demand through `action:"guide"` and the bundled pi-subagents skill; full mode is not an exhaustive manual. Count the default snippet as well as the tool definition when comparing prompt footprints.
110
110
 
111
- `custom` reads `subagent-tool-description.md` from the project config directory, then from `~/.pi/agent/subagent-tool-description.md`. Missing, empty, unreadable, or oversized custom files fall back to the full description. Custom templates may use `{{fullDescription}}`, `{{compactDescription}}`, `{{safetyGuidance}}`, `{{agentDir}}`, and `{{projectConfigDir}}`; the safety guidance is always present so custom prose cannot remove the runtime guardrails. Restart Pi after changing the mode or custom file. The change applies to new sessions; a resumed session keeps the tool definition and prompt text it already declared, so its prompt cache stays valid. To apply it to resumed sessions too, set [`pinToolDeclarations`](#pintooldeclarations) to `false`.
111
+ `custom` reads `subagent-tool-description.md` from the project config directory, then from `~/.pi/agent/subagent-tool-description.md`. Missing, empty, unreadable, or oversized custom files fall back to the full description. Custom templates may use `{{fullDescription}}`, `{{compactDescription}}`, `{{safetyGuidance}}`, `{{agentDir}}`, and `{{projectConfigDir}}`; the two description placeholders leave out features turned off with [`disabledFeatures`](#disabledfeatures), and the safety guidance is always present so custom prose cannot remove the runtime guardrails. Restart Pi after changing the mode or custom file. The change applies to new sessions; a resumed session keeps the tool definition and prompt text it already declared, so its prompt cache stays valid. To apply it to resumed sessions too, set [`pinToolDeclarations`](#pintooldeclarations) to `false`.
112
112
 
113
113
  ## `pinToolDeclarations`
114
114
 
@@ -124,7 +124,7 @@ Pi records each tool definition and prompt section a session declares, and decla
124
124
  { "disabledFeatures": ["watchdog", "panes", "preflight", "lane-metadata", "gates"] }
125
125
  ```
126
126
 
127
- Removes feature groups you do not use from the `subagent` tool. Each listed feature loses its top-level parameters from the model-facing schema and its `options` keys are rejected, and any request that still uses one of its parameters or actions fails with an error naming this setting. The check covers the parent tool, fanout-child tools, RPC, slash commands, prompt templates, scheduled launches, delegated launches, and workflow `runs.run`/`runs.all`/`runs.lanes` children, which are rejected before they launch. The built-in tool descriptions, the unknown-action list, the fanout-child tool description, and RPC `ping` no longer mention disabled features. Every `{ action: "guide" }` response starts with a notice: a topic lists what is disabled, and a section points to the `tool-reference` topic for that list. With `workflow-scripts` disabled, the notice also says to use the top-level `tasks` or `chain` fields instead. Custom tool descriptions are not changed. Nothing is disabled by default, and the default schema and description are unchanged. An unknown or duplicate feature name fails config loading rather than silently re-enabling every feature.
127
+ Removes feature groups you do not use from the `subagent` tool. Each listed feature loses its top-level parameters from the model-facing schema and its `options` keys are rejected, and any request that still uses one of its parameters or actions fails with an error naming this setting. The check covers the parent tool, fanout-child tools, RPC, slash commands, prompt templates, scheduled launches, delegated launches, and workflow `runs.run`/`runs.all`/`runs.lanes` children, which are rejected before they launch. The built-in tool descriptions, the unknown-action list, the fanout-child tool description, and RPC `ping` no longer mention disabled features. Every `{ action: "guide" }` response starts with a notice: a topic lists what is disabled, and a section points to the `tool-reference` topic for that list. With `workflow-scripts` disabled, the notice also says to use the top-level `tasks` or `chain` fields instead. Custom tool descriptions keep their own text; only their `{{compactDescription}}` and `{{fullDescription}}` placeholders leave out disabled features. Nothing is disabled by default, and the default schema and description are unchanged. An unknown or duplicate feature name fails config loading rather than silently re-enabling every feature.
128
128
 
129
129
  | Feature | Parameters removed | Actions rejected |
130
130
  |---|---|---|
@@ -539,6 +539,8 @@ async: true
539
539
 
540
540
  Supported: status artifacts, stdout/stderr logs, timeout, and stop. Full stdout and stderr are written to log files, while the in-memory final stdout response and stderr error are limited to their last 64 KiB.
541
541
 
542
+ A code-owned adapter (`adapter: claude-code-writer` and the others in [agents.md](agents.md#claude-code-profiles)) records a `safety` block and a `safetySource: { measured: false, command }` beside it. The block is the adapter's profile, not a measurement, so a wrapper `command` that changes the CLI's argv can grant something else; see [Safety record and wrapper commands](agents.md#safety-record-and-wrapper-commands).
543
+
542
544
  Intentionally unsupported: native Pi child options such as model override, structured output, acceptance/agent contract, tool budgets, fast mode, fork context, skills, or native Pi tools unless the runner explicitly implements them. Foreground/clarify, steer/resume/interrupt-as-pause, and nested subagents are also unsupported.
543
545
 
544
546
  ## Session sharing
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "pi-subagents",
4
- "version": "0.85.0",
4
+ "version": "0.86.0",
5
5
  "description": "Pi extension for single-agent delegation and scripted multi-agent workflows",
6
6
  "author": "Nico Bailon",
7
7
  "license": "MIT",
@@ -56,7 +56,16 @@ function applyRecordedSelection(pi, ctx, mode, replyOwed) {
56
56
  if (!available.some((tool) => tool.name === LOADER_NAME))
57
57
  return true;
58
58
  // SAFETY: The running Pi session manager exposes buildSessionContext, but its read-only extension type omits it.
59
- const messages = ctx.sessionManager.buildSessionContext().messages;
59
+ let messages = ctx.sessionManager.buildSessionContext().messages;
60
+ // A compaction checkpoint (the system message before the summary) folds the branch's earlier system messages into
61
+ // one declaration, which hides an extension unload before the compaction. Replay those messages instead, as Pi
62
+ // restores the session's tools from them.
63
+ if (messages[0]?.role === "system" && messages[1]?.role === "compactionSummary") {
64
+ const branch = ctx.sessionManager.getBranch();
65
+ const history = branch.slice(0, branch.findLastIndex((entry) => entry.type === "compaction"))
66
+ .flatMap((entry) => entry.type === "message" && entry.message.role === "system" ? [entry.message] : []);
67
+ messages = [...history, ...messages.slice(1)];
68
+ }
60
69
  // A compaction without a checkpoint leaves its summary first, with no system message before it: the
61
70
  // declarations from before it are lost, even when no tool selection was recorded after it.
62
71
  const lost = messages.find((message) => message.role === "system" || message.role === "compactionSummary")?.role === "compactionSummary";
@@ -9,7 +9,7 @@ export interface ToolDescriptionOptions {
9
9
  cwd?: string;
10
10
  agentDir?: string;
11
11
  warn?: (message: string) => void;
12
- /** Removes lines for disabled features from the default and full descriptions; custom descriptions are unchanged apart from the appended safety guidance. */
12
+ /** Removes lines for disabled features from the default and full descriptions, including the ones custom templates insert with placeholders. */
13
13
  disabledFeatures?: DisabledFeatureSurface;
14
14
  }
15
15
  export declare function buildSubagentToolPromptMetadata(config?: Pick<ExtensionConfig, "toolDescriptionMode">, disabledFeatures?: DisabledFeatureSurface): {
@@ -82,15 +82,15 @@ function customDescriptionPaths(options) {
82
82
  path.join(agentDir, CUSTOM_TOOL_DESCRIPTION_FILE),
83
83
  ];
84
84
  }
85
- function renderCustomTemplate(template, options) {
85
+ function renderCustomTemplate(template, on, options) {
86
86
  const cwd = options?.cwd ?? process.cwd();
87
87
  const agentDir = options?.agentDir ?? getAgentDir();
88
88
  const projectConfigDir = getProjectConfigDir(cwd);
89
89
  const variables = {
90
- fullDescription: () => FULL_SUBAGENT_TOOL_DESCRIPTION,
91
- full: () => FULL_SUBAGENT_TOOL_DESCRIPTION,
92
- compactDescription: () => COMPACT_SUBAGENT_TOOL_DESCRIPTION,
93
- compact: () => COMPACT_SUBAGENT_TOOL_DESCRIPTION,
90
+ fullDescription: () => fullDescription(on),
91
+ full: () => fullDescription(on),
92
+ compactDescription: () => essentials(on),
93
+ compact: () => essentials(on),
94
94
  safetyGuidance: () => SUBAGENT_SAFETY_GUIDANCE,
95
95
  safety: () => SUBAGENT_SAFETY_GUIDANCE,
96
96
  agentDir: () => agentDir,
@@ -104,7 +104,7 @@ function renderCustomTemplate(template, options) {
104
104
  return raw;
105
105
  });
106
106
  }
107
- function loadCustomToolDescription(options) {
107
+ function loadCustomToolDescription(on, options) {
108
108
  for (const filePath of customDescriptionPaths(options)) {
109
109
  let stat;
110
110
  try {
@@ -130,7 +130,7 @@ function loadCustomToolDescription(options) {
130
130
  warn(options, `Ignoring empty custom tool description '${filePath}'.`);
131
131
  continue;
132
132
  }
133
- const rendered = renderCustomTemplate(template, options).trim();
133
+ const rendered = renderCustomTemplate(template, on, options).trim();
134
134
  if (!rendered) {
135
135
  warn(options, `Ignoring custom tool description '${filePath}' because it rendered empty.`);
136
136
  continue;
@@ -166,7 +166,7 @@ function describeSubagentTool(config, options) {
166
166
  if (mode === "compact")
167
167
  return essentials(on);
168
168
  if (mode === "custom") {
169
- const custom = loadCustomToolDescription(options);
169
+ const custom = loadCustomToolDescription(on, options);
170
170
  if (custom)
171
171
  return withMandatorySafetyGuidance(custom);
172
172
  warn(options, `${CUSTOM_TOOL_DESCRIPTION_FILE} was not found or valid for toolDescriptionMode "custom"; using full description.`);
@@ -674,14 +674,15 @@ export function inspectSubagentStatus(params, deps = {}) {
674
674
  lines.push(` Runner: external-cli (${runner.command}${runner.args.length ? ` ${runner.args.join(" ")}` : ""})`);
675
675
  lines.push(` Adapter: ${runner.adapter.id} v${runner.adapter.version} (${runner.adapter.executionMode})`);
676
676
  if (runner.safety) {
677
+ const safetyLabel = " Safety (adapter profile, not measured):";
677
678
  if ("approvalPolicy" in runner.safety)
678
- lines.push(` Safety: ${"access" in runner.safety ? `access=${runner.safety.access}, ` : ""}sandbox=${runner.safety.sandbox}, approval=${runner.safety.approvalPolicy}, ephemeral=${runner.safety.ephemeral}`);
679
+ lines.push(`${safetyLabel} ${"access" in runner.safety ? `access=${runner.safety.access}, ` : ""}sandbox=${runner.safety.sandbox}, approval=${runner.safety.approvalPolicy}, ephemeral=${runner.safety.ephemeral}`);
679
680
  else if ("mode" in runner.safety)
680
- lines.push(` Safety: access=${runner.safety.access}, auth=${runner.safety.authentication}, mode=${runner.safety.mode}, sandbox=${runner.safety.sandbox}, workspaceTrust=${runner.safety.workspaceTrust}, sessionReuse=${runner.safety.sessionReuse}`);
681
+ lines.push(`${safetyLabel} access=${runner.safety.access}, auth=${runner.safety.authentication}, mode=${runner.safety.mode}, sandbox=${runner.safety.sandbox}, workspaceTrust=${runner.safety.workspaceTrust}, sessionReuse=${runner.safety.sessionReuse}`);
681
682
  else if ("authentication" in runner.safety)
682
- lines.push(` Safety: access=${runner.safety.access}, auth=${runner.safety.authentication}, permission=${runner.safety.permissionMode}, tools=${runner.safety.tools}, mcp=${runner.safety.mcp}, settings=${runner.safety.settingSources}, settingsTrust=${runner.safety.userSettingsTrust}, persistence=${runner.safety.sessionPersistence}`);
683
+ lines.push(`${safetyLabel} access=${runner.safety.access}, auth=${runner.safety.authentication}, permission=${runner.safety.permissionMode}, tools=${runner.safety.tools}, mcp=${runner.safety.mcp}, settings=${runner.safety.settingSources}, settingsTrust=${runner.safety.userSettingsTrust}, persistence=${runner.safety.sessionPersistence}`);
683
684
  else
684
- lines.push(` Safety: access=read-only, permission=${runner.safety.permissionMode}, tools=${runner.safety.tools}, mcp=${runner.safety.mcp}, settings=${runner.safety.settingSources}, persistence=${runner.safety.sessionPersistence}`);
685
+ lines.push(`${safetyLabel} access=read-only, permission=${runner.safety.permissionMode}, tools=${runner.safety.tools}, mcp=${runner.safety.mcp}, settings=${runner.safety.settingSources}, persistence=${runner.safety.sessionPersistence}`);
685
686
  }
686
687
  lines.push(` Capabilities: stop=${runner.capabilities.stop}, steer=false, resume=false, structuredOutput=false, toolEvents=false, supervisor=unsupported, forkContext=false, extensionBindings=false`);
687
688
  lines.push(` Unsupported steer: ${runner.unsupportedReasons.steer}`);
@@ -1290,9 +1290,9 @@ async function runSingleStep(step, ctx) {
1290
1290
  ctx.orcaProgressTab?.section({ agent: step.agent, index: ctx.flatIndex, count: ctx.flatStepCount });
1291
1291
  return runSingleStepInner(step, ctx);
1292
1292
  }
1293
- function externalRunnerStatus(runner) {
1293
+ function externalRunnerStatus(runner, machine) {
1294
1294
  if (runner?.type === "external-cli") {
1295
- return resolveExternalCliRunnerStatus(runner);
1295
+ return resolveExternalCliRunnerStatus(machine?.provider === "herdr" ? { ...runner, machine } : runner);
1296
1296
  }
1297
1297
  if (runner?.type === "external-job") {
1298
1298
  return {
@@ -1570,7 +1570,7 @@ export async function runSubagent(config, childSessions) {
1570
1570
  agent: task.agent,
1571
1571
  ...(task.lane ? { lane: task.lane } : config.lane ? { lane: config.lane } : {}),
1572
1572
  ...(taskSessionName ? { sessionName: taskSessionName } : {}),
1573
- ...(externalRunnerStatus(task.runner) ? { runner: externalRunnerStatus(task.runner) } : {}),
1573
+ ...(externalRunnerStatus(task.runner, task.machine) ? { runner: externalRunnerStatus(task.runner, task.machine) } : {}),
1574
1574
  ...(statusStepDescription(task.task) ? { description: statusStepDescription(task.task) } : {}),
1575
1575
  ...(task.context ? { context: task.context } : {}),
1576
1576
  phase: task.phase,
@@ -1601,7 +1601,7 @@ export async function runSubagent(config, childSessions) {
1601
1601
  parallelGroups.push({ start: flatStepCount, count: 1, stepIndex });
1602
1602
  initialStatusSteps.push(omitUndefinedProperties({
1603
1603
  agent: `expand:${step.parallel.agent}`,
1604
- ...(externalRunnerStatus(step.parallel.runner) ? { runner: externalRunnerStatus(step.parallel.runner) } : {}),
1604
+ ...(externalRunnerStatus(step.parallel.runner, step.parallel.machine) ? { runner: externalRunnerStatus(step.parallel.runner, step.parallel.machine) } : {}),
1605
1605
  ...(step.parallel.context ? { context: step.parallel.context } : {}),
1606
1606
  phase: step.phase ?? step.parallel.phase,
1607
1607
  label: step.label ?? step.parallel.label ?? `Dynamic fanout (${step.collect.as})`,
@@ -1626,7 +1626,7 @@ export async function runSubagent(config, childSessions) {
1626
1626
  agent: step.agent,
1627
1627
  ...(step.lane ? { lane: step.lane } : config.lane ? { lane: config.lane } : {}),
1628
1628
  ...(stepSessionName ? { sessionName: stepSessionName } : {}),
1629
- ...(externalRunnerStatus(step.runner) ? { runner: externalRunnerStatus(step.runner) } : {}),
1629
+ ...(externalRunnerStatus(step.runner, step.machine) ? { runner: externalRunnerStatus(step.runner, step.machine) } : {}),
1630
1630
  ...(statusStepDescription(step.task) ? { description: statusStepDescription(step.task) } : {}),
1631
1631
  ...(step.context ? { context: step.context } : {}),
1632
1632
  phase: step.phase,
@@ -3460,7 +3460,7 @@ export async function runSubagent(config, childSessions) {
3460
3460
  return omitUndefinedProperties({
3461
3461
  agent: task.agent,
3462
3462
  ...(task.sessionName ? { sessionName: task.sessionName } : {}),
3463
- ...(externalRunnerStatus(task.runner) ? { runner: externalRunnerStatus(task.runner) } : {}),
3463
+ ...(externalRunnerStatus(task.runner, task.machine) ? { runner: externalRunnerStatus(task.runner, task.machine) } : {}),
3464
3464
  ...(statusStepDescription(task.task) ? { description: statusStepDescription(task.task) } : {}),
3465
3465
  ...(task.context ? { context: task.context } : {}),
3466
3466
  ...(task.phase ?? step.phase ? { phase: task.phase ?? step.phase } : {}),