Skip to content

fix(telegram): wire sendPayload into extension outbound (approval buttons render)#459

Merged
webdevtodayjason merged 1 commit into
devfrom
fix/telegram-outbound-sendpayload-buttons
Jun 16, 2026
Merged

fix(telegram): wire sendPayload into extension outbound (approval buttons render)#459
webdevtodayjason merged 1 commit into
devfrom
fix/telegram-outbound-sendpayload-buttons

Conversation

@webdevtodayjason

Copy link
Copy Markdown
Contributor

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 its outbound adapter had only sendText/sendMediano sendPayload. deliver.ts only routes channelData.telegram.buttons when handler.sendPayload exists; without it, delivery fell back to sendText and dropped the inline keyboard. The full sendPayload lived only in src/channels/plugins/outbound/telegram.ts, which is imported solely by tests. A direct Telegram API call with reply_markup rendered buttons fine, isolating the bug to this missing wiring.

Fix

Add sendPayload to the extension outbound, routing channelData.telegram.buttons through sendMessageTelegram's buttonsreply_markup path (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

…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>
@coderabbitai

coderabbitai Bot commented Jun 16, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: cb95ffc2-9868-4661-8487-30f3ec540c21

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/telegram-outbound-sendpayload-buttons

Comment @coderabbitai help to get the list of available commands and usage tips.

@webdevtodayjason
webdevtodayjason merged commit 0f266e8 into dev Jun 16, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant