@xzzpig/pi-subagents 0.18.0 → 0.19.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 (95) hide show
  1. package/CHANGELOG.md +69 -0
  2. package/README.md +1 -1
  3. package/docs/agents.md +18 -12
  4. package/docs/configuration.md +66 -9
  5. package/docs/extension-api.md +5 -4
  6. package/docs/missions.md +13 -13
  7. package/docs/models.md +2 -2
  8. package/docs/observability.md +2 -2
  9. package/docs/standalone-background.md +1 -1
  10. package/docs/tool-reference.md +63 -86
  11. package/docs/workflows.md +170 -172
  12. package/node_modules/@xzzpig/pi-components/package.json +4 -4
  13. package/package.json +6 -6
  14. package/prompts/review-loop.md +1 -1
  15. package/skills/council-mode/SKILL.md +1 -1
  16. package/skills/pi-subagents/SKILL.md +12 -5
  17. package/skills/pi-subagents/references/constraints-and-recipes.md +3 -3
  18. package/skills/pi-subagents/references/execution-controls.md +68 -67
  19. package/skills/pi-subagents/references/management-authoring-rpc.md +2 -2
  20. package/skills/pi-subagents/references/multi-lane-orchestration.md +1 -1
  21. package/skills/pi-subagents/references/prompting-and-roles.md +45 -48
  22. package/src/agents/advertised-agent-prompt.ts +21 -41
  23. package/src/agents/agent-management.ts +2 -2
  24. package/src/agents/agents.ts +7 -0
  25. package/src/api/preflight.ts +67 -62
  26. package/src/extension/config.ts +12 -4
  27. package/src/extension/control-notices.ts +3 -0
  28. package/src/extension/doctor.ts +1 -0
  29. package/src/extension/fanout-child.ts +12 -3
  30. package/src/extension/herdr-pi-bridge.ts +2 -0
  31. package/src/extension/index.ts +68 -159
  32. package/src/extension/public-execution.ts +69 -35
  33. package/src/extension/reply-workflow-script.ts +58 -0
  34. package/src/extension/rpc.ts +29 -10
  35. package/src/extension/schemas.ts +36 -133
  36. package/src/extension/tool-activation.ts +57 -108
  37. package/src/extension/tool-description.ts +62 -27
  38. package/src/extension/upgrade-notice.ts +40 -0
  39. package/src/integrations/herdr-status.ts +19 -3
  40. package/src/intercom/native-supervisor-channel.ts +4 -1
  41. package/src/runs/background/async-execution.ts +58 -53
  42. package/src/runs/background/async-job-tracker.ts +63 -22
  43. package/src/runs/background/async-retention.ts +46 -16
  44. package/src/runs/background/await-async-run.ts +76 -0
  45. package/src/runs/background/chain-root-attachment.ts +4 -4
  46. package/src/runs/background/control-channel.ts +18 -2
  47. package/src/runs/background/notify.ts +5 -0
  48. package/src/runs/background/run-child-session.ts +4 -1
  49. package/src/runs/background/run-status.ts +6 -0
  50. package/src/runs/background/runner-aliases.ts +30 -2
  51. package/src/runs/background/runner-child-launch.ts +3 -0
  52. package/src/runs/background/scheduled-runs.ts +5 -5
  53. package/src/runs/background/subagent-runner.ts +15 -1
  54. package/src/runs/foreground/async-stop-action.ts +17 -3
  55. package/src/runs/foreground/execution.ts +130 -125
  56. package/src/runs/foreground/subagent-executor.ts +487 -288
  57. package/src/runs/shared/async-status-projection.ts +5 -0
  58. package/src/runs/shared/child-launch.ts +15 -2
  59. package/src/runs/shared/child-session.ts +92 -6
  60. package/src/runs/shared/child-tool-plan.ts +15 -3
  61. package/src/runs/shared/dynamic-fanout.ts +1 -1
  62. package/src/runs/shared/mcp-config-sources.ts +2 -1
  63. package/src/runs/shared/mcp-direct-tool-allowlist.ts +103 -11
  64. package/src/runs/shared/model-resolution.ts +29 -9
  65. package/src/runs/shared/model-scope.ts +28 -9
  66. package/src/runs/shared/nested-events.ts +55 -55
  67. package/src/runs/shared/parallel-utils.ts +2 -0
  68. package/src/runs/shared/pi-spawn.ts +7 -95
  69. package/src/runs/shared/subagent-prompt-runtime.ts +2 -0
  70. package/src/runs/shared/worktree.ts +1 -1
  71. package/src/shared/disabled-features.ts +123 -0
  72. package/src/shared/extension-context.ts +13 -0
  73. package/src/shared/model-info.ts +9 -0
  74. package/src/shared/settings.ts +1 -1
  75. package/src/shared/types.ts +21 -0
  76. package/src/slash/prompt-template-bridge.ts +2 -2
  77. package/src/slash/slash-commands.ts +10 -5
  78. package/src/slash/subagents-admin.ts +24 -24
  79. package/src/tui/fleet-status.ts +14 -6
  80. package/src/tui/fleet.ts +14 -2
  81. package/src/tui/render.ts +113 -52
  82. package/src/tui/running-tone.ts +28 -0
  83. package/src/watchdog/diff-tool.ts +23 -9
  84. package/src/watchdog/register-child.ts +3 -3
  85. package/src/watchdog/register-main.ts +3 -3
  86. package/src/watchdog/review.ts +2 -2
  87. package/src/watchdog/turn-delta.ts +1 -1
  88. package/src/workflows/chat-progress.ts +2 -2
  89. package/src/workflows/scripted-workflow.ts +117 -37
  90. package/src/workflows/structured-workflow-scripts.ts +177 -0
  91. package/src/workflows/workflow-checklist.ts +6 -0
  92. package/src/workflows/workflow-receipt.ts +8 -2
  93. package/src/workflows/workflow-resources.ts +37 -12
  94. package/src/workflows/workflow-reuse.ts +120 -0
  95. package/src/workflows/workflow-revival.ts +123 -0
