openclaw - ✅(Solved) Fix fix(channels): extend user-visible error fallback to Discord, Slack, Signal, WhatsApp [1 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#60812Fetched 2026-04-08 02:46:54
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
0
Author
Participants
Timeline (top)
cross-referenced ×2referenced ×1

Error Message

When a message dispatch fails (provider error, rate limit, empty response), Telegram now sends the user a meaningful fallback message. All other channels silently drop the failure — the user receives nothing and has no way to know something went wrong. | Channel | On dispatch error | | LINE | Sends a hardcoded "Sorry, I encountered an error..." string (no error routing) ⚠️ | Extract the error-message-selection logic into a shared helper (e.g. src/auto-reply/reply/delivery-fallback.ts) so it isn't duplicated across channel files.

Fix Action

Fix / Workaround

When a message dispatch fails (provider error, rate limit, empty response), Telegram now sends the user a meaningful fallback message. All other channels silently drop the failure — the user receives nothing and has no way to know something went wrong.

ChannelOn dispatch error
TelegramSends user a typed fallback message (rate limit / empty response / general) ✅
LINESends a hardcoded "Sorry, I encountered an error..." string (no error routing) ⚠️
DiscordLogs only — user sees nothing ❌
SlackLogs only — user sees nothing ❌
SignalLogs only — user sees nothing ❌
WhatsApp (web)Logs only — user sees nothing ❌

Add the same fallback pattern to each channel's dispatch site:

PR fix notes

PR #60830: fix(agents): detect empty provider responses as failures, improve Telegram error routing

Description (problem / solution / changelog)

Summary

  • Adds EmptyResponseError typed class in model-fallback.ts; replaces the fragile string-matched new Error("Empty response content received from provider")
  • In runFallbackAttempt: treats a raw provider response with content: [] and no meta field as a failure, triggering fallback to the next candidate (benefits all channels)
  • In Telegram dispatch: tracks lastError via onError and an outer try/catch; routes the user-visible fallback message by error type (rate limit / empty response / general); re-throws aborts and timeouts so they don't produce spurious fallback replies; re-throws other dispatcher crashes after cleanup so callers still see the failure for logging/alerting
  • Adds tests for the empty-content detection (triggers fallback) and the meta field guard (accepted as valid)

Related

Follow-up work tracked in:

  • #60812 — extend user-visible error fallback to Discord, Slack, Signal, WhatsApp
  • #60813 — upgrade LINE's hardcoded error fallback to typed error routing

Test plan

  • pnpm test src/agents/model-fallback.test.ts — all tests pass including 3 new ones
  • bunx oxlint src/agents/model-fallback.ts src/telegram/bot-message-dispatch.ts — 0 errors
  • Telegram: provider returns empty content → user sees "I wasn't able to generate a response. Please try rephrasing your question."
  • Telegram: rate-limited provider → user sees rate limit message
  • Telegram: /stop or timeout → no spurious fallback reply sent

Changed files

  • .gitignore (modified, +2/-0)
  • src/agents/model-fallback.test.ts (modified, +63/-1)
  • src/agents/model-fallback.ts (modified, +47/-3)
  • src/telegram/bot-message-dispatch.ts (modified, +195/-151)
RAW_BUFFERClick to expand / collapse

Problem

When a message dispatch fails (provider error, rate limit, empty response), Telegram now sends the user a meaningful fallback message. All other channels silently drop the failure — the user receives nothing and has no way to know something went wrong.

Current behavior per channel

ChannelOn dispatch error
TelegramSends user a typed fallback message (rate limit / empty response / general) ✅
LINESends a hardcoded "Sorry, I encountered an error..." string (no error routing) ⚠️
DiscordLogs only — user sees nothing ❌
SlackLogs only — user sees nothing ❌
SignalLogs only — user sees nothing ❌
WhatsApp (web)Logs only — user sees nothing ❌

Proposed fix

Add the same fallback pattern to each channel's dispatch site:

  1. Track lastError via onError callback and outer try/catch
  2. Check delivery state after dispatch (nothing delivered + failure/skip)
  3. Send a user-visible message using resolveFailoverReasonFromError + EmptyResponseError routing (same logic as Telegram)

Extract the error-message-selection logic into a shared helper (e.g. src/auto-reply/reply/delivery-fallback.ts) so it isn't duplicated across channel files.

Related

  • Introduced in the model-fallback empty-response fix PR (see EmptyResponseError in src/agents/model-fallback.ts)
  • resolveFailoverReasonFromError already handles rate-limit / auth / timeout classification

extent analysis

TL;DR

Implement a fallback message pattern for each channel, similar to Telegram, by tracking errors and sending user-visible messages when dispatch fails.

Guidance

  • Extract the error-message-selection logic into a shared helper, such as src/auto-reply/reply/delivery-fallback.ts, to avoid duplication across channel files.
  • Use the onError callback and outer try/catch to track lastError for each channel.
  • Check delivery state after dispatch and send a user-visible message using resolveFailoverReasonFromError when nothing is delivered and a failure occurs.
  • Leverage the existing EmptyResponseError routing and resolveFailoverReasonFromError logic to classify and handle different error types, such as rate limits and timeouts.

Example

No explicit code example is provided, but the proposed fix suggests creating a shared helper function, e.g., delivery-fallback.ts, to contain the error-message-selection logic.

Notes

The implementation details may vary depending on the specific requirements and constraints of each channel. The proposed fix assumes that the resolveFailoverReasonFromError function is already handling rate-limit, auth, and timeout classification.

Recommendation

Apply the workaround by implementing the proposed fix for each channel, as it provides a more robust and user-friendly experience by sending meaningful fallback messages when dispatch fails.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING