openclaw - ✅(Solved) Fix [Bug]: v2026.3.31 breaks exec on local loopback setups [1 pull requests, 2 comments, 2 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#59045Fetched 2026-04-08 02:29:28
View on GitHub
Comments
2
Participants
2
Timeline
13
Reactions
0
Timeline (top)
referenced ×6commented ×2labeled ×2closed ×1

After upgrading to v2026.3.31, all exec calls fail with: "gateway closed (1008): pairing required"

This affects even basic commands like openclaw --version. The exec tool cannot authenticate to the gateway on local loopback (ws://127.0.0.1:18789).

Gateway token auth IS configured (gateway.auth.mode: "token"), but the exec tool apparently cannot use it — every exec call registers and fails immediately.

Root Cause

After upgrading to v2026.3.31, all exec calls fail with: "gateway closed (1008): pairing required"

This affects even basic commands like openclaw --version. The exec tool cannot authenticate to the gateway on local loopback (ws://127.0.0.1:18789).

Gateway token auth IS configured (gateway.auth.mode: "token"), but the exec tool apparently cannot use it — every exec call registers and fails immediately.

Fix Action

Workaround

Downgrade to v2026.3.28

PR fix notes

PR #59092: fix(gateway): allow silent role upgrades for local loopback clients

Description (problem / solution / changelog)

Summary

  • Problem: v2026.3.31 breaks exec tool connections on local loopback setups (Issue #59045). When a local client connects with a new role (e.g., node host connecting after an operator client), the connection is rejected with a 1008 "pairing required" error, even though the device is already paired.
  • Root Cause: The issue stems from two interacting changes in v2026.3.31:
    1. listEffectivePairedDeviceRoles (in src/infra/device-pairing.ts, line 169) incorrectly returns an empty array [] when device.tokens is an empty object {}, failing to fall back to the legacy device.roles field. This happens because the original guard if (device.tokens) is truthy for {}, but listActiveTokenRoles({}) returns undefined (since Object.values({}) yields no entries), resulting in undefined ?? [] = [].
    2. When a role upgrade is triggered (because the requested role is not in the effective roles), shouldAllowSilentLocalPairing (in src/gateway/server/ws-connection/handshake-auth-helpers.ts, line 58) does not support the role-upgrade reason. This prevents local loopback clients from automatically approving the role upgrade via silent pairing, causing a 1008 close.
  • Fix:
    1. Updated listEffectivePairedDeviceRoles to fall back to legacy role fields (device.roles, device.role) when the tokens map is present but has no entries (empty object {}). When token entries exist but are all revoked, the function still returns [] to preserve the security invariant that revoked tokens permanently remove role access.
    2. Updated shouldAllowSilentLocalPairing to explicitly allow the role-upgrade reason for local clients, ensuring that loopback connections can seamlessly acquire new roles without manual intervention.
  • What changed:
    • src/infra/device-pairing.ts: Fixed listEffectivePairedDeviceRoles fallback logic to distinguish empty tokens map from revoked tokens.
    • src/infra/device-pairing.test.ts: Added regression test for the empty tokens map fallback scenario.
    • src/gateway/server/ws-connection/handshake-auth-helpers.ts: Added role-upgrade to the allowed reasons in shouldAllowSilentLocalPairing.
    • src/gateway/server/ws-connection/handshake-auth-helpers.test.ts: Updated existing test and added new test for silent role-upgrade boundary (local vs remote).
  • What did NOT change (scope boundary):
    • Remote client pairing logic remains unchanged — silent role upgrades are still rejected for non-local clients.
    • The security property that revoked tokens permanently remove role access is preserved — the existing test "derives effective roles from active tokens instead of sticky historical roles" continues to pass unchanged.
    • Scope upgrade logic (reason === "scope-upgrade" is force-set to silent: false in requirePairing) is untouched.
    • General authentication flows, bootstrap token handling, and metadata-upgrade pairing are not affected.

Reproduction

  1. Start a local OpenClaw instance on main or v2026.3.31.
  2. Connect a local client (e.g., CLI) with the operator role to establish initial pairing.
  3. Attempt to use the exec tool or connect a node host from the same local loopback address.
  4. Observe the connection being rejected with a 1008 "pairing required" error.
  5. Apply this patch and repeat steps 1-3; the connection should succeed silently.

Risk / Mitigation

  • Risk: Allowing silent role upgrades for local clients could theoretically allow a compromised local process to escalate its privileges to other roles without user interaction.
  • Mitigation: This risk is mitigated by the existing isLocalClient guard, which restricts this behavior strictly to loopback connections (127.0.0.1 / ::1). Remote connections still require explicit approval for role upgrades. Additionally, the fix in listEffectivePairedDeviceRoles preserves the security invariant that explicitly revoked tokens cannot be bypassed — only empty token maps (from fresh or legacy pairing records) trigger the fallback. Comprehensive unit tests have been added to verify both the positive path (local role-upgrade succeeds) and the negative boundary (remote role-upgrade is rejected; revoked tokens remain ineffective).

Change Type (select all)

  • Bug fix

Scope (select all touched areas)

  • Gateway
  • Infra

Linked Issue/PR

Fixes #59045

Changed files

  • CHANGELOG.md (modified, +2/-0)
  • src/gateway/server/ws-connection/handshake-auth-helpers.test.ts (modified, +31/-1)
  • src/gateway/server/ws-connection/handshake-auth-helpers.ts (modified, +3/-1)
  • src/infra/device-pairing.test.ts (modified, +15/-0)
  • src/infra/device-pairing.ts (modified, +9/-2)
RAW_BUFFERClick to expand / collapse

Bug type

Regression (worked before, now fails)

Beta release blocker

No

Summary

After upgrading to v2026.3.31, all exec calls fail with: "gateway closed (1008): pairing required"

This affects even basic commands like openclaw --version. The exec tool cannot authenticate to the gateway on local loopback (ws://127.0.0.1:18789).

Gateway token auth IS configured (gateway.auth.mode: "token"), but the exec tool apparently cannot use it — every exec call registers and fails immediately.

Expected behavior

exec should work on local loopback with token auth (worked in v2026.3.28)

Version

  • OpenClaw: 2026.3.31
  • Node: v24.14.1
  • OS: WSL2 (linux 6.6.87.2-microsoft-standard-WSL2)
  • Gateway: local loopback, auth token configured

Workaround

Downgrade to v2026.3.28

Steps to reproduce

  1. Have gateway running with auth.token configured + bind=loopback
  2. Upgrade to v2026.3.31
  3. Attempt any exec call (CLI or agent tool)

Expected behavior

exec should work on local loopback with token auth (worked in v2026.3.28)

Actual behavior

Workaround Downgrade to v2026.3.28

OpenClaw version

2026.3.31

Operating system

WSL2 (linux 6.6.87.2-microsoft-standard-WSL2)

Install method

No response

Model

minimax2.7

Provider / routing chain

local loopback, auth token configured

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

No response

extent analysis

TL;DR

Downgrade to v2026.3.28 to resolve the exec call failure issue with "gateway closed (1008): pairing required" error.

Guidance

  • Verify that the gateway token auth is correctly configured with gateway.auth.mode set to "token" to ensure that the exec tool can use it for authentication.
  • Check the OpenClaw version to confirm that it is indeed v2026.3.31, which is the version causing the issue.
  • Attempt to reproduce the issue with a basic command like openclaw --version to confirm that the problem is not specific to a particular command.
  • Consider reporting the issue to the OpenClaw developers or maintainers, as the problem seems to be a regression introduced in v2026.3.31.

Notes

The provided information suggests that the issue is specific to v2026.3.31, and downgrading to v2026.3.28 resolves the problem. However, without more information about the changes made in v2026.3.31, it is difficult to provide a more specific fix.

Recommendation

Apply workaround: Downgrade to v2026.3.28, as it is the only known solution to resolve the exec call failure issue with the "gateway closed (1008): pairing required" error.

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

exec should work on local loopback with token auth (worked in v2026.3.28)

Still need to ship something?

×6

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

Back to top recommendations

TRENDING