openclaw - ✅(Solved) Fix [Bug]: gateway restart continuationMessage is silently dropped when restart coalesces with an in-flight restart [1 pull requests, 2 comments, 3 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#74424Fetched 2026-04-30 06:24:01
View on GitHub
Comments
2
Participants
3
Timeline
3
Reactions
2
Timeline (top)
commented ×2cross-referenced ×1

A gateway tool action: "restart" call that includes continuationMessage can return ok with coalesced: true while silently failing to persist or deliver that continuation after the gateway restarts.

Error Message

A likely fix is to either persist/merge continuation intent when a restart request coalesces with an in-flight restart, or return an explicit continuationQueued: false/error so the agent can choose a different recovery path.

Root Cause

Consequence: plugin installation/channel activation flows can stall after restart; the user must manually send another message to continue and may believe the continuation was queued because the tool returned success.

Fix Action

Fix / Workaround

Gateway restart config-patch ok (config.patch)
Set default model to openai-codex/gpt-5.5 and enable fast mode by default for the main agent.
Run: openclaw doctor --non-interactive
Observed tool request included action="restart" plus continuationMessage.
Observed tool response included mode="emit" and coalesced=true.
Observed post-restart user-visible notice was the config-patch restart card.
Observed missing behavior: no continuation agent turn was delivered.
  • The explicit gateway restart action builds a restart sentinel payload with continuation from continuationMessage, but only writes it inside emitHooks.beforeEmit, not at tool-call time: src/agents/tools/gateway-tool.ts:375, src/agents/tools/gateway-tool.ts:387, src/agents/tools/gateway-tool.ts:401.
  • scheduleGatewaySigusr1Restart() returns early with coalesced: true when a restart signal is already in-flight (hasUnconsumedRestartSignal()), before registering or running the caller's emitHooks: src/infra/restart.ts:621.
  • Startup only enqueues/drains a continuation when the persisted restart sentinel contains payload.continuation: src/gateway/server-restart-sentinel.ts:485.
  • The config-patch restart path writes a restart notification sentinel but does not add a continuation: src/gateway/server-methods/config.ts:353, src/gateway/server-methods/config.ts:583.

PR fix notes

PR #74443: fix(gateway/restart): write sentinel with continuationMessage on coalesced restart

Description (problem / solution / changelog)

Problem

When scheduleGatewaySigusr1Restart returns { coalesced: true } (two paths in src/infra/restart.ts), the beforeEmit hook registered by the gateway tool is never called. This means writeRestartSentinel never fires, so the continuationMessage supplied by the caller is silently dropped.

Fix

After scheduleGatewaySigusr1Restart returns, if the result is coalesced and the caller supplied a continuationMessage, call rewriteRestartSentinel to merge the continuation into any existing sentinel file. The call is fire-and-forget (.catch(() => undefined)) so a missing sentinel does not surface as an error on the coalesced path.

Testing

  • Typecheck passes: tsc --noEmit --project tsconfig.core.json
  • Two paths fixed: in-flight coalesced (no hooks called at all) and already-scheduled coalesced (updatePendingRestartEmitHooks overwrites, does not chain)

Fixes #74424.

Changed files

  • CHANGELOG.md (modified, +1/-0)
  • src/agents/tools/gateway-tool.ts (modified, +10/-0)

Code Example

{
  "action": "restart",
  "reason": "Load newly installed plugin and channel account",
  "note": "Installed plugin and channel account; restarting gateway to load the plugin.",
  "continuationMessage": "Gateway restart completed. Continue checking whether the new plugin tools are visible; if available, invoke the expected readiness/account tool; otherwise report the missing tool surface."
}

---

Gateway restart config-patch ok (config.patch)
Set default model to openai-codex/gpt-5.5 and enable fast mode by default for the main agent.
Run: openclaw doctor --non-interactive

---

Observed tool request included action="restart" plus continuationMessage.
Observed tool response included mode="emit" and coalesced=true.
Observed post-restart user-visible notice was the config-patch restart card.
Observed missing behavior: no continuation agent turn was delivered.
RAW_BUFFERClick to expand / collapse

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

A gateway tool action: "restart" call that includes continuationMessage can return ok with coalesced: true while silently failing to persist or deliver that continuation after the gateway restarts.

Steps to reproduce

  1. Trigger a gateway restart from a config/plugin workflow, for example installing/enabling a plugin or updating plugins.entries.* under the default gateway.reload.mode: "hybrid" path.
  2. While that restart is already scheduled or in-flight, call the gateway tool explicitly with an additional restart request that includes a continuation, for example:
{
  "action": "restart",
  "reason": "Load newly installed plugin and channel account",
  "note": "Installed plugin and channel account; restarting gateway to load the plugin.",
  "continuationMessage": "Gateway restart completed. Continue checking whether the new plugin tools are visible; if available, invoke the expected readiness/account tool; otherwise report the missing tool surface."
}
  1. Observe the tool response contains mode: "emit" and coalesced: true.
  2. Wait for the gateway restart to complete.

Expected behavior

If the gateway restart tool accepts continuationMessage and returns ok, the continuation should be durably queued and delivered exactly once after restart, even when the restart request coalesces with an existing restart. If OpenClaw cannot guarantee delivery in a coalesced path, the tool response should explicitly report that the continuation was not queued instead of returning a normal success shape.

Actual behavior

The gateway restart notification is delivered, but the continuation run is not triggered. In the observed case the user saw only a restart-card style notice similar to:

Gateway restart config-patch ok (config.patch)
Set default model to openai-codex/gpt-5.5 and enable fast mode by default for the main agent.
Run: openclaw doctor --non-interactive

No follow-up agent turn was created from the provided continuationMessage. The user had to manually continue the session.

OpenClaw version

2026.4.26 source checkout at 166a6d9088d0

Operating system

macOS 26.2 (25C56)

Install method

Source checkout / local gateway development workspace. Exact launched gateway install wrapper for the observed run: NOT_ENOUGH_INFO

Model

openai-codex/gpt-5.5

Provider / routing chain

OpenClaw agent -> gateway tool -> local Gateway SIGUSR1 restart path. LLM provider/model under test: openai-codex/gpt-5.5.

Additional provider/model setup details

The observed workflow also changed the main agent default model to openai-codex/gpt-5.5 and enabled fast mode by default. Other provider routing details: NOT_ENOUGH_INFO

Logs, screenshots, and evidence

Observed tool request included action="restart" plus continuationMessage.
Observed tool response included mode="emit" and coalesced=true.
Observed post-restart user-visible notice was the config-patch restart card.
Observed missing behavior: no continuation agent turn was delivered.

Code evidence from current checkout:

  • The explicit gateway restart action builds a restart sentinel payload with continuation from continuationMessage, but only writes it inside emitHooks.beforeEmit, not at tool-call time: src/agents/tools/gateway-tool.ts:375, src/agents/tools/gateway-tool.ts:387, src/agents/tools/gateway-tool.ts:401.
  • scheduleGatewaySigusr1Restart() returns early with coalesced: true when a restart signal is already in-flight (hasUnconsumedRestartSignal()), before registering or running the caller's emitHooks: src/infra/restart.ts:621.
  • Startup only enqueues/drains a continuation when the persisted restart sentinel contains payload.continuation: src/gateway/server-restart-sentinel.ts:485.
  • The config-patch restart path writes a restart notification sentinel but does not add a continuation: src/gateway/server-methods/config.ts:353, src/gateway/server-methods/config.ts:583.

Impact and severity

Affected: agent-driven plugin/channel setup flows and any workflow where an agent asks the gateway to restart with a one-shot continuation while another restart is already scheduled or in-flight.

Severity: High for these workflows. The user sees a successful restart notification but the promised follow-up work is silently lost.

Frequency: Intermittent/racy in general, but reproducible when action: "restart" with continuationMessage lands in the already-in-flight coalescing window.

Consequence: plugin installation/channel activation flows can stall after restart; the user must manually send another message to continue and may believe the continuation was queued because the tool returned success.

Additional information

Related but not exact duplicates found during triage:

  • #50137 added/supports restart sentinel continuations, but this bug is about losing an already-provided continuation in a coalesced restart path.
  • #60864 tracks broader task checkpoint/auto-resume semantics, but this report is narrower: a one-shot continuationMessage accepted by the existing gateway restart tool is silently dropped.
  • #51620 and #71178 cover broader restart-time message loss and in-flight turn interruption; this report is specifically about the gateway restart tool's continuation contract under coalescing.

A likely fix is to either persist/merge continuation intent when a restart request coalesces with an in-flight restart, or return an explicit continuationQueued: false/error so the agent can choose a different recovery path.

extent analysis

TL;DR

The gateway restart tool should be modified to either persist the continuation intent when a restart request coalesces with an in-flight restart or return an explicit error indicating that the continuation was not queued.

Guidance

  • Review the scheduleGatewaySigusr1Restart() function in src/infra/restart.ts to ensure it properly handles coalesced restarts and registers the continuation intent.
  • Modify the gateway tool to return an explicit error or warning when a continuation is provided but cannot be queued due to a coalesced restart.
  • Investigate the emitHooks.beforeEmit logic in src/agents/tools/gateway-tool.ts to determine why the continuation is not being written at tool-call time.
  • Consider adding a check in the startup code to drain any pending continuations when the gateway restarts.

Example

// src/infra/restart.ts
function scheduleGatewaySigusr1Restart() {
  // ...
  if (hasUnconsumedRestartSignal()) {
    // Instead of returning early, merge the continuation intent
    mergeContinuationIntent(continuationMessage);
  }
  // ...
}

// src/agents/tools/gateway-tool.ts
function handleRestartToolCall() {
  // ...
  if (coalesced) {
    // Return an explicit error or warning
    return { error: 'Continuation not queued due to coalesced restart' };
  }
  // ...
}

Notes

The provided code snippets and issue description suggest that the problem lies in the handling of coalesced restarts and the persistence of continuation intent. However, without further investigation, it is unclear whether the proposed fix will fully resolve the issue.

Recommendation

Apply a workaround by modifying the gateway tool to return an explicit error when a continuation is provided but cannot be queued due to a coalesced restart, allowing the agent to choose a different recovery path. This will provide a temporary

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

If the gateway restart tool accepts continuationMessage and returns ok, the continuation should be durably queued and delivered exactly once after restart, even when the restart request coalesces with an existing restart. If OpenClaw cannot guarantee delivery in a coalesced path, the tool response should explicitly report that the continuation was not queued instead of returning a normal success shape.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - ✅(Solved) Fix [Bug]: gateway restart continuationMessage is silently dropped when restart coalesces with an in-flight restart [1 pull requests, 2 comments, 3 participants]