Skip to main content
Tell your user (and your operators) when a reply can’t be delivered instead of losing it silently.

Quick Start

1

Turn it on

One boolean flips the feature on. A permanent delivery failure now sends a built-in plain-text notice on the same channel.
2

Customise the notice

Replace the built-in message with your own wording. ${VAR} substitution applies.
3

Route the failure from an Agent

Subscribe to MESSAGE_UNDELIVERED to mirror, alert, or re-queue — no adapter patching.

How It Works

A reply that fails permanently — the target is confirmed dead, or delivery exhausted its retries — parks in the DLQ and marks the target dead. With notify_on_undelivered on, the router also sends a short notice on the same channel and fires the hook.

Configuration Options

gateway.yaml

Built-in default notice: ⚠️ Your request was processed but the reply couldn't be delivered.

DeliveryRouter kwargs (Python)

MessageUndeliveredInput fields


Common Patterns

Mirror every undelivered reply to a home channel.
Alert only when even the fallback notice failed to land.

Best Practices

The original reply may have failed for length or rich-media reasons. A short plain-text notice often lands on the same channel, so the user still knows something happened.
Any exception in your MESSAGE_UNDELIVERED handler is swallowed. The router still re-raises the original send failure, so retry and DLQ machinery keep their contract.
The notice and hook fire on the same permanent-failure branch that marks a target dead. Subsequent sends short-circuit at the registry, so the notice does not repeat. See Dead-Target Registry.
The fallback notice goes through the same adapter and shares the platform rate-limit bucket. See Bot Rate Limiting.

Dead-Target Registry

Suppress known-bad channels and self-heal on recovery.

Hook Events

All lifecycle hook events, including message events.