@arhen/pi-core-subagent 1.3.54 → 1.3.56
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/format.ts +8 -3
- package/src/manager.ts +13 -1
- package/src/types.ts +1 -0
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.56",
|
|
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/format.ts
CHANGED
|
@@ -60,8 +60,12 @@ function taskStatsWithUsage(task: TaskSnapshot): string {
|
|
|
60
60
|
const usage = formatUsage(task.usage);
|
|
61
61
|
return `${stats}${usage ? ` · ${usage}` : ""}`;
|
|
62
62
|
}
|
|
63
|
+
export function modelTag(task: TaskSnapshot): string {
|
|
64
|
+
const ref = [task.provider, task.model, task.thinking].filter(Boolean).join("/");
|
|
65
|
+
return ref ? ` [${ref}]` : "";
|
|
66
|
+
}
|
|
63
67
|
export function taskLine(task: TaskSnapshot): string {
|
|
64
|
-
return `${statusIcon(task.status)} ${task.agent} · ${taskStatsWithUsage(task)} · ${taskTimer(task)}`;
|
|
68
|
+
return `${statusIcon(task.status)} ${task.agent}${modelTag(task)} · ${taskStatsWithUsage(task)} · ${taskTimer(task)}`;
|
|
65
69
|
}
|
|
66
70
|
export function colorNums(text: string, theme: Theme): string {
|
|
67
71
|
return text.replace(/((?:\d+(?:\.\d+)?[a-zA-Z]*)+)|([^\d]+)/g, (_m, num?: string, rest?: string) =>
|
|
@@ -71,15 +75,16 @@ export function colorNums(text: string, theme: Theme): string {
|
|
|
71
75
|
function themedTaskLine(task: TaskSnapshot, theme: Theme, activity = ""): string {
|
|
72
76
|
const tail = `${taskStatsWithUsage(task)} · ${taskTimer(task)}`;
|
|
73
77
|
|
|
78
|
+
const tag = theme.fg("dim", modelTag(task));
|
|
74
79
|
const gate =
|
|
75
80
|
task.status === "queued" && task.needs?.length ? `${theme.fg("muted", `↳ waits ${task.needs.join(", ")}`)} · ` : "";
|
|
76
81
|
if (TERMINAL.includes(task.status)) {
|
|
77
|
-
return theme.fg("dim", `${statusIcon(task.status)} ${task.agent} · ${tail}`);
|
|
82
|
+
return theme.fg("dim", `${statusIcon(task.status)} ${task.agent}${tag} · ${tail}`);
|
|
78
83
|
}
|
|
79
84
|
|
|
80
85
|
pulsePhase += 1;
|
|
81
86
|
const name = isTalking(task) ? theme.fg(pulsePhase % 2 === 0 ? "accent" : "dim", `${task.agent} ⇄`) : task.agent;
|
|
82
|
-
return `${statusIcon(task.status)} ${name} · ${gate}${activity}${colorNums(tail, theme)}`;
|
|
87
|
+
return `${statusIcon(task.status)} ${name}${tag} · ${gate}${activity}${colorNums(tail, theme)}`;
|
|
83
88
|
}
|
|
84
89
|
const ARG_KEYS = ["pattern", "query", "command", "path", "file_path", "filePath", "url", "name", "subject", "task"];
|
|
85
90
|
export function describeCall(toolName: string, args: unknown, cwd?: string): string {
|
package/src/manager.ts
CHANGED
|
@@ -184,6 +184,11 @@ export async function ensureUsableModel(
|
|
|
184
184
|
if (session && model.provider === session.provider && model.id === session.id) return { model };
|
|
185
185
|
const error = await probeModel(ctx, model, signal);
|
|
186
186
|
if (!error) return { model };
|
|
187
|
+
if (model.provider === "opencode-go" && /MissingSessionID|x-opencode-session/i.test(error)) {
|
|
188
|
+
// ponytail: opencode-go rejects stateless probes but accepts AgentSession requests, which add the session header.
|
|
189
|
+
// Upgrade path: remove this exception when modelRegistry.complete can carry AgentSession request transforms.
|
|
190
|
+
return { model, note: `preflight unavailable (${error}); child session will validate the model` };
|
|
191
|
+
}
|
|
187
192
|
if (!session) throw new Error(`Model ${model.provider}/${model.id} is unusable: ${error}`);
|
|
188
193
|
return {
|
|
189
194
|
model: session,
|
|
@@ -827,6 +832,7 @@ export class SubagentManager {
|
|
|
827
832
|
task: input.task,
|
|
828
833
|
|
|
829
834
|
model: model?.id ?? input.model,
|
|
835
|
+
provider: model?.provider,
|
|
830
836
|
thinking,
|
|
831
837
|
tools,
|
|
832
838
|
},
|
|
@@ -880,7 +886,13 @@ export class SubagentManager {
|
|
|
880
886
|
this.updateTask(
|
|
881
887
|
run,
|
|
882
888
|
task,
|
|
883
|
-
{
|
|
889
|
+
{
|
|
890
|
+
status: "running",
|
|
891
|
+
sessionId: child.sessionId,
|
|
892
|
+
sessionFile: child.sessionFile,
|
|
893
|
+
provider: child.model?.provider ?? task.provider,
|
|
894
|
+
thinking: child.thinkingLevel,
|
|
895
|
+
},
|
|
884
896
|
ctx,
|
|
885
897
|
onUpdate,
|
|
886
898
|
);
|