← Back to PRs

#22489: fix(telegram): wire up poll action in dispatch

by pierreeurope open 2026-02-21 06:54 View on GitHub →
agents size: S
Closes #22422 The Telegram provider has had a full poll implementation (sendPollTelegram) for a while, but the poll action was never registered in the message action adapter, making it unreachable from the message tool. This PR wires it up by: - Adding poll to the listActions return when the polls gate is enabled - Adding a handler in the action dispatcher to parse poll-specific parameters (pollQuestion, pollOption, pollMulti, pollDurationHours, etc.) - Adding a handler in telegram-actions to call sendPollTelegram with the proper parameters Now you can actually use the message tool with action=poll for Telegram channels. <!-- greptile_comment --> <h3>Greptile Summary</h3> Wires up the existing `sendPollTelegram` implementation to the message action dispatcher, enabling poll creation through the message tool with `action=poll`. **Changes:** - Added `poll` action to `listActions` when the `polls` gate is enabled (`telegram.ts:59-61`) - Added dispatcher handler to parse poll-specific parameters (`pollQuestion`, `pollOption`, `pollMulti`, `pollDurationHours`, etc.) and forward to `handleTelegramAction` (`telegram.ts:170-195`) - Added action handler in `telegram-actions.ts` to validate parameters, check gate, and call `sendPollTelegram` (`telegram-actions.ts:325-380`) **Architecture:** The implementation follows existing patterns for other Telegram actions (sticker, edit, delete). Parameters flow through the dispatcher layer which normalizes them before calling the lower-level handler. The handler validates the action is enabled, checks options array structure, and delegates to the existing `sendPollTelegram` function which has comprehensive validation via `normalizePollInput`. **Minor issue:** One unreachable fallback operator (`?? []`) on line 174 of `telegram.ts` where `required: true` makes it unnecessary. <h3>Confidence Score: 5/5</h3> - This PR is safe to merge with minimal risk - The implementation correctly wires up existing, tested functionality (`sendPollTelegram`) following established patterns. All parameters are properly validated through existing helpers, and the action is appropriately gated. The only issue is a minor style concern with an unreachable fallback operator. - No files require special attention <sub>Last reviewed commit: af295d5</sub> <!-- greptile_other_comments_section --> <!-- /greptile_comment -->

Most Similar PRs