@@ -12,6 +12,7 @@ import type { ModelScopeRule } from "../runs/shared/model-scope.ts";
12
12
  import type { ResolvedSubagentCapabilityCeiling, SubagentCapabilityAudit } from "../runs/shared/capability-ceiling.ts";
13
13
  import type { AuthorityPolicyConfig } from "../policy/authority.ts";
14
14
  import type { ThinkingLevel } from "./model-info.ts";
15
+ import type { SubagentFeature } from "./disabled-features.ts";
15
16
  import type { GlobalMissionIndexRecord, MissionRecord, MissionStoreConfig } from "../missions/types.ts";
16
17
  import type { ExtensionBindings } from "../runs/shared/extension-bindings.ts";
17
18
  import type { WorkflowChildPermitContext } from "./workflow-child-permit.ts";
@@ -131,6 +132,8 @@ export interface WorkflowPreflight {
131
132
 
132
133
  export type WorkflowReceiptState = "complete" | "failed" | "paused" | "stopped";
133
134
 
135
+ export type WorkflowScriptFailureKind = "validation" | "script" | "child" | "return-serialization" | "timeout" | "detached-child" | "runtime";
136
+
134
137
  export type WorkflowTerminalResolution = "settled-awaiting-resume" | "failed-child" | "interrupted-child";
135
138
 
136
139
  export interface WorkflowTerminalOutcome {
@@ -1525,8 +1528,15 @@ export interface Details {
1525
1528
  mission?: MissionRecord;
1526
1529
  workflow?: {
1527
1530
  value?: unknown;
1531
+ failureKind?: WorkflowScriptFailureKind;
1528
1532
  args?: Record<string, unknown>;
1529
1533
  argsDigest?: string;
1534
+ /** SHA-256 of the workflow script source (async workflows). */
1535
+ scriptDigest?: string;
1536
+ /** Structured stop cause; set only when the owning extension runtime was replaced. */
1537
+ stopCause?: "runtime-replaced";
1538
+ /** Runtime-replaced workflow run whose finished children this run reused. */
1539
+ reusedFrom?: string;
1530
1540
  resource?: WorkflowResourceProvenance;
1531
1541
  preflightWarnings?: string[];
1532
1542
  trace: Array<{
@@ -1542,6 +1552,8 @@ export interface Details {
1542
1552
  generatedLaneKey?: string;
1543
1553
  warning?: string;
1544
1554
  error?: string;
1555
+ /** Came from a previous runtime-replaced run of the same script and args; this run launched nothing. */
1556
+ reused?: boolean;
1545
1557
  }>;
1546
1558
  emits: unknown[];
1547
1559
  console: Array<{ level: "log" | "info" | "warn" | "error"; text: string }>;
@@ -1984,6 +1996,8 @@ export interface AsyncStatus {
1984
1996
  outputName?: string;
1985
1997
  structured?: boolean;
1986
1998
  status: "pending" | "running" | "complete" | "completed" | "failed" | "partial" | "paused" | "stopped" | "rejected";
1999
+ /** Workflow child result reused from a previous runtime-replaced run; the child was not re-run. */
2000
+ reused?: boolean;
1987
2001
  stopRequested?: boolean;
1988
2002
  stopRequestedAt?: number;
1989
2003
  children?: NestedRunSummary[];
@@ -2482,6 +2496,8 @@ export interface RunSyncOptions {
2482
2496
  /** Original cwd input retained for launch diagnostics. */
2483
2497
  requestedCwd?: string;
2484
2498
  signal?: AbortSignal;
2499
+ /** Report a child ended by `signal` as stopped; set for workflow children, whose signal is the workflow's. */
2500
+ abortedAsStopped?: boolean;
2485
2501
  interruptSignal?: AbortSignal;
2486
2502
  timeoutMs?: number;
2487
2503
  deadlineAt?: number;
@@ -2609,6 +2625,7 @@ export interface ProactiveSkillSubagentsConfig {
2609
2625
  }
2610
2626
 
2611
2627
  export type ToolDescriptionMode = "full" | "compact" | "custom";
2628
+ export type ToolActivationMode = "auto" | "dynamic" | "eager";
2612
2629
  export type InlineToolDisplay = "rich" | "summary";
2613
2630
 
2614
2631
  export interface ScheduledRunsConfig {
@@ -2686,6 +2703,10 @@ export interface ExtensionConfig {
2686
2703
  modelResponseAliases?: Record<string, string[]>;
2687
2704
  /** Tool description variant registered for the parent-facing subagent tool. Defaults to split metadata. */
2688
2705
  toolDescriptionMode?: ToolDescriptionMode;
2706
+ /** How a new parent session offers the subagent tool. Defaults to auto. */
2707
+ toolActivation?: ToolActivationMode;
2708
+ /** Opt-in feature groups removed from the subagent tool schema and rejected at every execution boundary. */
2709
+ disabledFeatures?: SubagentFeature[];
2689
2710
  /** Inline chat rendering for the subagent tool. Defaults to rich. */
2690
2711
  inlineToolDisplay?: InlineToolDisplay;
2691
2712
  /** Density controls for the main chat subagent call/result renderer. */
@@ -234,7 +234,7 @@ export function registerPromptTemplateDelegationBridge<Ctx extends { cwd?: strin
234
234
  requestId: legacy.requestId,
235
235
  messages: [],
236
236
  isError: true,
237
- errorText: "Legacy prompt-template tasks/worktree orchestration was removed; use workflowScript.",
237
+ errorText: "Legacy prompt-template tasks/worktree orchestration was removed; use a workflow script.",
238
238
  });
239
239
  return;
240
240
  }
@@ -245,7 +245,7 @@ export function registerPromptTemplateDelegationBridge<Ctx extends { cwd?: strin
245
245
  ...legacyRequest,
246
246
  messages: [],
247
247
  isError: true,
248
- errorText: "Legacy prompt-template direct delegation was removed; use workflowScript through the subagent tool or structured delegation.",
248
+ errorText: "Legacy prompt-template direct delegation was removed; use a workflow script through the subagent tool or structured delegation.",
249
249
  } satisfies PromptTemplateDelegationResponse);
250
250
  return;
251
251
  }
@@ -592,14 +592,19 @@ async function runSlashSubagent(
592
592
  }
593
593
  }
594
594
 
595
- function slashRunWorkflowScript(key: string, child: Record<string, unknown>): string {
595
+ function slashRunWorkflowScript(key: string, child: SubagentParamsLike): string {
596
596
  return `return runs.run(${JSON.stringify(key)}, ${JSON.stringify(child)})`;
597
597
  }
598
598
 
599
599
  export function registerSlashCommands(
600
600
  pi: ExtensionAPI,
601
601
  state: SubagentState,
602
- options: { fleetKeybindings?: FleetKeybindingsConfig; foregroundDetachShortcut?: string } = {},
602
+ options: {
603
+ fleetKeybindings?: FleetKeybindingsConfig;
604
+ foregroundDetachShortcut?: string;
605
+ /** disabledFeatures "workflow-scripts": /run launches its one child directly instead of through a script. */
606
+ workflowScriptsDisabled?: boolean;
607
+ } = {},
603
608
  ): { dispose: () => void } {
604
609
  let fleetOpen = false;
605
610
  let disposed = false;
@@ -640,7 +645,7 @@ export function registerSlashCommands(
640
645
  });
641
646
 
642
647
  pi.registerCommand("run", {
643
- description: "Run one subagent through workflowScript: /run agent[output=file] [task] [--bg] [--fork]",
648
+ description: "Run one subagent through a workflow script: /run agent[output=file] [task] [--bg] [--fork]",
644
649
  getArgumentCompletions: makeAgentCompletions(pi, state),
645
650
  handler: async (args, ctx) => {
646
651
  const { args: cleanedArgs, bg, fork } = extractExecutionFlags(args);
@@ -667,13 +672,13 @@ export function registerSlashCommands(
667
672
  const existingReads = inline.reads.filter((read) => resolveExistingReadPaths([read], state.baseCwd).length > 0);
668
673
  if (existingReads.length > 0) finalTask = `[Read from: ${existingReads.join(", ")}]\n\n${finalTask}`;
669
674
  }
670
- const child: Record<string, unknown> = { agent: agentName, task: finalTask, agentScope: "both" };
675
+ const child: SubagentParamsLike = { agent: agentName, task: finalTask, agentScope: "both" };
671
676
  if (inline.output !== undefined) child.output = inline.output;
672
677
  if (inline.outputMode !== undefined) child.outputMode = inline.outputMode;
673
678
  if (inline.skill !== undefined) child.skill = inline.skill;
674
679
  if (inline.model) child.model = inline.model;
675
680
  if (fork) child.context = "fork";
676
- launchCommand(ctx, { workflowScript: slashRunWorkflowScript("run", child), async: bg ? true : false });
681
+ launchCommand(ctx, options.workflowScriptsDisabled ? { ...child, async: bg } : { workflowScript: slashRunWorkflowScript("run", child), async: bg });
677
682
  },
678
683
  });
679
684
 
@@ -19,7 +19,7 @@ let adminDialogEvents: UiSpanSilentEvents | undefined;
19
19
 
20
20
  /** Claims the next dialog span as silent (pi-notify protocol). */
21
21
  function markAdminDialogSilent(): void {
22
- emitUiSpanSilent(adminDialogEvents, "admin");
22
+ emitUiSpanSilent(adminDialogEvents, "admin");
23
23
  }
24
24
  import { editableAgentConfig, preservedAgentFrontmatterFields } from "../agents/agent-management.ts";
25
25
  import { findModelInfo, getSupportedThinkingLevels, toModelInfo } from "../shared/model-info.ts";
@@ -86,20 +86,20 @@ function modelFullId(model: ModelInfo): string {
86
86
  async function liveAvailableModels(ctx: ExtensionContext) {
87
87
  try {
88
88
  // Reload local configuration and cached catalogs without network discovery on picker open.
89
- // Host SDK versions differ on the refresh result shape: newer hosts return a result
90
- // object with per-provider errors and an abort flag, older hosts resolve void.
91
- const refresh = ctx.modelRegistry.refresh as ((options?: unknown) => Promise<unknown>) | undefined;
92
- const result = await refresh?.({ allowNetwork: false, signal: AbortSignal.timeout(5_000) });
93
- if (result && typeof result === "object") {
94
- const errors = (result as { errors?: Map<string, Error> }).errors;
95
- const aborted = (result as { aborted?: boolean }).aborted;
96
- const firstError = errors?.entries().next().value;
97
- if (firstError) {
98
- ctx.ui.notify(`Could not refresh ${firstError[0]}; using the currently loaded choices. ${firstError[1].message}`, "warning");
99
- } else if (aborted) {
100
- ctx.ui.notify("Model registry refresh timed out; using the currently loaded choices.", "warning");
89
+ // Host SDK versions differ on the refresh result shape: newer hosts return a result
90
+ // object with per-provider errors and an abort flag, older hosts resolve void.
91
+ const refresh = ctx.modelRegistry.refresh as ((options?: unknown) => Promise<unknown>) | undefined;
92
+ const result = await refresh?.({ allowNetwork: false, signal: AbortSignal.timeout(5_000) });
93
+ if (result && typeof result === "object") {
94
+ const errors = (result as { errors?: Map<string, Error> }).errors;
95
+ const aborted = (result as { aborted?: boolean }).aborted;
96
+ const firstError = errors?.entries().next().value;
97
+ if (firstError) {
98
+ ctx.ui.notify(`Could not refresh ${firstError[0]}; using the currently loaded choices. ${firstError[1].message}`, "warning");
99
+ } else if (aborted) {
100
+ ctx.ui.notify("Model registry refresh timed out; using the currently loaded choices.", "warning");
101
+ }
101
102
  }
102
- }
103
103
  } catch (error) {
104
104
  const message = error instanceof Error ? error.message : String(error);
105
105
  ctx.ui.notify(`Could not refresh the model registry; using the last loaded choices. ${message}`, "warning");
@@ -229,7 +229,7 @@ function metadataFor(agent: AgentConfig): string {
229
229
  }
230
230
 
231
231
  async function selectFromList(ctx: ExtensionContext, title: string, subtitle: string | undefined, items: SelectorItem[]): Promise<string | undefined> {
232
- markAdminDialogSilent();
232
+ markAdminDialogSilent();
233
233
  if (typeof ctx.ui.custom === "function") {
234
234
  const result = await ctx.ui.custom<SelectorResult>(
235
235
  (tui, theme, kb, done) => new SelectorComponent(tui, theme, kb, { title, subtitle, items, done }),
@@ -284,7 +284,7 @@ async function chooseOverrideScope(ctx: ExtensionContext, agent: AgentConfig): P
284
284
  return agent.source === "project" && agent.override.scope === "user" && d.projectSettingsPath ? "project" : agent.override.scope;
285
285
  }
286
286
  if (!d.projectSettingsPath || !ctx.hasUI) return "user";
287
- markAdminDialogSilent();
287
+ markAdminDialogSilent();
288
288
  const choice = await ctx.ui.select(`Save subagent override for ${agent.name}`, ["user", "project"]);
289
289
  return choice === "user" || choice === "project" ? choice : undefined;
290
290
  }
@@ -401,7 +401,7 @@ async function editSystemPrompt(ctx: ExtensionContext, agent: AgentConfig): Prom
401
401
  const readOnlyMessage = readOnlyAgentMessage(agent, "systemPrompt");
402
402
  if (readOnlyMessage) return readOnlyMessage;
403
403
  }
404
- markAdminDialogSilent();
404
+ markAdminDialogSilent();
405
405
  const edited = await ctx.ui.editor(`Edit '${agent.name}' system prompt`, agent.systemPrompt ?? "");
406
406
  if (edited === undefined) return null;
407
407
  const projectOwnsLowerScopeOverride = agent.source === "project" && agent.override?.scope === "user" && discoverAgentsAll(ctx.cwd).projectSettingsPath;
@@ -412,12 +412,12 @@ markAdminDialogSilent();
412
412
  }
413
413
 
414
414
  export async function openSubagentsAdmin(pi: ExtensionAPI, ctx: ExtensionContext, args = ""): Promise<void> {
415
- adminDialogEvents = pi.events;
416
- try {
417
- return await runAdminFlow(pi, ctx, args);
418
- } finally {
419
- adminDialogEvents = undefined;
420
- }
415
+ adminDialogEvents = pi.events;
416
+ try {
417
+ return await runAdminFlow(pi, ctx, args);
418
+ } finally {
419
+ adminDialogEvents = undefined;
420
+ }
421
421
  }
422
422
 
423
423
  async function runAdminFlow(pi: ExtensionAPI, ctx: ExtensionContext, args = ""): Promise<void> {
@@ -449,7 +449,7 @@ async function runAdminFlow(pi: ExtensionAPI, ctx: ExtensionContext, args = ""):
449
449
  else if (requestedAction === "prompt" || requestedAction === "system-prompt" || requestedAction === "edit") action = "Edit system prompt";
450
450
  else if (requestedAction === "details" || requestedAction === "info") action = "Show details";
451
451
  if (!action) {
452
- markAdminDialogSilent();
452
+ markAdminDialogSilent();
453
453
  action = await ctx.ui.select(
454
454
  `Administer ${agent.name}\n${metadataSummary(agent)}`,
455
455
  ["Change model", "Change thinking level", "Edit system prompt", "Show details", "Done"],
@@ -9,6 +9,8 @@ import { formatWorkflowJsonPreview } from "../workflows/scripted-workflow.ts";
9
9
  import { hostStepReportName, hostStepVerdictLabel } from "../runs/shared/host-step-status.ts";
10
10
  import { isStaleExtensionContextError } from "../shared/extension-context.ts";
11
11
  import { inlineWorkflowRenderKey } from "./render.ts";
12
+ import { runningTone } from "./running-tone.ts";
13
+ import { childThinkingLevel, type ThinkingLevel } from "../shared/model-info.ts";
12
14
  import { formatWorkflowChecklistBottleneck, formatWorkflowChecklistPhase, formatWorkflowChecklistSummary, projectWorkflowChecklist, type WorkflowChecklistPhase, type WorkflowChecklistProjection } from "../workflows/workflow-checklist.ts";
13
15
 
14
16
  export const FLEET_STATUS_WIDGET_KEY = "subagent-fleet-status";
@@ -75,6 +77,8 @@ type FleetNestedRow = {
75
77
  agentIdentity?: string;
76
78
  state: NestedRunSummary["state"] | NestedStepSummary["status"];
77
79
  modelThinking?: string;
80
+ /** Thinking level of the child this row stands for; it colors the running glyph. */
81
+ thinking?: ThinkingLevel;
78
82
  activity?: string;
79
83
  startedAt?: number;
80
84
  endedAt?: number;
@@ -178,8 +182,8 @@ function isWorkflowRowTerminal(row: AsyncStatusWorkflowRow): boolean {
178
182
  return row.state === "complete" || row.state === "completed";
179
183
  }
180
184
 
181
- function nestedStatusGlyph(state: FleetNestedRow["state"] | "planned", theme: Theme): string {
182
- if (state === "running") return theme.fg("accent", "●");
185
+ function nestedStatusGlyph(state: FleetNestedRow["state"] | "planned", theme: Theme, thinking?: ThinkingLevel): string {
186
+ if (state === "running") return runningTone(theme, thinking)("●");
183
187
  if (state === "queued" || state === "pending" || state === "planned") return theme.fg("muted", "◦");
184
188
  if (state === "complete" || state === "completed") return theme.fg("success", "✓");
185
189
  if (state === "failed" || state === "rejected") return theme.fg("error", "✗");
@@ -222,6 +226,7 @@ function nestedFleetRows(children: NestedRunSummary[] | undefined, visibleLimit:
222
226
  }
223
227
  const step = steps[stepIndex]!;
224
228
  const modelThinking = formatModelThinking(step.model, step.thinking) || undefined;
229
+ const thinking = childThinkingLevel(step);
225
230
  const activity = nestedActivity(step);
226
231
  rows.push({
227
232
  name: step.agent,
@@ -229,6 +234,7 @@ function nestedFleetRows(children: NestedRunSummary[] | undefined, visibleLimit:
229
234
  state: step.status,
230
235
  depth,
231
236
  ...(modelThinking ? { modelThinking } : {}),
237
+ ...(thinking ? { thinking } : {}),
232
238
  ...(activity ? { activity } : {}),
233
239
  ...(step.startedAt !== undefined ? { startedAt: step.startedAt } : {}),
234
240
  ...(step.endedAt !== undefined ? { endedAt: step.endedAt } : {}),
@@ -246,6 +252,7 @@ function nestedFleetRows(children: NestedRunSummary[] | undefined, visibleLimit:
246
252
  return false;
247
253
  }
248
254
  const modelThinking = formatModelThinking(child.model, child.thinking) || undefined;
255
+ const thinking = childThinkingLevel(child);
249
256
  const activity = nestedActivity(child);
250
257
  rows.push({
251
258
  name: nestedRunLabel(child),
@@ -253,6 +260,7 @@ function nestedFleetRows(children: NestedRunSummary[] | undefined, visibleLimit:
253
260
  state: child.state,
254
261
  depth,
255
262
  ...(modelThinking ? { modelThinking } : {}),
263
+ ...(thinking ? { thinking } : {}),
256
264
  ...(activity ? { activity } : {}),
257
265
  ...(child.startedAt !== undefined ? { startedAt: child.startedAt } : {}),
258
266
  ...(child.endedAt !== undefined ? { endedAt: child.endedAt } : {}),
@@ -896,13 +904,13 @@ export class SubagentFleetStatus {
896
904
  if (row.overflow !== undefined) return truncateToWidth(`${indent}${marker} ${theme.fg("dim", `+${row.overflow} nested leaves`)}`, width);
897
905
  const modelThinking = row.modelThinking ? ` (${row.modelThinking})` : "";
898
906
  const activity = row.activity ? ` · ${row.activity}` : "";
899
- const left = `${indent}${marker} ${nestedStatusGlyph(row.state, theme)} ${theme.fg(fleetAgentIdentityColor(row.agentIdentity ?? row.name), `${row.name}${modelThinking}`)} · ${row.state}${activity}`;
907
+ const left = `${indent}${marker} ${nestedStatusGlyph(row.state, theme, row.thinking)} ${theme.fg(fleetAgentIdentityColor(row.agentIdentity ?? row.name), `${row.name}${modelThinking}`)} · ${row.state}${activity}`;
900
908
  const elapsed = detailElapsed(row);
901
909
  return truncateToWidth(`${left}${elapsed !== undefined ? theme.fg("dim", ` · ${elapsed}`) : ""}`, width);
902
910
  }
903
911
 
904
912
  private workflowRowGlyph(row: AsyncStatusWorkflowRow, theme: Theme): string {
905
- if (!row.kind) return nestedStatusGlyph(row.state as FleetNestedRow["state"], theme);
913
+ if (!row.kind) return nestedStatusGlyph(row.state as FleetNestedRow["state"], theme, row.thinking);
906
914
  const state = row.state as HostStepState;
907
915
  if (state === "pending") return theme.fg("muted", "◦");
908
916
  if (state === "running") return theme.fg("accent", "●");
@@ -913,7 +921,7 @@ export class SubagentFleetStatus {
913
921
 
914
922
  private workflowRowStateLabel(row: AsyncStatusWorkflowRow, theme: Theme): string {
915
923
  const state = row.kind ? hostStepVerdictLabel(row.state as HostStepState, row.verdict as HostStepVerdict | undefined) : row.state;
916
- if (state === "running") return theme.fg("accent", state);
924
+ if (state === "running") return row.kind ? theme.fg("accent", state) : runningTone(theme, row.thinking)(state);
917
925
  if (state === "pending" || state === "queued") return theme.fg("muted", state);
918
926
  if (state === "pass" || state === "complete" || state === "completed") return theme.fg("success", state === "pass" ? "pass" : "complete");
919
927
  if (state === "fail" || state === "failed" || state === "error") return theme.fg("error", state === "fail" ? "fail" : state);
@@ -925,7 +933,7 @@ export class SubagentFleetStatus {
925
933
  const glyph = phase.state === "complete"
926
934
  ? theme.fg("success", "✓")
927
935
  : phase.state === "running"
928
- ? theme.fg("accent", "●")
936
+ ? runningTone(theme)("●")
929
937
  : phase.state === "blocked" || phase.state === "failed"
930
938
  ? theme.fg("error", phase.state === "blocked" ? "!" : "✗")
931
939
  : phase.state === "queued"
package/src/tui/fleet.ts CHANGED
@@ -23,8 +23,10 @@ import { stopAsyncRun } from "../runs/foreground/async-stop-action.ts";
23
23
  import { resolveWorkflowForegroundSteeringTarget, steerWorkflowForegroundTarget } from "../runs/foreground/workflow-foreground-steering.ts";
24
24
  import { contextModeBadge, contextModeLabel } from "../runs/shared/context-mode.ts";
25
25
  import { FLEET_STATUS_WIDGET_KEY } from "./fleet-status.ts";
26
- import { readFleetTranscript, renderFleetTranscript } from "./fleet-transcript.ts";
26
+ import { readFleetTranscript, renderFleetTranscript, type FleetTranscript } from "./fleet-transcript.ts";
27
27
  import { buildNativeFleetTranscript, loadNativeTranscriptSupport, type NativeTranscriptModule } from "./fleet-native-transcript.ts";
28
+ import { runningTone } from "./running-tone.ts";
29
+ import { childThinkingLevel, type ThinkingLevel } from "../shared/model-info.ts";
28
30
  import { handleInspectorAction } from "../inspectors/actions.ts";
29
31
  import type { InspectorPlugin } from "../inspectors/types.ts";
30
32
  import { getLivePromptAudit, type LivePromptAudit, type PromptAuditView } from "../runs/foreground/prompt-audit.ts";
@@ -360,8 +362,18 @@ function visibleWorkflowParentKeyForForegroundKey(state: SubagentState, key: str
360
362
  return undefined;
361
363
  }
362
364
 
365
+ /** The recorded level of the one child a running Fleet row stands for; a whole run or an external run has none. */
366
+ function fleetItemThinkingLevel(item: FleetItem): ThinkingLevel | undefined {
367
+ switch (item.kind) {
368
+ case "foreground-active": return childThinkingLevel(item.activeChild ?? item.control);
369
+ case "foreground-recent": return childThinkingLevel(item.child);
370
+ case "async": return childThinkingLevel(item.step);
371
+ case "external": return undefined;
372
+ }
373
+ }
374
+
363
375
  function statusGlyph(item: FleetItem, theme: Theme): string {
364
- if (item.state === "running") return theme.fg("accent", "●");
376
+ if (item.state === "running") return runningTone(theme, fleetItemThinkingLevel(item))("●");
365
377
  if (item.state === "queued" || item.state === "pending") return theme.fg("muted", "◦");
366
378
  if (item.state === "complete" || item.state === "completed") return theme.fg("success", "✓");
367
379
  if (item.state === "paused" || item.state === "stopped" || item.state === "detached") return theme.fg("warning", "■");