feat(progress): humanize subagent updates
This commit is contained in:
@@ -9,6 +9,7 @@ import {
|
||||
type SubagentRunResult,
|
||||
type SubagentToolDetails,
|
||||
} from "./schema.ts";
|
||||
import { createProgressFormatter } from "./progress.mjs";
|
||||
|
||||
const MAX_PARALLEL_TASKS = 8;
|
||||
const MAX_CONCURRENCY = 4;
|
||||
@@ -141,11 +142,15 @@ export function createSubagentTool(deps: {
|
||||
topLevelModel: params.model,
|
||||
});
|
||||
|
||||
const progressFormatter = createProgressFormatter();
|
||||
|
||||
return deps.runSingleTask?.({
|
||||
cwd: input.cwd ?? ctx.cwd,
|
||||
onEvent(event) {
|
||||
const text = progressFormatter.format(event);
|
||||
if (!text) return;
|
||||
onUpdate?.({
|
||||
content: [{ type: "text", text: `Running subagent: ${event.type}` }],
|
||||
content: [{ type: "text", text }],
|
||||
details: makeDetails(input.mode, []),
|
||||
});
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user