feat(web): toggle tool summaries mid-run

This commit is contained in:
Peter Steinberger
2025-12-20 13:52:04 +00:00
parent 70faa4ff36
commit e1b8c30163
4 changed files with 150 additions and 5 deletions

View File

@@ -217,6 +217,7 @@ export async function runEmbeddedPiAgent(params: {
timeoutMs: number;
runId: string;
abortSignal?: AbortSignal;
shouldEmitToolResult?: () => boolean;
onPartialReply?: (payload: {
text?: string;
mediaUrls?: string[];
@@ -419,7 +420,11 @@ export async function runEmbeddedPiAgent(params: {
isError,
},
});
if (params.verboseLevel === "on" && params.onToolResult) {
const emitToolResult =
typeof params.shouldEmitToolResult === "function"
? params.shouldEmitToolResult()
: params.verboseLevel === "on";
if (emitToolResult && params.onToolResult) {
const agg = formatToolAggregate(
toolName,
meta ? [meta] : undefined,