#2805: fix: wire onToolResult to dispatcher for verbose tool summaries
Cluster:
Tool Result Handling Improvements
## Summary
- Previously, `onToolResult` was not connected in `dispatchReplyFromConfig`, causing verbose tool summaries to not be sent to messaging channels like Telegram
- This adds the missing `onToolResult` handler similar to `onBlockReply`
## Test plan
- [x] Enable verbose mode in Telegram with `/verbose full`
- [x] Send a message that triggers tool calls
- [x] Verify tool result summaries are now visible in the chat
🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This change updates `dispatchReplyFromConfig` to properly forward `onToolResult` callbacks through the configured `ReplyDispatcher`, matching the existing `onBlockReply` wiring so verbose tool-result summaries can reach external messaging channels (e.g., Telegram). It also introduces block-text accumulation to synthesize a TTS-only final audio reply when streaming completes without a final payload, using `resolveTtsConfig`/`maybeApplyTtsToPayload` to keep behavior consistent with existing TTS routing logic.
Overall, the PR focuses on improving reply dispatch plumbing so tool and block outputs are routed either via `routeReply` (cross-provider/originating channel) or via the dispatcher, and ensures TTS still works in streaming-only scenarios.
<h3>Confidence Score: 4/5</h3>
- Mostly safe to merge, but there is a small async-ordering issue in the new onToolResult routing path.
- The change is localized and follows existing patterns for block replies, but `onToolResult` currently fire-and-forgets an async route which can reorder or drop tool-result summaries relative to `waitForIdle()` and subsequent sends.
- src/auto-reply/reply/dispatch-from-config.ts
<!-- greptile_other_comments_section -->
<sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub>
**Context used:**
- Context from `dashboard` - CLAUDE.md ([source](https://app.greptile.com/review/custom-context?memory=fd949e91-5c3a-4ab5-90a1-cbe184fd6ce8))
- Context from `dashboard` - AGENTS.md ([source](https://app.greptile.com/review/custom-context?memory=0d0c8278-ef8e-4d6c-ab21-f5527e322f13))
<!-- /greptile_comment -->
Most Similar PRs
#9171: Fix: Route tool result deliveries through BlockReplyPipeline for pr...
by vishaltandale00 · 2026-02-04
83.4%
#15864: feat: add deliverOnlyToolMessages config for clean messaging channe...
by gandalf-the-engineer · 2026-02-14
82.7%
#8753: fix(telegram): add config option to disable acknowledgments
by revenuestack · 2026-02-04
81.2%
#2917: Slack: fix thread context + prevent reply spillover
by SocialNerd42069 · 2026-01-27
80.0%
#22886: fix: await onBlockReplyFlush before tool execution to preserve mess...
by botverse · 2026-02-21
79.6%
#18187: fix: tool summaries silently dropped when reasoningLevel is stream
by ayanesakura · 2026-02-16
79.4%
#6819: fix(tui): handle unstructured tool results and errors in tool execu...
by TreyDong · 2026-02-02
78.4%
#15996: fix(agents): messages arrive out of order — tool output beats narra...
by yinghaosang · 2026-02-14
78.3%
#11825: fix: keep tool_use/tool_result pairs together during session compac...
by C31gordon · 2026-02-08
77.9%
#19632: fix: suppressToolErrors now suppresses exec tool failure notifications
by Gitjay11 · 2026-02-18
76.7%