oira666_pi-subagent 0.6.2 → 0.6.3
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/README.md +9 -1
- package/docs/sessions.md +1 -1
- package/extension/expand-command.ts +7 -1
- package/extension/message-batch.ts +127 -0
- package/extension/message-tool.ts +4 -3
- package/extension/prompt-hook.ts +1 -1
- package/extension/schemas.ts +13 -1
- package/package.json +1 -1
- package/runner/single.ts +1 -1
- package/ui/detail-budget.ts +24 -0
- package/ui/detail-lines.ts +3 -0
- package/ui/detail-model.ts +3 -0
- package/ui/detail-transcript.ts +3 -1
- package/ui/tree-live.ts +4 -1
package/README.md
CHANGED
|
@@ -85,6 +85,14 @@ Workers receive durable human names. Call `message_subagent(name, message, max_s
|
|
|
85
85
|
{ "name": "John", "message": "Now update the tests." }
|
|
86
86
|
```
|
|
87
87
|
|
|
88
|
+
Send the same message to several workers with an array of names:
|
|
89
|
+
|
|
90
|
+
```json
|
|
91
|
+
{ "name": ["John", "Maria"], "message": "The shared API changed. Use the new signature." }
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Each recipient receives only the message text, not the recipient list. Duplicate names receive one copy. Running workers are steered and idle workers resume concurrently. Delivery failures are reported per recipient without undoing successful deliveries. An optional `max_subagents_allowed` applies separately to each recipient.
|
|
95
|
+
|
|
88
96
|
A message steers a running worker or resumes an idle worker with its saved context. It does not wait for the worker to finish. `agent` selects a definition at launch; `name` identifies an existing worker. Messaging or resuming a named worker consumes no new worker slot. An optional budget increase can reserve additional descendant slots. See [sessions and budgets](docs/sessions.md) for cap overrides, forks, and crash recovery.
|
|
89
97
|
|
|
90
98
|
A child calls `message_lead_agent(message)` to send nonblocking steering to its lead:
|
|
@@ -128,7 +136,7 @@ Collapsed results show each child's name, task, status, and most recent activity
|
|
|
128
136
|
|
|
129
137
|
A live single line above the editor shows `Running N: Name elapsed · Name elapsed`, with `+N` for names that do not fit and a separate idle count. It uses live handles and snapshots, not session metadata or disk reads on timer ticks.
|
|
130
138
|
|
|
131
|
-
`/subagent-expand <name>` opens a saved worker transcript. With no name, it opens a searchable picker. Running workers come first in depth order, with top-level workers before nested workers. Live idle parents waiting for children come next; completed or stopped history comes last. Name completion is fuzzy. Each task or resumed turn shows its actual provider/model and thinking level from the worker's session, not the parent's settings. Selected presets also appear as an intelligence label, kept separately for each run. Missing historical model/thinking metadata appears as `unknown`.
|
|
139
|
+
`/subagent-expand <name>` opens a saved worker transcript. Its top section shows the current descendant-slot budget: allowed, used/reserved, and remaining. Used slots include allowances reserved for children and their descendants, not just currently running processes. Missing legacy budgets show as unknown. With no name, it opens a searchable picker. Running workers come first in depth order, with top-level workers before nested workers. Live idle parents waiting for children come next; completed or stopped history comes last. Name completion is fuzzy. Each task or resumed turn shows its actual provider/model and thinking level from the worker's session, not the parent's settings. Selected presets also appear as an intelligence label, kept separately for each run. Missing historical model/thinking metadata appears as `unknown`.
|
|
132
140
|
|
|
133
141
|
[Model presets](docs/configuration.md#caller-selected-intelligence) show labels such as `Nicolas (Junior/code-writer)` in regular tool results. One enabled preset applies automatically to new launches without exposing an `intelligence` argument. Two or more require an explicit `intelligence` choice on every launch item. Omitted or `null` choices reject the whole launch batch before any worker starts. Zero or disabled presets keep the existing launch defaults and show no intelligence label. Without an agent type, labels show `Nicolas (Junior)`; without either qualifier, they show just `Nicolas`. `message_subagent` does not accept `intelligence`; workers retain the original effective model, thinking, and label, even after configuration or parent settings change.
|
|
134
142
|
|
package/docs/sessions.md
CHANGED
|
@@ -6,7 +6,7 @@ Workers run asynchronously. Budget reservations and lifetime descendant-cap sema
|
|
|
6
6
|
|
|
7
7
|
`subagents` returns `started` immediately and runs workers in the background. Each worker's completion arrives as steering to its lead and wakes the lead if idle. The launch acknowledgement is not a final result.
|
|
8
8
|
|
|
9
|
-
Workers keep durable names and saved sessions after completing a turn. `message_subagent(name, message, max_subagents_allowed?)` steers a running worker or resumes an idle worker with its saved context. It returns without waiting for completion. A running worker receives steering rather than a second concurrent turn on the same session.
|
|
9
|
+
Workers keep durable names and saved sessions after completing a turn. `message_subagent(name, message, max_subagents_allowed?)` steers a running worker or resumes an idle worker with its saved context. It returns without waiting for completion. A running worker receives steering rather than a second concurrent turn on the same session. Set `name` to an array to contact several workers with one message. The registered schema uses arrays, including for one recipient; older single-name string calls are normalized automatically. Recipients receive only the message text. Failures are reported individually, and an optional allowance override applies separately to each recipient.
|
|
10
10
|
|
|
11
11
|
A child can call `message_lead_agent(message)` without blocking. The message becomes lead steering and wakes an idle lead. It does not finish the child's turn or wait for a reply. The lead replies through `message_subagent`.
|
|
12
12
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { readDetailBudget } from "../ui/detail-budget.js";
|
|
1
2
|
import { statSync } from "node:fs";
|
|
2
3
|
import { buildSubagentDetail, findNameRecord, sessionFilesIn, type SubagentDetail } from "../detail.js";
|
|
3
4
|
import { readNamesRegistry, type NamesRegistry, type SubagentNameRecord } from "../names.js";
|
|
@@ -146,7 +147,12 @@ export function registerSubagentExpandCommand(state: ExtensionState): void {
|
|
|
146
147
|
try {
|
|
147
148
|
const sessionDir = resolveDetailSessionDir(state, selected);
|
|
148
149
|
const files = sessionFilesIn(sessionDir);
|
|
149
|
-
const signature = JSON.stringify([
|
|
150
|
+
const signature = JSON.stringify([
|
|
151
|
+
selected,
|
|
152
|
+
readDetailBudget(selected.budget),
|
|
153
|
+
sessionDir,
|
|
154
|
+
files.map((file) => [file, fileSignature(file)]),
|
|
155
|
+
]);
|
|
150
156
|
const key = selected.name.toLowerCase();
|
|
151
157
|
const cached = detailCache.get(key);
|
|
152
158
|
let detail = cached?.signature === signature ? cached.detail : undefined;
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { Container } from "@earendil-works/pi-tui";
|
|
2
|
+
import type { ToolDefinition } from "@earendil-works/pi-coding-agent";
|
|
3
|
+
import { buildSubagentDetails, DEFAULT_DELEGATION_MODE } from "../types.js";
|
|
4
|
+
import { isRecord } from "../types/records.js";
|
|
5
|
+
import { renderMessageResult } from "../render.js";
|
|
6
|
+
import { MessageSubagentParams, SingleMessageSubagentParams, validatePreparedArguments } from "./schemas.js";
|
|
7
|
+
import type { ExtensionState } from "./state.js";
|
|
8
|
+
|
|
9
|
+
type SingleTool = ToolDefinition<typeof SingleMessageSubagentParams>;
|
|
10
|
+
|
|
11
|
+
/** Fan out locally. Recipient names never become part of a child's prompt. */
|
|
12
|
+
export function registerMessageBatchTool(state: ExtensionState, single: SingleTool): void {
|
|
13
|
+
state.pi.registerTool({
|
|
14
|
+
...single,
|
|
15
|
+
parameters: MessageSubagentParams,
|
|
16
|
+
description: `${single.description}\nname accepts one name or an array of names to receive the same message concurrently. Each receives only the message, not the recipient list. Duplicate names are contacted once. Optional max_subagents_allowed applies separately to each recipient. Delivery failures are reported per recipient; other deliveries are not rolled back.`,
|
|
17
|
+
prepareArguments(args) {
|
|
18
|
+
if (!isRecord(args)) return validatePreparedArguments(MessageSubagentParams, args);
|
|
19
|
+
const normalized: Record<string, unknown> = {
|
|
20
|
+
...args,
|
|
21
|
+
name: typeof args.name === "string" ? [args.name] : args.name,
|
|
22
|
+
};
|
|
23
|
+
if (normalized.max_subagents_allowed === null) delete normalized.max_subagents_allowed;
|
|
24
|
+
return validatePreparedArguments(MessageSubagentParams, normalized);
|
|
25
|
+
},
|
|
26
|
+
async execute(id, params, signal, onUpdate, ctx) {
|
|
27
|
+
if (!Array.isArray(params?.name))
|
|
28
|
+
return single.execute(id, { ...params, name: params?.name }, signal, onUpdate, ctx);
|
|
29
|
+
try {
|
|
30
|
+
const validated = validatePreparedArguments(MessageSubagentParams, params);
|
|
31
|
+
const names = [...new Set(validated.name)];
|
|
32
|
+
if (names.length === 1) return single.execute(id, { ...validated, name: names[0] }, signal, onUpdate, ctx);
|
|
33
|
+
const results = await Promise.all(
|
|
34
|
+
names.map(async (name, index) => {
|
|
35
|
+
const childId = `${id}/recipient-${index}`;
|
|
36
|
+
try {
|
|
37
|
+
return await single.execute(childId, { ...validated, name }, signal, undefined, ctx);
|
|
38
|
+
} finally {
|
|
39
|
+
state.forcedErrorToolCallIds.delete(childId);
|
|
40
|
+
}
|
|
41
|
+
}),
|
|
42
|
+
);
|
|
43
|
+
const recipients = results.map((result, index) => ({
|
|
44
|
+
...(isRecord(result.details) && isRecord(result.details.recipient) ? result.details.recipient : {}),
|
|
45
|
+
name: names[index],
|
|
46
|
+
isError: Reflect.get(result, "isError") === true,
|
|
47
|
+
status: result.content
|
|
48
|
+
.filter((part) => part.type === "text")
|
|
49
|
+
.map((part) => part.text)
|
|
50
|
+
.join("\n"),
|
|
51
|
+
}));
|
|
52
|
+
const isError = recipients.some((recipient) => recipient.isError);
|
|
53
|
+
if (isError) state.forcedErrorToolCallIds.add(id);
|
|
54
|
+
return {
|
|
55
|
+
content: [
|
|
56
|
+
{ type: "text", text: recipients.map((recipient) => `${recipient.name}: ${recipient.status}`).join("\n") },
|
|
57
|
+
],
|
|
58
|
+
details: Object.assign(buildSubagentDetails("parallel", DEFAULT_DELEGATION_MODE, null, []), { recipients }),
|
|
59
|
+
...(isError ? { isError: true } : {}),
|
|
60
|
+
};
|
|
61
|
+
} catch (error) {
|
|
62
|
+
state.forcedErrorToolCallIds.add(id);
|
|
63
|
+
return {
|
|
64
|
+
content: [{ type: "text", text: error instanceof Error ? error.message : String(error) }],
|
|
65
|
+
details: buildSubagentDetails("parallel", DEFAULT_DELEGATION_MODE, null, []),
|
|
66
|
+
isError: true,
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
renderCall(args, theme, context) {
|
|
71
|
+
if (!Array.isArray(args.name)) {
|
|
72
|
+
const singleArgs = { ...args, name: args.name };
|
|
73
|
+
return single.renderCall!(singleArgs, theme, { ...context, args: singleArgs });
|
|
74
|
+
}
|
|
75
|
+
const container = new Container();
|
|
76
|
+
const caches = (context.state.recipientStates ??= new Map());
|
|
77
|
+
for (const name of new Set(args.name)) {
|
|
78
|
+
if (!caches.has(name)) caches.set(name, {});
|
|
79
|
+
const singleArgs = { ...args, name };
|
|
80
|
+
container.addChild(
|
|
81
|
+
single.renderCall!(singleArgs, theme, { ...context, args: singleArgs, state: caches.get(name) }),
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
return container;
|
|
85
|
+
},
|
|
86
|
+
renderResult(result, options, theme, context) {
|
|
87
|
+
if (!Array.isArray(context.args.name) || (isRecord(result.details) && isRecord(result.details.recipient))) {
|
|
88
|
+
return single.renderResult!(result, options, theme, {
|
|
89
|
+
...context,
|
|
90
|
+
args: { ...context.args, name: Array.isArray(context.args.name) ? context.args.name[0] : context.args.name },
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
const recipients =
|
|
94
|
+
isRecord(result.details) && Array.isArray(result.details.recipients) ? result.details.recipients : [];
|
|
95
|
+
if (!recipients.length)
|
|
96
|
+
return renderMessageResult(result, options.expanded, theme, {
|
|
97
|
+
...context,
|
|
98
|
+
args: { message: context.args.message },
|
|
99
|
+
});
|
|
100
|
+
const container = new Container();
|
|
101
|
+
for (const recipient of recipients) {
|
|
102
|
+
if (!isRecord(recipient)) continue;
|
|
103
|
+
container.addChild(
|
|
104
|
+
renderMessageResult(
|
|
105
|
+
{
|
|
106
|
+
content: [
|
|
107
|
+
{
|
|
108
|
+
type: "text",
|
|
109
|
+
text: `${recipient.isError === true ? `${recipient.name}: ` : ""}${typeof recipient.status === "string" ? recipient.status : ""}`,
|
|
110
|
+
},
|
|
111
|
+
],
|
|
112
|
+
details: { recipient },
|
|
113
|
+
},
|
|
114
|
+
options.expanded,
|
|
115
|
+
theme,
|
|
116
|
+
{
|
|
117
|
+
...context,
|
|
118
|
+
args: { name: typeof recipient.name === "string" ? recipient.name : "", message: context.args.message },
|
|
119
|
+
isError: recipient.isError === true,
|
|
120
|
+
},
|
|
121
|
+
),
|
|
122
|
+
);
|
|
123
|
+
}
|
|
124
|
+
return container;
|
|
125
|
+
},
|
|
126
|
+
});
|
|
127
|
+
}
|
|
@@ -25,18 +25,19 @@ import { executeParallel } from "./execution.js";
|
|
|
25
25
|
import { resumableSubagentsDisabled } from "./policy.js";
|
|
26
26
|
import { trackProgress } from "./progress.js";
|
|
27
27
|
import { ensureBudget } from "./runtime.js";
|
|
28
|
-
import { MessageSubagentParams, validatePreparedArguments } from "./schemas.js";
|
|
28
|
+
import { SingleMessageSubagentParams as MessageSubagentParams, validatePreparedArguments } from "./schemas.js";
|
|
29
|
+
import { registerMessageBatchTool } from "./message-batch.js";
|
|
29
30
|
import type { ExtensionState } from "./state.js";
|
|
30
31
|
|
|
31
32
|
export function registerMessageSubagentTool(state: ExtensionState) {
|
|
32
33
|
if (resumableSubagentsDisabled(state.settings) && !state.resumeToolRegistered) return;
|
|
33
34
|
state.resumeToolRegistered = true;
|
|
34
|
-
state
|
|
35
|
+
registerMessageBatchTool(state, {
|
|
35
36
|
name: "message_subagent",
|
|
36
37
|
label: "Message subagent",
|
|
37
38
|
description:
|
|
38
39
|
state.configuredToolPrompts.message_subagent ??
|
|
39
|
-
"Send
|
|
40
|
+
"Send the same message to one or more named subagents. Running subagents are steered; idle subagents resume with their saved context and original model settings. Returns without waiting for completion. Optional max_subagents_allowed replaces its lifetime descendant cap without resetting spending or refunding reserved slots. Omit to retain its allowance.",
|
|
40
41
|
parameters: MessageSubagentParams,
|
|
41
42
|
prepareArguments: (args) => {
|
|
42
43
|
if (args && typeof args === "object" && "max_subagents_allowed" in args && args.max_subagents_allowed === null) {
|
package/extension/prompt-hook.ts
CHANGED
|
@@ -49,7 +49,7 @@ ${
|
|
|
49
49
|
|
|
50
50
|
Launches return immediately with durable worker names. Each worker's completion arrives as a steering message, waking you if idle. Keep working rather than waiting on the launch tool.
|
|
51
51
|
|
|
52
|
-
Use \`message_subagent\` with { "name": "John", "message": "Now also update the tests." } to steer a running worker or wake an idle worker with its saved context and original model settings.
|
|
52
|
+
Use \`message_subagent\` with { "name": "John", "message": "Now also update the tests." } to steer a running worker or wake an idle worker with its saved context and original model settings. Set "name" to an array, e.g. ["John", "Maria"], to send the same message to several workers concurrently. Each recipient sees only the message, never the recipient list.
|
|
53
53
|
|
|
54
54
|
Optional \`max_subagents_allowed\` changes the lifetime descendant cap without resetting spending. Omit it to keep the current allowance. Increases reserve slots from the original launcher; decreases do not refund slots. Names survive restarts.
|
|
55
55
|
|
package/extension/schemas.ts
CHANGED
|
@@ -68,7 +68,7 @@ export const ResumeSubagentsParams = Type.Object(
|
|
|
68
68
|
{ additionalProperties: false },
|
|
69
69
|
);
|
|
70
70
|
|
|
71
|
-
export const
|
|
71
|
+
export const SingleMessageSubagentParams = Type.Object(
|
|
72
72
|
{
|
|
73
73
|
name: Type.String({ minLength: 1, pattern: "\\S", description: "Name returned by a previous subagents run." }),
|
|
74
74
|
message: Type.String({
|
|
@@ -82,6 +82,18 @@ export const MessageSubagentParams = Type.Object(
|
|
|
82
82
|
{ additionalProperties: false },
|
|
83
83
|
);
|
|
84
84
|
|
|
85
|
+
export const MessageSubagentParams = Type.Object(
|
|
86
|
+
{
|
|
87
|
+
...SingleMessageSubagentParams.properties,
|
|
88
|
+
name: Type.Array(SingleMessageSubagentParams.properties.name, {
|
|
89
|
+
minItems: 1,
|
|
90
|
+
description:
|
|
91
|
+
"Names receiving the same message. Use a one-element array for one recipient. Legacy single-name strings are also accepted. Recipients see only the message, not the list.",
|
|
92
|
+
}),
|
|
93
|
+
},
|
|
94
|
+
{ additionalProperties: false },
|
|
95
|
+
);
|
|
96
|
+
|
|
85
97
|
export function createIntelligenceSchemas(
|
|
86
98
|
presets: IntelligencePreset[] = [],
|
|
87
99
|
settings?: SubagentSettings,
|
package/package.json
CHANGED
package/runner/single.ts
CHANGED
|
@@ -163,7 +163,7 @@ export async function runAgentSubprocess(opts: RunAgentOptions): Promise<SingleR
|
|
|
163
163
|
opts.settings,
|
|
164
164
|
);
|
|
165
165
|
const prompt =
|
|
166
|
-
result.budget && readBudget(result.budget).limit > 0
|
|
166
|
+
opts.rawPrompt !== true && result.budget && readBudget(result.budget).limit > 0
|
|
167
167
|
? `${taskPrompt}\n\n${budgetPrompt(result.budget)}`
|
|
168
168
|
: taskPrompt;
|
|
169
169
|
let wasAborted = false;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { readBudget, type SubagentBudget } from "../budget.js";
|
|
2
|
+
|
|
3
|
+
export interface DetailBudget {
|
|
4
|
+
allowed: number;
|
|
5
|
+
used: number;
|
|
6
|
+
remaining: number;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/** Read only the selected agent's ledger, never walk its descendants. */
|
|
10
|
+
export function readDetailBudget(budget?: SubagentBudget): DetailBudget | undefined {
|
|
11
|
+
if (!budget) return undefined;
|
|
12
|
+
try {
|
|
13
|
+
const { limit, remaining } = readBudget(budget);
|
|
14
|
+
return { allowed: limit, used: limit - remaining, remaining };
|
|
15
|
+
} catch {
|
|
16
|
+
return undefined;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function detailBudgetLine(budget?: DetailBudget): string {
|
|
21
|
+
return budget
|
|
22
|
+
? `Subagent budget: ${budget.allowed} allowed • ${budget.used} used/reserved • ${budget.remaining} remaining`
|
|
23
|
+
: "Subagent budget: unknown";
|
|
24
|
+
}
|
package/ui/detail-lines.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { detailBudgetLine } from "./detail-budget.js";
|
|
1
2
|
import { truncateToWidth, visibleWidth, wrapTextWithAnsi } from "@earendil-works/pi-tui";
|
|
2
3
|
import { RESUME_SUBAGENTS_TOOL_NAME } from "../types.js";
|
|
3
4
|
import { displayIntelligence } from "../intelligence.js";
|
|
@@ -85,6 +86,7 @@ export function renderTurnOverviewLines(
|
|
|
85
86
|
.filter(Boolean)
|
|
86
87
|
.join(" • ");
|
|
87
88
|
out.wrap(meta, "", "dim");
|
|
89
|
+
out.wrap(detailBudgetLine(detail.budget), "", "accent");
|
|
88
90
|
out.wrap(
|
|
89
91
|
`Model: ${block.model ?? "unknown"} • Thinking: ${block.thinkingLevel ?? "unknown"}${block.intelligence ? ` • Intelligence: ${displayIntelligence(block.intelligence)}` : ""}`,
|
|
90
92
|
"",
|
|
@@ -254,6 +256,7 @@ export function renderActivityLines(detail: SubagentDetail, width: number, theme
|
|
|
254
256
|
"",
|
|
255
257
|
"dim",
|
|
256
258
|
);
|
|
259
|
+
out.wrap(detailBudgetLine(detail.budget), "", "accent");
|
|
257
260
|
out.wrap(`session total: ${usageLine(detail.usage)}`, "", "dim");
|
|
258
261
|
for (const note of detail.notes) out.wrap(note, "", "warning");
|
|
259
262
|
if (tools.length) out.wrap("Press T to inspect tools across all messages", "", "muted");
|
package/ui/detail-model.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { DetailBudget } from "./detail-budget.js";
|
|
2
|
+
|
|
1
3
|
export interface DetailChildRef {
|
|
2
4
|
name?: string;
|
|
3
5
|
agent: string;
|
|
@@ -43,6 +45,7 @@ export interface SubagentDetail {
|
|
|
43
45
|
model?: string;
|
|
44
46
|
thinkingLevel?: string;
|
|
45
47
|
tools?: string[];
|
|
48
|
+
budget?: DetailBudget;
|
|
46
49
|
createdAt?: number;
|
|
47
50
|
sessionDir: string;
|
|
48
51
|
sessionFile?: string;
|
package/ui/detail-transcript.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { readDetailBudget } from "./detail-budget.js";
|
|
1
2
|
import { sessionFilesIn, readSessionEntries } from "./session.js";
|
|
2
3
|
import { SUBAGENT_INTELLIGENCE_CUSTOM_TYPE } from "../intelligence.js";
|
|
3
4
|
export { sessionFilesIn, readSessionMessages } from "./session.js";
|
|
@@ -40,7 +41,7 @@ export function describeToolArgs(toolName: string, rawArgs: unknown): string {
|
|
|
40
41
|
};
|
|
41
42
|
switch (toolName) {
|
|
42
43
|
case "message_subagent":
|
|
43
|
-
return `${clip(args.name, 40)}: ${clip(args.message, 120)}`;
|
|
44
|
+
return `${clip(Array.isArray(args.name) ? args.name.filter((name) => typeof name === "string").join(", ") : args.name, 40)}: ${clip(args.message, 120)}`;
|
|
44
45
|
case "message_lead_agent":
|
|
45
46
|
return clip(args.message, 120);
|
|
46
47
|
case "bash":
|
|
@@ -292,6 +293,7 @@ export function buildSubagentDetail(record: SubagentNameRecord, options: { sessi
|
|
|
292
293
|
model,
|
|
293
294
|
thinkingLevel,
|
|
294
295
|
tools: record.tools,
|
|
296
|
+
budget: readDetailBudget(record.budget),
|
|
295
297
|
createdAt: record.createdAt,
|
|
296
298
|
sessionDir,
|
|
297
299
|
sessionFile,
|
package/ui/tree-live.ts
CHANGED
|
@@ -40,7 +40,10 @@ function formatToolArgPreview(toolName: unknown, rawArgs: unknown): string {
|
|
|
40
40
|
.join(", ");
|
|
41
41
|
}
|
|
42
42
|
case "message_subagent":
|
|
43
|
-
return truncateTo(
|
|
43
|
+
return truncateTo(
|
|
44
|
+
`${Array.isArray(args.name) ? args.name.map((name) => stringValue(name)).join(", ") : stringValue(args.name)}: ${stringValue(args.message).replace(/\s+/g, " ").trim()}`,
|
|
45
|
+
80,
|
|
46
|
+
);
|
|
44
47
|
case "message_lead_agent":
|
|
45
48
|
return truncateTo(stringValue(args.message).replace(/\s+/g, " ").trim(), 80);
|
|
46
49
|
case "resume_subagents": {
|