@arhen/pi-core-subagent 1.1.0 → 1.1.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.ts +15 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arhen/pi-core-subagent",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "type": "module",
5
5
  "description": "pi extension: fast in-process subagents with single/parallel/chain, background runs, intercom and agent-to-agent mailbox. Leader defines agents inline.",
6
6
  "license": "MIT",
package/src/index.ts CHANGED
@@ -25,7 +25,7 @@ const DEFAULT_CONCURRENCY = 3;
25
25
  const MAX_CONCURRENCY = 8;
26
26
  const MAX_TASKS = 16;
27
27
  const DEFAULT_RUNTIME_MS = 10 * 60 * 1000;
28
- const DEFAULT_STALL_MS = 90_000;
28
+ const DEFAULT_STALL_MS = 180_000; // 3 min: long model thinking streams emit message_update, not message_end
29
29
  const THINKING_LEVELS = ["off", "minimal", "low", "medium", "high", "xhigh", "max"] as const;
30
30
  const READONLY_TOOLS = ["read", "grep", "find", "ls"];
31
31
  const WRITE_TOOLS = ["read", "grep", "find", "ls", "bash", "edit", "write"];
@@ -705,7 +705,7 @@ class SubagentManager {
705
705
  });
706
706
 
707
707
  unsubscribe = child.subscribe((event: AgentSessionEvent) => {
708
- const active = event.type === "message_end" || event.type === "tool_execution_start" || event.type === "tool_execution_end" || event.type === "agent_settled";
708
+ const active = event.type === "message_update" || event.type === "message_end" || event.type === "tool_execution_start" || event.type === "tool_execution_end" || event.type === "agent_settled";
709
709
  if (active) {
710
710
  watchdog.touch();
711
711
  this.emit("subagent:session-event", { runId: run.id, taskId: task.id, seq: eventSeq++, event: { type: event.type } });
@@ -1133,7 +1133,19 @@ export default function (pi: ExtensionAPI) {
1133
1133
  renderCall(args, theme) {
1134
1134
  const mode = args.chain?.length ? `chain ${args.chain.length}` : args.tasks?.length ? `parallel ${args.tasks.length}` : `single ${args.agent ?? "?"}`;
1135
1135
  const flags = [args.background ? "bg" : "", args.allowIntercom ? "talk" : ""].filter(Boolean).join(" ");
1136
- return new Text(`${theme.fg("toolTitle", theme.bold("subagent"))} ${theme.fg("accent", mode)}${flags ? ` ${theme.fg("muted", `[${flags}]`)}` : ""}`, 0, 0);
1136
+ // Params used, dimmed: model, thinking, toolset, per-task write count.
1137
+ const tasks = args.tasks ?? args.chain ?? [];
1138
+ const writeCount = tasks.filter((t: any) => t.write).length;
1139
+ const parts: string[] = [];
1140
+ if (args.model) parts.push(args.model);
1141
+ if (args.thinking) parts.push(args.thinking);
1142
+ if (args.write) parts.push("write");
1143
+ else if (writeCount === 0) parts.push("read-only");
1144
+ if (writeCount > 0) parts.push(`${writeCount} write`);
1145
+ if (args.concurrency) parts.push(`c${args.concurrency}`);
1146
+ if (args.maxRuntimeMs) parts.push(`${Math.round(args.maxRuntimeMs / 60000)}m`);
1147
+ const params = parts.length > 0 ? `\n ${theme.fg("dim", parts.join(" · "))}` : "";
1148
+ return new Text(`${theme.fg("toolTitle", theme.bold("subagent"))} ${theme.fg("accent", mode)}${flags ? ` ${theme.fg("muted", `[${flags}]`)}` : ""}${params}`, 0, 0);
1137
1149
  },
1138
1150
  renderResult(result, { expanded }, theme) {
1139
1151
  const run = result.details?.run;