-
-
Notifications
You must be signed in to change notification settings - Fork 69.5k
[Feature]: Message Delivery Failure Notification #46830
Description
Summary
When sending messages to channels (Feishu, Telegram, etc.), if the API call fails (network issues, rate limits, API errors), the agent may believe the message was sent successfully, but the user never receives it.
Observed behavior (from logs):
feishu[default] final reply failed: AxiosError: Request failed with status code 400
code: 230011, msg: 'The message was withdrawn.'
code: 231003, msg: 'The message is not found, maybe not exist or deleted'
getaddrinfo ENOTFOUND open.feishu.cn
The agent continues operating under the assumption that delivery succeeded, leading to user confusion ("I already sent that" vs "I never received it").
Problem to solve
Option A: System Message Injection (Recommended)
When a channel delivery fails, inject a system message into the agent's context:
{
"type": "delivery_failure",
"channel": "feishu",
"target": "user:xxx",
"error": "AxiosError: Request failed with status code 400",
"timestamp": "2026-03-14T18:27:07.554Z",
"message_preview": "First 100 chars of failed message..."
}This allows the agent to:
- Know delivery failed
- Retry or inform the user
- Log to memory for recovery
Option B: Delivery Status in Tool Response
Return delivery status in message tool response:
{
"status": "failed",
"error": "network_error",
"retry_suggested": true
}Proposed solution
- Reliability: Agents can detect and recover from delivery failures
- Trust: Users won't experience "I sent it" / "I never got it" disconnects
- Debugging: Easier to trace message delivery issues
Alternatives considered
No response
Impact
Daily review reports, important notifications, time-sensitive messages where delivery confirmation matters.
Evidence/examples
No response
Additional information
No response