fix: wire onToolResult to dispatcher for verbose tool summaries

Previously, onToolResult was not connected in dispatchReplyFromConfig,
causing verbose tool summaries to not be sent to messaging channels.
This adds the missing onToolResult handler similar to onBlockReply.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
LinghaoZhuang 2026-01-27 14:52:54 +00:00
parent 3f83afe4a6
commit cfa8f6a49f

View File

@ -276,6 +276,13 @@ export async function dispatchReplyFromConfig(params: {
ctx,
{
...params.replyOptions,
onToolResult: (payload: ReplyPayload) => {
if (shouldRouteToOriginating) {
void sendPayloadAsync(payload, undefined, false);
} else {
dispatcher.sendToolResult(payload);
}
},
onBlockReply: (payload: ReplyPayload, context) => {
const run = async () => {
// Accumulate block text for TTS generation after streaming