@arhen/pi-core-subagent 1.3.19 → 1.3.21
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 +1 -1
- package/src/index.ts +7 -0
- package/src/manager.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arhen/pi-core-subagent",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.21",
|
|
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/index.ts
CHANGED
|
@@ -162,6 +162,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
162
162
|
"End each task with a runnable check, e.g. 'Verify: npx tsc --noEmit && bun test'. A subagent's claim of success is not evidence.",
|
|
163
163
|
"Define each agent yourself: invented name, focused system prompt, and read-only (default) or write:true. Prefer read-only.",
|
|
164
164
|
"Prefer blocking (background:false) whenever the run's result is something you must wait for before your next step — do not default to background for work you depend on inline. When a background run is active, settle its pending results and task dependencies (await_subagent / subagent_result, then continue dependent work) before starting unrelated work.",
|
|
165
|
+
"For long multi-task runs, don't park the whole turn on one blocking call: start it in the background, then loop await_subagent with short timeoutMs slices (e.g. 20s), processing whichever tasks completed in each slice while the rest keep running. You get incremental results instead of one big blocking wait.",
|
|
165
166
|
"allowIntercom:true only when a child may need to ask you something.",
|
|
166
167
|
],
|
|
167
168
|
parameters: SubagentParams,
|
|
@@ -238,6 +239,12 @@ export default function (pi: ExtensionAPI) {
|
|
|
238
239
|
// ponytail: mode/count already shown on the call line above; result header only adds progress + status.
|
|
239
240
|
const header = `${statusIcon(run.status)} ${theme.fg("accent", `${run.tasks.filter((t) => t.status === "completed").length}/${run.tasks.length} done`)}${run.background ? ` ${theme.fg("muted", "(background)")}` : ""} ${theme.fg("muted", run.status)}`;
|
|
240
241
|
if (!expanded) {
|
|
242
|
+
// Background: the spawn snapshot is always "0 tools" noise and the footer widget
|
|
243
|
+
// already shows live per-task state — keep the card to the header only.
|
|
244
|
+
if (run.background) {
|
|
245
|
+
const usage = formatUsage(run.aggregateUsage);
|
|
246
|
+
return new Text(usage ? `${header}\n${theme.fg("dim", usage)}` : header, 0, 0);
|
|
247
|
+
}
|
|
241
248
|
const lines = [header, ...run.tasks.map((task) => ` ${themedTaskLine(task, theme)}`)];
|
|
242
249
|
const usage = formatUsage(run.aggregateUsage);
|
|
243
250
|
if (usage) lines.push(theme.fg("dim", usage));
|
package/src/manager.ts
CHANGED
|
@@ -693,7 +693,7 @@ export class SubagentManager {
|
|
|
693
693
|
const key = `${run.id}:${task.id}`;
|
|
694
694
|
try {
|
|
695
695
|
const subagentInstruction = run.allowIntercom
|
|
696
|
-
? `You are running as a subagent. Your bash tool already executes in the project working directory — never prefix commands with \`cd\`. Do not call subagent/delegation tools unless the parent explicitly asks. Return a concise final answer. You MAY use ask_parent only when truly blocked on information only the parent has; notify_parent for one-way updates; send_agent_message/poll_agent_messages to coordinate with siblings. Your mailbox address and siblings: ${task.roster ?? "(none)"}. Use the exact task ids (e.g. task_2) as send_agent_message targets. Siblings run independently and may start late or finish early — never block indefinitely on their replies: poll at most 5 times, then proceed with your best judgment. A gated sibling (marked ↳ waits in the graph) may not be running yet; do not wait for it. Stalled waits get the whole run killed.`
|
|
696
|
+
? `You are running as a subagent. Your bash tool already executes in the project working directory — never prefix commands with \`cd\`. Do not call subagent/delegation tools unless the parent explicitly asks. Return a concise final answer. You MAY use ask_parent only when truly blocked on information only the parent has; notify_parent for one-way updates; send_agent_message/poll_agent_messages to coordinate with siblings. Your mailbox address and siblings: ${task.roster ?? "(none)"}. Use the exact task ids (e.g. task_2) as send_agent_message targets. Siblings run independently and may start late or finish early — never block indefinitely on their replies: poll at most 5 times, then proceed with your best judgment. A gated sibling (marked ↳ waits in the graph) may not be running yet; do not wait for it. Stalled waits get the whole run killed. When your work is done, call notify_parent ONCE with a concise result summary — key findings, verdicts, file:line evidence — so the leader can start consuming your output before the run finishes.`
|
|
697
697
|
: `You are running as a subagent. Your bash tool already executes in the project working directory — never prefix commands with \`cd\`. Do not call subagent/delegation tools unless the parent explicitly asks. Return a concise final answer for the parent agent.`;
|
|
698
698
|
|
|
699
699
|
const loader = new DefaultResourceLoader({
|