#22489: fix(telegram): wire up poll action in dispatch
agents
size: S
Cluster:
Telegram Poll Action Enhancements
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
#22690: fix: wire up Telegram poll action in provider dispatch
by sleitor · 2026-02-21
91.8%
#17441: feat(telegram): add poll action support
by iacosta3994 · 2026-02-15
91.6%
#20511: fix: register poll action gate for Telegram adapter (#17528)
by echoVic · 2026-02-19
87.8%
#17894: fix(telegram): add missing poll action gate with input validation
by PlayerGhost · 2026-02-16
87.7%
#17723: Telegram actions: let poll fall back to core sender
by clzoc · 2026-02-16
84.3%
#17357: feat(telegram): implement telegram poll action,persistent answer ro...
by akyourowngames · 2026-02-15
78.7%
#3186: fix(telegram): sanitize update offset + lock polling
by daxiong888 · 2026-01-28
77.0%
#17294: docs(telegram): add poll CLI example and constraints
by ephelia-ai · 2026-02-15
74.3%
#11920: Telegram: create forum topics via message tool (thread-create)
by larsderidder · 2026-02-08
72.8%
#12950: feat: add Telegram pin/unpin message support
by alex-muradov · 2026-02-09
72.3%