fix: wire onToolResult callback for verbose tool summaries

HOTFIX: Tool summaries were not being sent to chat channels when verbose mode
was enabled. The onToolResult callback was defined in the types but never
wired up in dispatch-from-config.ts.

This adds the missing callback alongside onBlockReply, using the same
dispatcher.sendBlockReply() path to deliver tool summaries to WhatsApp,
Telegram, and other chat channels.

Fixes verbose tool summaries not appearing in WhatsApp despite /verbose on.
This commit is contained in:
Adam Holt 2026-01-26 01:37:26 +00:00
parent 8f6542409a
commit 45f65a478b

View File

@ -288,6 +288,16 @@ export async function dispatchReplyFromConfig(params: {
};
return run();
},
onToolResult: (payload: ReplyPayload) => {
const run = async () => {
if (shouldRouteToOriginating) {
await sendPayloadAsync(payload, undefined, false);
} else {
dispatcher.sendBlockReply(payload);
}
};
return run();
},
},
cfg,
);