Bug
The gateway process crashes with an unhandled promise rejection when a network fetch call fails:
TypeError: fetch failed
at node:internal/deps/undici/undici:15845:13
at processTicksAndRejections (node:internal/process/task_queues:103:5)
This kills the entire gateway. On Windows, the scheduled task service does not auto-restart on crash, so the gateway stays dead until manually restarted.
Impact
- Cron jobs miss their scheduled runs
- All channels go offline
- No automatic recovery
Environment
- Clawdbot
2026.1.24-3
- Windows 10 (x64)
- Node.js v24.12.0
- Gateway running as Windows Scheduled Task
Suggested Fix
The rejection should be caught — either a global process.on('unhandledRejection') handler or proper try/catch around network calls (likely Telegram polling or heartbeat HTTP requests).
Workaround: Watchdog Wrapper
We modified gateway.cmd to loop and auto-restart on crash with a 5-second delay:
@echo off
:loop
echo [%date% %time%] Starting Clawdbot Gateway...
"C:\Program Files\nodejs\node.exe" path\to\clawdbot\dist\entry.js gateway --port 18789
set EXIT_CODE=%ERRORLEVEL%
echo [%date% %time%] Gateway exited with code %EXIT_CODE%. Restarting in 5 seconds...
timeout /t 5 /nobreak >nul
goto loop
This ensures the gateway always comes back up within seconds. Could be worth integrating into the daemon install for Windows users.
Steps to Reproduce
- Run gateway on Windows as a scheduled task
- Wait for a transient network failure (DNS timeout, connection drop, etc.)
- Gateway crashes and does not restart
Bug
The gateway process crashes with an unhandled promise rejection when a network
fetchcall fails:This kills the entire gateway. On Windows, the scheduled task service does not auto-restart on crash, so the gateway stays dead until manually restarted.
Impact
Environment
2026.1.24-3Suggested Fix
The rejection should be caught — either a global
process.on('unhandledRejection')handler or proper try/catch around network calls (likely Telegram polling or heartbeat HTTP requests).Workaround: Watchdog Wrapper
We modified
gateway.cmdto loop and auto-restart on crash with a 5-second delay:This ensures the gateway always comes back up within seconds. Could be worth integrating into the daemon install for Windows users.
Steps to Reproduce