-
-
Notifications
You must be signed in to change notification settings - Fork 80.7k
Gateway self-restart from chat turn drops in-flight Telegram/Discord replies #78380
Copy link
Copy link
Open
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.maturity:stableIssue affects a taxonomy feature currently scored M4/M5.Issue affects a taxonomy feature currently scored M4/M5.staleMarked as stale due to inactivityMarked as stale due to inactivity
Description
Metadata
Metadata
Assignees
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.maturity:stableIssue affects a taxonomy feature currently scored M4/M5.Issue affects a taxonomy feature currently scored M4/M5.staleMarked as stale due to inactivityMarked as stale due to inactivity
Type
Fields
Priority
None yet
Summary
When an OpenClaw agent restarts its own gateway from inside a channel-originated chat turn, the restart can succeed at the service-manager level but still drops the current in-flight reply. To the user, this presents as "the bot went silent" even though the gateway later comes back healthy.
We hit this while debugging Telegram forum/Generic topic delivery on
OpenClaw 2026.5.4 (325df3e). This is separate from the Telegram forum topic delivery issue in #77248: that issue is about normal finals not always being visibly delivered to Telegram forum topics. This issue is about losing any in-flight channel reply when the agent restarts its own gateway mid-turn.I first tried to add this evidence to the closest existing restart issues (#40932, #44490, #40275), but those conversations are locked, so I am filing this separately.
Environment
2026.5.4 (325df3e)22.22.0topic:1)What happened
Observed locally:
agent:main:telegram:group:<chat>:topic:1.systemctl --user restart openclaw-gateway.servicefrom an exec/tool call.signal SIGTERM receivedand exits cleanly.openclaw statusshows gateway reachable andTelegram ON/OK).Relevant local log pattern:
Important detail: this is not simply "restart does not restart". In this setup, systemd restart works. The problem is that initiating it from the same OpenClaw chat turn kills the reply path before visible channel delivery.
Expected behavior
If a user asks OpenClaw to perform maintenance that requires a gateway restart from Telegram/Discord/etc., the current visible reply should not be lost. The agent should either:
Actual behavior
The agent can run an inline gateway restart command during the turn. The gateway terminates, the turn dies mid-flight, and the user receives no final reply.
Local workaround that fixed the operational problem
1. Block inline gateway restarts from OpenClaw exec/tool calls
We enabled a local guard hook that blocks commands such as:
openclaw gateway restartopenclaw updateunless explicitly no-restartsystemctl --user restart openclaw-gateway.servicesystemctl --user stop openclaw-gateway.servicesystemctl --user reload openclaw-gateway.servicesystemctl --user kill openclaw-gateway.service2. Use a detached delayed scheduler instead
On Linux/systemd, this worked reliably:
The scheduled script then performs the actual restart and post-restart verification out of band:
3. Update local agent instructions
We changed local agent instructions to treat direct gateway restarts as forbidden inside a chat turn.
Merely telling the agent to "send a status message first, then restart" was not sufficient in our Telegram/Discord-originated setup, because the visible channel reply is generally delivered at turn finalization. Immediate restart can still happen before the user-visible message is sent.
Suggested upstream direction
Related issues
openclaw gateway restartvia tool call / exec can lose tool result or break the execution chain. Locked, could not comment there.