@signalridge/pi-subagents 1.10.1 → 1.10.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.10.2
4
+ ### Patch Changes
5
+
6
+ - 65e2481: Show supervisor questions in subagent input dialogs and identify the asking agent by its actual name.
7
+
3
8
  ## 1.10.1
4
9
  ### Patch Changes
5
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@signalridge/pi-subagents",
3
- "version": "1.10.1",
3
+ "version": "1.10.2",
4
4
  "description": "Signalridge's managed subagent runtime with workflow-owned orchestration RPC.",
5
5
  "author": "tintinweb and signalridge contributors",
6
6
  "license": "MIT",
@@ -1126,7 +1126,9 @@ export async function runAgent(
1126
1126
  const supervisorTools =
1127
1127
  ctx.hasUI && !isolated && options.supervisorQuestions !== false
1128
1128
  ? createSupervisorTool({
1129
- agentLabel: agentConfig?.displayName ?? type,
1129
+ // Use the canonical agent type, not display_name: the question must
1130
+ // identify the actual subagent that requested the decision.
1131
+ agentLabel: agentConfig?.name ?? type,
1130
1132
  ask: {
1131
1133
  input: (title, placeholder) => ctx.ui.input(title, placeholder),
1132
1134
  select: (title, choices) => ctx.ui.select(title, choices),
package/src/supervisor.ts CHANGED
@@ -36,7 +36,7 @@ export interface SupervisorAsk {
36
36
  export interface SupervisorToolContext {
37
37
  /** The parent's UI. Omitted when there is no human to ask. */
38
38
  ask?: SupervisorAsk;
39
- /** Display name of the asking agent, for the prompt title. */
39
+ /** Actual type/name of the asking agent, for the prompt title. */
40
40
  agentLabel: string;
41
41
  }
42
42
 
@@ -82,7 +82,10 @@ export function createSupervisorTool(context: SupervisorToolContext) {
82
82
  const question = truncateCodePoints(sanitizeDisplayText(params.question), MAX_QUESTION, "…").trim();
83
83
  if (!question) return textResult("Ask a non-empty question.", true);
84
84
 
85
- const title = `${context.agentLabel} asks`;
85
+ const title = `${sanitizeDisplayText(context.agentLabel)} asks`;
86
+ // Pi 0.85.1 ignores ui.input()'s placeholder argument. Keep the
87
+ // question in the title so the human sees it in both old and new hosts.
88
+ const promptTitle = `${title}: ${question}`;
86
89
  const options = (params.options ?? [])
87
90
  .map((option) => truncateCodePoints(sanitizeDisplayText(option), MAX_OPTION, "…").trim())
88
91
  .filter((option) => option.length > 0)
@@ -92,8 +95,8 @@ export function createSupervisorTool(context: SupervisorToolContext) {
92
95
  try {
93
96
  answer =
94
97
  options.length > 0
95
- ? await ask.select(`${title}: ${question}`, options)
96
- : await ask.input(title, question);
98
+ ? await ask.select(promptTitle, options)
99
+ : await ask.input(promptTitle);
97
100
  } catch (error: unknown) {
98
101
  // A dialog that cannot open must not fail the child's whole run; it
99
102
  // is told nobody answered and carries on under its own judgement.