diff --git a/changelog.md b/changelog.md index bdf33e5..0bc271b 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,11 @@ # Changelog +## 2026-03-06 - 3.0.2 - fix(agent) +use output parameter when invoking onToolResult instead of toolCall.result + +- Replace (toolCall as any).result with the explicit output parameter when calling options.onToolResult. +- Prevents undefined/misread results by aligning the callback with the tool runner's output signature. + ## 2026-03-06 - 3.0.1 - fix(readme) adjust ASCII art in README to fix box widths and spacing in agent diagram diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index ade0180..83fa11b 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@push.rocks/smartagent', - version: '3.0.1', + version: '3.0.2', description: 'Agentic loop for ai-sdk (Vercel AI SDK). Wraps streamText with stopWhen for parallel multi-step tool execution. Built on @push.rocks/smartai.' } diff --git a/ts/smartagent.classes.agent.ts b/ts/smartagent.classes.agent.ts index 2849a85..665017c 100644 --- a/ts/smartagent.classes.agent.ts +++ b/ts/smartagent.classes.agent.ts @@ -142,8 +142,8 @@ export async function runAgent(options: IAgentRunOptions): Promise { - options.onToolResult!(toolCall.toolName, (toolCall as any).result); + ? ({ toolCall, output }) => { + options.onToolResult!(toolCall.toolName, output); } : undefined,