@arhen/pi-core-subagent 1.3.51 → 1.3.52

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": "@arhen/pi-core-subagent",
3
- "version": "1.3.51",
3
+ "version": "1.3.52",
4
4
  "type": "module",
5
5
  "description": "pi extension: fast in-process subagents with a dependency-graph scheduler (needs edges gate tasks and carry upstream output into dependent prompts), plus background runs, intercom and agent-to-agent mailbox. Leader defines agents inline.",
6
6
  "license": "MIT",
package/src/manager.ts CHANGED
@@ -434,7 +434,11 @@ export class SubagentManager {
434
434
  }
435
435
 
436
436
  private notifyTask(run: RunSnapshot, task: TaskSnapshot, kind: "completed" | "failed" | "aborted"): void {
437
- const body = makeTaskNotice(run, task, kind);
437
+ // ponytail: child already pushed its summary via notify_parent — pointer only, no second copy. Upgrade: drop notice entirely if the pointer noise also proves useless.
438
+ const body =
439
+ kind === "completed" && task.notifiedParent
440
+ ? `Task ${task.agent} (${task.id}) completed in run ${run.id} — summary already reported. Use subagent_result(runId: "${run.id}", taskId: "${task.id}") for full output.`
441
+ : makeTaskNotice(run, task, kind);
438
442
 
439
443
  if (this.collectParked(run.id, { kind: "done", taskId: task.id, agent: task.agent, text: body })) {
440
444
  this.emit("subagent:notification", { runId: run.id, taskId: task.id, kind, body });
@@ -452,6 +456,8 @@ export class SubagentManager {
452
456
  extra?: { taskId?: string; question?: string },
453
457
  ): void {
454
458
  if (kind !== "asked" && run.awaited) return;
459
+ // single-task completed run: the task notice already said everything (failure paths may not have notified per-task)
460
+ if (kind === "completed" && run.tasks.length === 1 && run.notifyPerTask) return;
455
461
  const body =
456
462
  kind === "asked"
457
463
  ? `A subagent is asking you a question (task ${extra?.taskId}): ${extra?.question ?? ""}\nReply with reply_subagent(runId: "${run.id}", taskId: "${extra?.taskId}", message: ...).`
@@ -576,6 +582,7 @@ export class SubagentManager {
576
582
  },
577
583
  onNotifyParent: (_taskId, message, level) => {
578
584
  this.emit("subagent:intercom", { runId: run.id, taskId: task.id, kind: "notify", level, message });
585
+ task.notifiedParent = true;
579
586
 
580
587
  if (this.collectParked(run.id, { kind: "notify", taskId: task.id, agent: task.agent, text: message })) return;
581
588
  try {
package/src/types.ts CHANGED
@@ -30,6 +30,7 @@ export interface TaskSnapshot {
30
30
  toolCalls: number;
31
31
  lastActivity?: string;
32
32
  finalText?: string;
33
+ notifiedParent?: boolean;
33
34
  error?: string;
34
35
  model?: string;
35
36
  modelNote?: string;