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. Withnotify_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.Best Practices
A one-liner slips through where a rich reply could not
A one-liner slips through where a rich reply could not
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.
Handler errors never break delivery
Handler errors never break delivery
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.It composes with the dead-target registry
It composes with the dead-target registry
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.
Related
Dead-Target Registry
Suppress known-bad channels and self-heal on recovery.
Hook Events
All lifecycle hook events, including message events.

