fix(telegram): wire sendPayload into extension outbound (approval buttons render)#459
Merged
Merged
Conversation
…ons render The runtime telegram channel plugin (extensions/telegram/src/channel.ts) is the one registered into the active plugin registry, and its outbound adapter had only sendText/sendMedia — no sendPayload. So deliver.ts's `if (handler.sendPayload && payload.channelData)` was false and workflow approval notifications fell back to plain sendText, dropping the inline Approve/Deny keyboard (operator saw button-less text). The full sendPayload lived only in src/channels/plugins/outbound/telegram.ts, which is imported solely by tests. Add sendPayload to the extension outbound, routing channelData.telegram.buttons through sendMessageTelegram's buttons -> reply_markup path (mirrors the canonical adapter). Now cron approvals deliver tappable buttons that the wf_app:/wf_dny: callback handler resolves. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Completes the cron-approval-buttons fix. PRs #457/#458 made the cron notification complete (notification_status='sent') and added the text-reply fallback — but the operator still saw button-less approval messages.
Root cause (verified live)
The telegram plugin actually registered at runtime is
extensions/telegram/src/channel.ts, and itsoutboundadapter had onlysendText/sendMedia— nosendPayload.deliver.tsonly routeschannelData.telegram.buttonswhenhandler.sendPayloadexists; without it, delivery fell back tosendTextand dropped the inline keyboard. The fullsendPayloadlived only insrc/channels/plugins/outbound/telegram.ts, which is imported solely by tests. A direct Telegram API call withreply_markuprendered buttons fine, isolating the bug to this missing wiring.Fix
Add
sendPayloadto the extension outbound, routingchannelData.telegram.buttonsthroughsendMessageTelegram'sbuttons→reply_markuppath (mirrors the canonical adapter + media-first-button handling).Tests
extensions/telegram/src/channel.sendpayload.test.ts(3 cases): sendPayload implemented; forwards buttons to the send call; omits when no channelData. tsgo 189 (unchanged); oxfmt clean.(Note: the unit vitest config excludes
extensions/**; ran the test directly — green.)🤖 Generated with Claude Code