Problem
When the gateway restarts (config change, update, etc.), users see this error:
⚠️ Agent failed before reply: Gateway is draining for restart; new tasks are not accepted.
Logs: openclaw logs --follow
This is technically accurate but terrible UX for end users — especially in Signal/Telegram group chats where non-technical people see it. The message sounds like something broke, when really the gateway just needs 5 seconds.
Worse: the message that triggered the error is lost. The user has to manually re-send their message after the restart. The gateway already pings the last active session after restart — but it does not replay the unprocessed inbound message.
Proposed Changes
1. Friendlier drain error message
Replace the current GatewayDrainingError message with something like:
"Hang on — the gateway is restarting and will be back in a moment! 🔄"
The Agent failed before reply: ... wrapper could also be softened for drain errors specifically, since it is not really a "failure."
2. Auto-retry unprocessed messages after restart
When a message is rejected due to GatewayDrainingError:
- Queue the original inbound message (channel, sender, text, metadata)
- After restart completes, replay queued messages in order
- This way the user never has to re-send — the agent picks up where it left off
This would make restarts completely seamless from the user's perspective.
Current Workaround
Dist-patching the error string in all JS bundles. Works but fragile (lost on every update).
Context
Real user feedback — multiple frustrated re-sends in a Signal group after a gateway restart.
Problem
When the gateway restarts (config change, update, etc.), users see this error:
This is technically accurate but terrible UX for end users — especially in Signal/Telegram group chats where non-technical people see it. The message sounds like something broke, when really the gateway just needs 5 seconds.
Worse: the message that triggered the error is lost. The user has to manually re-send their message after the restart. The gateway already pings the last active session after restart — but it does not replay the unprocessed inbound message.
Proposed Changes
1. Friendlier drain error message
Replace the current
GatewayDrainingErrormessage with something like:The
Agent failed before reply: ...wrapper could also be softened for drain errors specifically, since it is not really a "failure."2. Auto-retry unprocessed messages after restart
When a message is rejected due to
GatewayDrainingError:This would make restarts completely seamless from the user's perspective.
Current Workaround
Dist-patching the error string in all JS bundles. Works but fragile (lost on every update).
Context
Real user feedback — multiple frustrated re-sends in a Signal group after a gateway restart.