OpenClaw

OpenClaw preserves Code Mode across gateway restarts

An OpenClaw patch carries the original Code Mode tool surface through authenticated restart recovery, even when reloaded configuration disables Code Mode for new turns. A current Discord routing report and Signal setup fix show why recovery and channel identity must retain the same agent boundary.

← Back to homeOriginal source ↗

openclaw/openclaw PR #116605 is the inspected primary source: “fix(agents): resume Code Mode through gateway restarts.” The two related records below were inspected as supporting context, not treated as independent confirmation.

The facts

- openclaw/openclaw PR #116605 was created 2026-07-31T00:57:24Z and was open at inspection; its title is “fix(agents): resume Code Mode through gateway restarts.” - openclaw/openclaw issue #39428 was created 2026-03-08T03:45:23Z and was open at inspection; its title is “Discord account-to-agent routing falls back to default agent instead of matching by account name.” - openclaw/openclaw PR #116182 was created 2026-07-30T02:28:41Z and was open at inspection; its title is “fix(signal): infer httpPort from httpUrl when absent with autoStart.” - The repository reported 384616 stars, 5872 open issues, default branch main, and last push 2026-07-31T00:58:09Z. - The latest tagged-release baseline checked was v2026.7.2-beta.5 published 2026-07-28T03:23:12Z.

What changed

openclaw/openclaw PR #116605 reports: What Problem This Solves Fixes an issue where an in-flight replay-safe Code Mode run could fail after a Gateway restart when reloaded configuration disabled Code Mode for new turns. Recovery either rejected the current Code Mode abort record or resumed the existing provider turn with the ordinary shell exec schema. Why This Change Was Made Restart recovery now recognizes the current exact Code Mode abort contract and carries a trusted internal fact that preserves the original exec/wait control surface for that one checkpoint-proven provider turn. The override is rejected unless

openclaw/openclaw issue #39428 reports: Description When a Discord channel account name matches an agent ID, inbound messages should automatically route to that agent. Instead, they fall back to the default (main) agent, requiring explicit bindings config to fix. Steps to Reproduce 1. Configure two Discord accounts in channels.discord.accounts: agentA (bot token A) agentB (bot token B) 2. Configure matching agents in agents.list: id: "agentA" (with a non-default model) id: "agentB" (with a non-default model) 3. Restart gateway 4. Send a DM to the agentA Discord bot 5. Run /status on Discord Expected Behavior The

openclaw/openclaw PR #116182 reports: What Problem This Solves Fixes an issue where users configuring Signal with autoStart=true and httpUrl specifying a non-default port (e.g. http://127.0.0.1:8082) without an explicit httpPort would experience split diagnostics: the managed signal-cli daemon binds to the default port 8080 while OpenClaw's client probe targets port 8082 from the URL. The resulting error messages describe two seemingly unrelated failures — Failed to initialize HTTP Server from the daemon and port 8082 unreachable from the probe. Fixes #116165. Why This Change Was Made The root cause is in buildManagedNativeTransport() in config-compat.ts: when

Why it matters

Restart recovery is a continuation, not a new authorization event. It must preserve the checkpointed tool contract for the interrupted turn without granting that contract to later work. This is an operator boundary: persisted state, execution ownership and visible controls must describe the same event. A workaround that broadens access, deletes state or hides the symptom would trade a visible defect for an unmeasured one.

Current

The primary record was open when captured on 2026-07-31. The release baseline was v2026.7.2-beta.5 published 2026-07-28T03:23:12Z. Current repository metadata, pull requests, issues, release records, Google News discovery, Hacker News discovery, Lobsters, Metamesh and the rendered ClawCharts row were checked. ClawCharts selected the subject; it did not prove the claim.

Evidence

The primary URL is https://github.com/openclaw/openclaw/pull/116605. Supporting records are https://github.com/openclaw/openclaw/issues/39428 and https://github.com/openclaw/openclaw/pull/116182. Their source bodies, timestamps and states were captured in the daily evidence bundle. Test counts, reproductions and deployment observations remain attributed to their authors unless explicitly identified as independently rerun.

Source boundary

Open work is described as open, closed work as closed, and operator reports as reports. A pull request is evidence of proposed or reviewed direction, not proof of a shipped release. Issue closure would not by itself prove a deployed fix. Search residue, package mirrors and historically published source spines were excluded.

Operator take

Test restart recovery with configuration changes, confirm the resumed turn keeps only its original tools, and keep explicit channel bindings where account-name inference could route into the default agent. Preserve a before-state receipt, make the smallest reversible change, and verify the original failure independently after intervention.

Caveat

Public project records are mutable. Status, scope and evidence can change after publication. This brief records the inspected state and does not authorize changes to a reader’s deployment.

Source inspected; source state, environment and release boundary remain explicit.