@ian-pascoe/pi-minimal-subagents 0.10.0 → 0.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ian-pascoe/pi-minimal-subagents",
3
- "version": "0.10.0",
3
+ "version": "0.10.1",
4
4
  "private": false,
5
5
  "description": "Persistent nested subagents with bounded delegation for Pi",
6
6
  "keywords": [
@@ -2,6 +2,7 @@
2
2
  name: pi-minimal-subagents
3
3
  description: Configure or diagnose Pi Minimal Subagents for Subagent Access, missing Coordinator Tools, spawn, capability, delivery, wait, restore, reload, or fork failures.
4
4
  license: MIT
5
+ disable-model-invocation: true
5
6
  ---
6
7
 
7
8
  # Pi Minimal Subagents
@@ -34,6 +34,7 @@ import {
34
34
  type DeliveryLedger,
35
35
  type DeliveryLedgerTransition,
36
36
  } from "./minimal-subagents-delivery-ledger.js";
37
+ import { withTroubleshootingHint } from "./troubleshooting-skill.js";
37
38
  import { addCoordinatorMessageEnvelope } from "./minimal-subagents-message-envelope.js";
38
39
  import { unavailableAgent } from "./minimal-subagents-sessions.js";
39
40
  import { createRegistryEvent } from "./minimal-subagents-registry.js";
@@ -264,7 +265,9 @@ export class MinimalSubagentsCoordinator {
264
265
  const requiredMissing = missingDependencies.filter((name) => !optionalMissing.has(name));
265
266
  if (requiredMissing.length > 0) {
266
267
  throw new Error(
267
- `Minimal subagents launch dependencies unavailable: ${requiredMissing.join(", ")}`,
268
+ withTroubleshootingHint(
269
+ `Minimal subagents launch dependencies unavailable: ${requiredMissing.join(", ")}`,
270
+ ),
268
271
  );
269
272
  }
270
273
  if (optionalMissing.size > 0) {
@@ -381,7 +384,7 @@ export class MinimalSubagentsCoordinator {
381
384
  agent_id: targetId,
382
385
  message_id: messageId,
383
386
  disposition: "failed",
384
- error: deliveryError,
387
+ error: withTroubleshootingHint(deliveryError),
385
388
  };
386
389
  }
387
390
  }
@@ -925,7 +928,7 @@ export class MinimalSubagentsCoordinator {
925
928
  turn_id: turnId,
926
929
  status: "failed",
927
930
  output: "",
928
- error: error instanceof Error ? error.message : String(error),
931
+ error: withTroubleshootingHint(error instanceof Error ? error.message : String(error)),
929
932
  });
930
933
  }
931
934
  }
@@ -1366,7 +1369,7 @@ export class MinimalSubagentsCoordinator {
1366
1369
  turn_id: turnId,
1367
1370
  status: "failed",
1368
1371
  output: "",
1369
- error: cause instanceof Error ? cause.message : String(cause),
1372
+ error: withTroubleshootingHint(cause instanceof Error ? cause.message : String(cause)),
1370
1373
  });
1371
1374
  }
1372
1375
  });
@@ -1634,12 +1637,16 @@ export class MinimalSubagentsCoordinator {
1634
1637
  const agent = this.requireAgent(agentId);
1635
1638
  if (agent.availability === "unavailable") {
1636
1639
  throw new Error(
1637
- agent.unavailable_reason ?? `Minimal subagents ${operation}: ${agentId} is unavailable`,
1640
+ withTroubleshootingHint(
1641
+ agent.unavailable_reason ?? `Minimal subagents ${operation}: ${agentId} is unavailable`,
1642
+ ),
1638
1643
  );
1639
1644
  }
1640
1645
  if (agent.clone_error || !agent.session_file) {
1641
1646
  throw new Error(
1642
- `Minimal subagents ${operation}: ${agent.clone_error ?? `${agentId} has no child session`}`,
1647
+ withTroubleshootingHint(
1648
+ `Minimal subagents ${operation}: ${agent.clone_error ?? `${agentId} has no child session`}`,
1649
+ ),
1643
1650
  );
1644
1651
  }
1645
1652
  return agent;
@@ -62,6 +62,7 @@ import {
62
62
  type RuntimeToolAdapter,
63
63
  unavailableAgent,
64
64
  } from "./minimal-subagents-sessions.js";
65
+ import { withTroubleshootingHint } from "./troubleshooting-skill.js";
65
66
  import { shutdownMinimalSubagentsSession } from "./minimal-subagents-shutdown.js";
66
67
  import { writeMinimalSubagentsEnabled } from "./minimal-subagents-settings-writer.js";
67
68
  import {
@@ -164,7 +165,10 @@ export function reachableToolNames(
164
165
  }
165
166
 
166
167
  function rootCallerSnapshot(pi: ExtensionAPI, context: ExtensionContext): CallerSnapshot {
167
- if (!context.model) throw new Error("Minimal subagents spawn: root has no effective model");
168
+ if (!context.model)
169
+ throw new Error(
170
+ withTroubleshootingHint("Minimal subagents spawn: root has no effective model"),
171
+ );
168
172
  return {
169
173
  messages: currentConversationMessages(context),
170
174
  model: `${context.model.provider}/${context.model.id}`,
@@ -10,6 +10,7 @@ import {
10
10
  type ToolRenderResultOptions,
11
11
  } from "@earendil-works/pi-coding-agent";
12
12
  import type { MinimalSubagentsCoordinator } from "./minimal-subagents-coordinator.js";
13
+ import { withTroubleshootingHint } from "./troubleshooting-skill.js";
13
14
  import type { MinimalSubagentsModelRole } from "./minimal-subagents-config.js";
14
15
  import {
15
16
  renderCoordinatorToolCall,
@@ -135,7 +136,7 @@ function failedStructuredOperation(prefix: string, result: DeleteResult): never
135
136
  maxBytes: DEFAULT_MAX_BYTES,
136
137
  maxLines: DEFAULT_MAX_LINES,
137
138
  });
138
- throw new Error(`${prefix}: ${truncated.content}`);
139
+ throw new Error(withTroubleshootingHint(`${prefix}: ${truncated.content}`));
139
140
  }
140
141
 
141
142
  function callerSourceTurnId(
@@ -0,0 +1,14 @@
1
+ import { fileURLToPath } from "node:url";
2
+
3
+ /** Absolute path of this package's user-invoked troubleshooting Skill. */
4
+ export const TROUBLESHOOTING_SKILL_PATH = fileURLToPath(
5
+ new URL("../skills/pi-minimal-subagents/SKILL.md", import.meta.url),
6
+ );
7
+
8
+ /** Model-facing pointer appended to failures this package's Skill diagnoses. */
9
+ export const TROUBLESHOOTING_HINT = `For diagnosis, read the pi-minimal-subagents troubleshooting Skill at ${TROUBLESHOOTING_SKILL_PATH}.`;
10
+
11
+ /** Append the troubleshooting Skill pointer to a model-facing configuration or runtime failure. */
12
+ export function withTroubleshootingHint(message: string): string {
13
+ return `${message}\n\n${TROUBLESHOOTING_HINT}`;
14
+ }