← Back to PRs

#19776: feat(telegram): send error/verbose replies silently (disable_notification)

by auspic7 open 2026-02-18 04:56 View on GitHub →
channel: telegram app: macos size: S
## Summary When a reply has `isError=true`, pass `silent:true` through the delivery pipeline so Telegram sends it with `disable_notification`, avoiding notification sounds for tool error warnings and verbose output. ## Changes - **bot-message-dispatch.ts**: pass `silent` flag based on `payload.isError` - **bot/delivery.ts**: thread `silent` option through all send paths (`sendTelegramText`, `buildTelegramSendParams`, voice fallback) - **Tests**: added for both dispatch and delivery layers ## Motivation Tool error warnings (`⚠️ ... failed`) and verbose output trigger the same notification sound as regular messages, which is disruptive. These secondary messages should be sent silently. Relates to #19711 <!-- greptile_comment --> <h3>Greptile Summary</h3> Adds `silent` (Telegram `disable_notification`) support for error/verbose replies in the Telegram delivery pipeline. When a reply has `isError=true`, the dispatch layer sets `silent: true`, which is threaded through `deliverReplies` → `sendTelegramText` / `buildTelegramSendParams` / voice fallback paths. Tests cover both the dispatch-layer flag mapping and the delivery-layer `disable_notification` output. - One send path was missed: the `pendingFollowUpText` branch (media caption overflow, `delivery.ts:288`) does not pass `silent` to `sendTelegramText`, so follow-up text for media-with-long-caption error replies will still produce a notification. <h3>Confidence Score: 4/5</h3> - This PR is safe to merge with one minor missed send path that should be addressed. - The change is straightforward feature plumbing — threading a boolean flag through existing send functions. The logic is correct across all paths except one (`pendingFollowUpText`). Tests are present for both layers. The missed path is an edge case (error reply with media whose caption overflows) that is unlikely to occur frequently but should still be fixed for completeness. - src/telegram/bot/delivery.ts — the `pendingFollowUpText` send path at line 288 is missing the `silent` parameter. <sub>Last reviewed commit: 0884c0f</sub> <!-- greptile_other_comments_section --> <sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub> <!-- /greptile_comment -->

Most Similar PRs