diff --git a/docs/tools/thinking.md b/docs/tools/thinking.md index 40f358041..1ee029401 100644 --- a/docs/tools/thinking.md +++ b/docs/tools/thinking.md @@ -39,7 +39,7 @@ read_when: - Inline directive affects only that message; session/global defaults apply otherwise. - Send `/verbose` (or `/verbose:`) with no argument to see the current verbose level. - When verbose is on, agents that emit structured tool results (Pi, other JSON agents) send each tool call back as its own metadata-only message, prefixed with ` : ` when available (path/command). These tool summaries are sent as soon as each tool starts (separate bubbles), not as streaming deltas. -- When verbose is `full`, exec/process tool outputs are also forwarded after completion (separate bubble, truncated to a safe length). If you toggle `/verbose on|full|off` while a run is in-flight, subsequent tool bubbles honor the new setting. +- When verbose is `full`, tool outputs are also forwarded after completion (separate bubble, truncated to a safe length). If you toggle `/verbose on|full|off` while a run is in-flight, subsequent tool bubbles honor the new setting. ## Reasoning visibility (/reasoning) - Levels: `on|off|stream`. diff --git a/src/agents/pi-embedded-subscribe.handlers.tools.ts b/src/agents/pi-embedded-subscribe.handlers.tools.ts index 206ce4962..5d1f235a6 100644 --- a/src/agents/pi-embedded-subscribe.handlers.tools.ts +++ b/src/agents/pi-embedded-subscribe.handlers.tools.ts @@ -12,8 +12,6 @@ import { } from "./pi-embedded-subscribe.tools.js"; import { inferToolMetaFromArgs } from "./pi-embedded-utils.js"; -const TOOL_OUTPUT_ALLOWLIST = new Set(["exec", "bash", "process"]); - function extendExecMeta(toolName: string, args: unknown, meta?: string): string | undefined { const normalized = toolName.trim().toLowerCase(); if (normalized !== "exec" && normalized !== "bash") return meta; @@ -202,11 +200,7 @@ export function handleToolExecutionEnd( `embedded run tool end: runId=${ctx.params.runId} tool=${toolName} toolCallId=${toolCallId}`, ); - if ( - ctx.params.onToolResult && - ctx.shouldEmitToolOutput() && - TOOL_OUTPUT_ALLOWLIST.has(toolName.trim().toLowerCase()) - ) { + if (ctx.params.onToolResult && ctx.shouldEmitToolOutput()) { const outputText = extractToolResultText(sanitizedResult); if (outputText) { ctx.emitToolOutput(toolName, meta, outputText); diff --git a/src/agents/pi-embedded-subscribe.subscribe-embedded-pi-session.waits-multiple-compaction-retries-before-resolving.test.ts b/src/agents/pi-embedded-subscribe.subscribe-embedded-pi-session.waits-multiple-compaction-retries-before-resolving.test.ts index 7407a3581..06b45160d 100644 --- a/src/agents/pi-embedded-subscribe.subscribe-embedded-pi-session.waits-multiple-compaction-retries-before-resolving.test.ts +++ b/src/agents/pi-embedded-subscribe.subscribe-embedded-pi-session.waits-multiple-compaction-retries-before-resolving.test.ts @@ -178,5 +178,19 @@ describe("subscribeEmbeddedPiSession", () => { const output = onToolResult.mock.calls[1][0]; expect(output.text).toContain("hello"); expect(output.text).toContain("```txt"); + + handler?.({ + type: "tool_execution_end", + toolName: "read", + toolCallId: "tool-read-1", + isError: false, + result: { content: [{ type: "text", text: "file data" }] }, + }); + + await Promise.resolve(); + + expect(onToolResult).toHaveBeenCalledTimes(3); + const readOutput = onToolResult.mock.calls[2][0]; + expect(readOutput.text).toContain("file data"); }); });