Skip to content

UX: Friendlier gateway drain message + auto-retry unprocessed messages after restart #49692

@skillz-xx

Description

@skillz-xx

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions