@henryqw/pi-subagent 2.4.0 → 2.5.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/CONTEXT.md +1 -1
- package/README.md +2 -2
- package/dist/index.js +3 -3
- package/extensions/subagent.ts +4 -4
- package/package.json +2 -2
package/CONTEXT.md
CHANGED
|
@@ -9,7 +9,7 @@ Provide validated user Roles, shared task-model Pi launch policy, generic manage
|
|
|
9
9
|
- **Main**: Pi session delegating work.
|
|
10
10
|
- **Subagent**: isolated Pi child process handling one task.
|
|
11
11
|
- **Role**: user-owned Markdown profile defining name, description, system instructions, optional exact tool allowlist, extensions, and Skill names.
|
|
12
|
-
- **Model Class**: `fast`, `balanced`, or `
|
|
12
|
+
- **Model Class**: `fast`, `balanced`, `frontier`, or `fav`, assigned in shared task-model settings or overridden by Main from task complexity.
|
|
13
13
|
- **Route**: configured model and thinking-level pair selected from a shared Model Class profile; the primary route precedes its optional fallback.
|
|
14
14
|
- **Delegated Task**: one bounded work request sent from Main to one Role.
|
|
15
15
|
- **Pi Launch**: reusable `{env,args}` policy for one Role, resolved model route, explicit caller resources, and project trust.
|
package/README.md
CHANGED
|
@@ -14,7 +14,7 @@ pi install npm:@henryqw/pi-subagent
|
|
|
14
14
|
|
|
15
15
|
| Package | Why |
|
|
16
16
|
| --- | --- |
|
|
17
|
-
| `@henryqw/pi-task-models` | Required. Shared `fast` / `balanced` / `frontier` routes. |
|
|
17
|
+
| `@henryqw/pi-task-models` | Required. Shared `fast` / `balanced` / `frontier` / `fav` routes. |
|
|
18
18
|
| `@henryqw/pi-multi-codex` | Required. Child uses Main's active Codex slot. |
|
|
19
19
|
|
|
20
20
|
## Use
|
|
@@ -25,7 +25,7 @@ pi install npm:@henryqw/pi-subagent
|
|
|
25
25
|
|
|
26
26
|
An explicit `model` (`provider/modelId`) overrides `modelClass` and resolves against the currently available text models; an unknown reference rejects with the list of available models. Thinking level defaults to `medium` when supported, otherwise the highest supported level.
|
|
27
27
|
|
|
28
|
-
`modelClass` is `fast`, `balanced`, or `
|
|
28
|
+
`modelClass` is `fast`, `balanced`, `frontier`, or `fav`. Omitted class uses the shared `pi-subagent/delegateTask` assignment, which defaults to `balanced`. Primary route is resolved against current scoped text models; fallback is tried only before launch. If no route is usable, delegation rejects with `Run /task-models`. A started child is never retried.
|
|
29
29
|
|
|
30
30
|
Main splits broad work into independent bounded tasks and keeps integration and cross-cutting decisions. Each `task` states its objective, exact scope and exclusions, relevant context and constraints, expected deliverable, and validation. Each call uses the least capable `modelClass` that can reliably complete its task. Independent sibling calls can run concurrently; concurrent edit tasks must own non-overlapping files. Up to four active ephemeral `delegate_task` children run per Main; excess calls wait FIFO. Queued calls do not start a child or consume child timeout. Managed Herdr workers are unaffected.
|
|
31
31
|
|
package/dist/index.js
CHANGED
|
@@ -89,13 +89,13 @@ export function resolveTaskRoute(ctx, profileName, agentDir = getAgentDir()) {
|
|
|
89
89
|
catch {
|
|
90
90
|
throw new Error("Couldn't read task model config. Run /task-models.");
|
|
91
91
|
}
|
|
92
|
-
return resolveConfiguredRoute(ctx, profileName, config.profiles[profileName]);
|
|
92
|
+
return resolveConfiguredRoute(ctx, profileName, config.profiles[profileName], agentDir);
|
|
93
93
|
}
|
|
94
|
-
function resolveConfiguredRoute(ctx, profileName, profile) {
|
|
94
|
+
function resolveConfiguredRoute(ctx, profileName, profile, agentDir = getAgentDir()) {
|
|
95
95
|
if (!profile)
|
|
96
96
|
throw new Error(`No ${profileName} task model profile is configured. Run /task-models.`);
|
|
97
97
|
for (const route of orderedProfileRoutes(profile)) {
|
|
98
|
-
const resolved = resolveTaskModelRoute(ctx, route);
|
|
98
|
+
const resolved = resolveTaskModelRoute(ctx, route, agentDir);
|
|
99
99
|
if (resolved)
|
|
100
100
|
return resolved;
|
|
101
101
|
}
|
package/extensions/subagent.ts
CHANGED
|
@@ -427,7 +427,7 @@ const Parameters = Type.Object({
|
|
|
427
427
|
description: "Designated model as provider/modelId; overrides modelClass. Unknown references reject with the list of available models.",
|
|
428
428
|
})),
|
|
429
429
|
modelClass: Type.Optional(StringEnum(MODEL_CLASSES, {
|
|
430
|
-
description: "Classify task complexity: fast for narrow lookups or mechanical edits; balanced for normal bounded work; frontier for ambiguous, cross-cutting, or high-risk reasoning. Defaults to the shared pi-subagent/delegateTask assignment.",
|
|
430
|
+
description: "Classify task complexity: fast for narrow lookups or mechanical edits; balanced for normal bounded work; frontier for ambiguous, cross-cutting, or high-risk reasoning; fav for the user's favorite model when they ask for it. Defaults to the shared pi-subagent/delegateTask assignment.",
|
|
431
431
|
})),
|
|
432
432
|
});
|
|
433
433
|
|
|
@@ -574,12 +574,12 @@ export default function subagentExtension(
|
|
|
574
574
|
pi.registerTool({
|
|
575
575
|
name: "delegate_task",
|
|
576
576
|
label: "Subagent",
|
|
577
|
-
description: `Delegate one bounded, independently executable task to one isolated Pi Subagent. Roles: ${roleSummary()}. Choose fast for narrow work, balanced for normal work,
|
|
577
|
+
description: `Delegate one bounded, independently executable task to one isolated Pi Subagent. Roles: ${roleSummary()}. Choose fast for narrow work, balanced for normal work, frontier for ambiguous and high-risk work, or fav when the user asks for their favorite model; omit modelClass to use shared task-model settings. When the user designates a specific model, pass it as provider/modelId in model.`,
|
|
578
578
|
promptSnippet: "Delegate one bounded, independently executable task to an isolated role",
|
|
579
579
|
promptGuidelines: [
|
|
580
580
|
"Before calling delegate_task, split broad work into the smallest independent bounded tasks; keep integration and cross-cutting decisions in Main.",
|
|
581
581
|
"Each delegate_task task must state its objective, exact scope and exclusions, relevant context and constraints, expected deliverable, and validation; never pass the parent request unchanged.",
|
|
582
|
-
"
|
|
582
|
+
"Use fav when the user explicitly asks for their favorite model. Otherwise, choose the least capable modelClass that can reliably complete the task: fast for narrow work, balanced for normal work, and frontier only for ambiguous, cross-cutting, or high-risk work.",
|
|
583
583
|
"Submit independent delegate_task calls together for parallel execution. Parallel edits must own non-overlapping files; otherwise sequence them. Use the minimum number of Subagents needed.",
|
|
584
584
|
],
|
|
585
585
|
parameters: Parameters,
|
|
@@ -592,7 +592,7 @@ export default function subagentExtension(
|
|
|
592
592
|
}
|
|
593
593
|
|
|
594
594
|
if (params.modelClass !== undefined && !isModelClass(params.modelClass)) {
|
|
595
|
-
throw new Error("delegate_task modelClass must be fast, balanced, or
|
|
595
|
+
throw new Error("delegate_task modelClass must be fast, balanced, frontier, or fav.");
|
|
596
596
|
}
|
|
597
597
|
const launch = params.model !== undefined
|
|
598
598
|
? createRoleLaunch(pi, ctx, { role, route: resolveDesignatedRoute(ctx, cleanText(params.model, "model", "delegate_task")) })
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@henryqw/pi-subagent",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.5.1",
|
|
4
4
|
"description": "Delegate one task to an isolated Pi role with explicit extensions and skills.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pi-package",
|
|
@@ -59,6 +59,6 @@
|
|
|
59
59
|
"dependencies": {
|
|
60
60
|
"@henryqw/pi-herdr": "^0.1.1",
|
|
61
61
|
"@henryqw/pi-multi-codex": "^0.3.8",
|
|
62
|
-
"@henryqw/pi-task-models": "^0.
|
|
62
|
+
"@henryqw/pi-task-models": "^0.5.0"
|
|
63
63
|
}
|
|
64
64
|
}
|