-
-
Notifications
You must be signed in to change notification settings - Fork 69.7k
Transient APIConnectionError surfaced to user channel instead of being handled silently #15083
Copy link
Copy link
Closed as not planned
Closed as not planned
Copy link
Labels
bugSomething isn't workingSomething isn't workingstaleMarked as stale due to inactivityMarked as stale due to inactivity
Description
Summary
Transient network errors from the Anthropic SDK are being delivered to user channels (Discord) instead of being retried silently or logged internally. This results in "Connection error." spam in chat.
Steps to reproduce
- Run OpenClaw with Discord channel enabled
- Have intermittent network conditions or API hiccups
- Observe "Connection error." messages posted to Discord
Expected behavior
- Transient connection errors should be retried N times silently
- If retries fail, log internally (not to user channel)
- Only surface to user if the error is persistent/critical
Actual behavior
- Every transient
APIConnectionErrorfrom the Anthropic SDK is immediately posted to the Discord channel - Multiple "Connection error." messages appear in chat
- Affects all bot accounts in multi-account setups
Environment
- OpenClaw version: 2026.2.9
- OS: Windows 10 (22621)
- Install method: npm global
Logs or screenshots
The error path appears to be:
APIConnectionErrorthrown by@anthropic-ai/sdk- Error goes through
formatErrorMessage()which extractserr.message - Message gets delivered to the user channel via the standard reply path
Suggested Fix
- Wrap API calls with retry logic for transient connection errors
- Classify
APIConnectionError/ socket errors as retriable - Only surface to user after all retries exhausted
- Consider logging these internally rather than posting to chat
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingstaleMarked as stale due to inactivityMarked as stale due to inactivity
Type
Fields
Give feedbackNo fields configured for issues without a type.