-
-
Notifications
You must be signed in to change notification settings - Fork 40.1k
Description
Bug Report for Clawdbot Team
Issue: Unhandled Promise Rejection causing Gateway crash
Environment
- Version:
2026.1.24-3 - OS: Windows_NT 10.0.26200 (x64)
- Node: v24.0.1
- Model: anthropic/claude-sonnet-4-5
- Gateway Mode: local (loopback)
- Channel: Telegram (enabled)
Error Details
[clawdbot] Unhandled promise rejection: TypeError: fetch failed
at node:internal/deps/undici/undici:15363:13
at processTicksAndRejections (node:internal/process/task_queues:105:5)
Timestamp: 2026-01-29T19:08:14.678Z
Log File: \tmp\clawdbot\clawdbot-2026-01-29.log (line ~16MB in)
Context
- State: Gateway was idle (no active agent runs)
- Last Activity: Normal WebSocket polling (
node.list) at 19:08:11 - Crash: 3 seconds later at 19:08:14
- Recovery: Auto-restart via Windows Task Scheduler successful
Activity before crash:
- 19:08:06 -
node.listresponse (3ms) - 19:08:11 -
node.listresponse (4ms) - 19:08:14 - 💥 Crash
No incoming Telegram messages or user activity at crash time.
Suspected Cause
Unhandled rejection in background fetch operation, likely:
- Telegram Bot API long-polling (
getUpdates) timeout/network failure - Heartbeat check to external service
- Stale HTTP request cleanup
The crash occurs during idle time with no active agent workload, suggesting a background polling or health-check operation.
Expected Behavior
Network failures in background operations should be caught and logged, not crash the gateway process.
Suggested Fix
Add .catch() handlers to all background fetch operations:
- Telegram getUpdates polling
- Heartbeat/health checks
- Any cleanup/timeout handlers
Consider adding a global unhandled rejection handler with graceful degradation instead of process crash.
Reproduction
Intermittent - appears to happen during network instability or API timeouts during idle periods. Not reliably reproducible.
Impact
Severity: Medium
- Gateway crashes and requires restart
- Auto-recovery works (Task Scheduler restart)
- No data loss
- User experience interrupted briefly