Summary
When the LLM API call fails (e.g., due to an unauthorized model or 404/403 error), an Unhandled Promise Rejection occurs. This crashes the entire OpenClaw Node.js gateway process instantly, often leaving zombie processes that cause infinite restart loops.
Steps to reproduce
- Set up a system prompt or boot sequence that forces the agent to send a message immediately upon a new session.
- Switch to a model that the current API Key does NOT have permission to access (e.g., switching to
gemini-2-flash without the proper Google API scope).
- Trigger
/new or the boot sequence.
- The API call fails, throwing an Unhandled Promise Rejection.
- The entire OpenClaw gateway crashes and attempts to restart, hitting a port conflict/zombie process loop.
Expected behavior
The core engine should wrap LLM API calls in a try/catch block or properly handle the Promise rejection. If an API call fails, it should:
- Log the error cleanly.
- Gracefully degrade or send a fallback
[System Error: Model API failed] message to the chat.
- Keep the gateway process alive instead of crashing.
Actual behavior
The gateway process exits immediately with an UnhandledPromiseRejectionWarning or fatal error.
The port remains occupied by a zombie process.
The process manager (or systemd) attempts to restart the gateway.
The new process fails to bind to the port (EADDRINUSE), leading to an infinite crash loop until manually killed.
The chat interface stops responding completely.
OpenClaw version
v 2026.02.22
Operating system
Ubuntu 24.04
Install method
npm globle
Logs, screenshots, and evidence
Impact and severity
No response
Additional information
No response
Summary
When the LLM API call fails (e.g., due to an unauthorized model or 404/403 error), an Unhandled Promise Rejection occurs. This crashes the entire OpenClaw Node.js gateway process instantly, often leaving zombie processes that cause infinite restart loops.
Steps to reproduce
gemini-2-flashwithout the proper Google API scope)./newor the boot sequence.Expected behavior
The core engine should wrap LLM API calls in a
try/catchblock or properly handle the Promise rejection. If an API call fails, it should:[System Error: Model API failed]message to the chat.Actual behavior
The gateway process exits immediately with an UnhandledPromiseRejectionWarning or fatal error.
The port remains occupied by a zombie process.
The process manager (or systemd) attempts to restart the gateway.
The new process fails to bind to the port (EADDRINUSE), leading to an infinite crash loop until manually killed.
The chat interface stops responding completely.
OpenClaw version
v 2026.02.22
Operating system
Ubuntu 24.04
Install method
npm globle
Logs, screenshots, and evidence
Impact and severity
No response
Additional information
No response