Skip to Content
MessagingGraceful Degradation

Graceful Degradation

A core principle of msend is that your agent code should never need channel-specific conditionals. Each channel adapter declares its capabilities and degrades unsupported parts in a defined way instead of failing silently.

How Adapters Handle Unsupported Parts

PartEmailSlackWhatsApp
textPlain + HTMLmrkdwnText (link previews off)
image, file, audio, videoMIME attachmentExternal file uploadNative Cloud API media
buttonsRendered as textBlock Kit buttonsReply buttons (1–3) or List message (4–10)
listRendered as textRendered as textNative List message (up to 10)
locationRendered as textRendered as textNative location message
reactionNot supported (unsupported_content)Emoji reaction (:name: or emoji)Emoji reaction
templateRefused (never degraded to plain text)Refused (never degraded to plain text)Native Meta template

Templates never degrade to plain text: A template part is only valid on channels that support templates (WhatsApp). Sending a template part on Email or Slack fails explicitly rather than leaking raw template metadata as text.

Button & List Limits

  • On WhatsApp, a buttons part with 1 to 3 items becomes native reply buttons; 4 to 10 items becomes a native WhatsApp list message; more than 10 fails with a clear error.
  • When a user taps a button or list item on Slack or WhatsApp, msend normalizes the callback into a standard message.received event where message.text is the button title and message.metadata.button_id is the button’s ID.
Last updated on