openclaw - 💡(How to fix) Fix [Bug]: 2026.3.13 local loopback regression: operator.read failures and gateway closed (1000) on CLI commands [4 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#51008Fetched 2026-04-08 01:05:37
View on GitHub
Comments
4
Participants
3
Timeline
7
Reactions
0
Author
Timeline (top)
commented ×4labeled ×2subscribed ×1

After upgrading to OpenClaw 2026.3.13, the local loopback gateway behaves inconsistently.

This is broader than the already reported status/probe missing scope: operator.read issue.

In my case, the same gateway runtime shows:

  • successful local webchat/control-ui RPC for some connections
  • missing scope: operator.read for other local RPC calls
  • intermittent websocket handshake timeout / closed before connect
  • occasional failed first restart attempt before successful second start
  • some CLI commands failing completely with gateway closed (1000 normal closure): no close reason

So this looks like a wider local auth/scope/session instability, not only a misleading status/probe message. Environment

  • OpenClaw version: 2026.3.13
  • OS: Debian/Linux
  • Node: 22.22.1
  • Gateway mode: local
  • Gateway bind: loopback (ws://127.0.0.1:18789)
  • Gateway service: systemd user service
  • Browser server enabled locally
  • Telegram channel enabled and healthy

Error Message

  1. openclaw status consistently reports:

Gateway | local · ws://127.0.0.1:18789 (local loopback) · unreachable (missing scope: operator.read)

  1. Successful local webchat/control-ui session in the same runtime:

[ws] webchat connected conn=941cdd3b-28b4-4a9b-8a51-f3422a124241 remote=127.0.0.1 client=openclaw-control-ui webchat v2026.3.13 [ws] ⇄ res ✓ config.get 3072ms conn=941cdd3b…4241 id=26fca091…df2f [ws] ⇄ res ✓ node.list 3137ms conn=941cdd3b…4241 id=dc9ead25…6e48 [ws] ⇄ res ✓ device.pair.list 3142ms conn=941cdd3b…4241 id=14c791cc…4dca

  1. Scope failure after session churn / other local connection path:

[ws] webchat disconnected code=1001 reason=n/a conn=941cdd3b-28b4-4a9b-8a51-f3422a124241 [ws] ⇄ res ✗ status 1ms errorCode=INVALID_REQUEST errorMessage=missing scope: operator.read conn=2ca83214…deeb id=0b3ef1eb…28da [ws] ⇄ res ✗ system-presence 0ms errorCode=INVALID_REQUEST errorMessage=missing scope: operator.read conn=2ca83214…deeb id=510e4a8a…00b1 [ws] ⇄ res ✗ config.get 1ms errorCode=INVALID_REQUEST errorMessage=missing scope: operator.read conn=2ca83214…deeb id=621de533…d410

  1. Additional current failing example:

[ws] ⇄ res ✗ status 1ms errorCode=INVALID_REQUEST errorMessage=missing scope: operator.read conn=d4a8674c…5724 id=a5fc0b71…60ce [ws] ⇄ res ✗ system-presence 1ms errorCode=INVALID_REQUEST errorMessage=missing scope: operator.read conn=d4a8674c…5724 id=347e5fd5…c63b [ws] ⇄ res ✗ config.get 0ms errorCode=INVALID_REQUEST errorMessage=missing scope: operator.read conn=d4a8674c…5724 id=7802935c…5c1e

  1. Websocket handshake instability:

[ws] handshake timeout conn=24f73c4b-bb95-43d8-a9be-6f6f2a15091a remote=127.0.0.1 [ws] closed before connect conn=24f73c4b-bb95-43d8-a9be-6f6f2a15091a remote=127.0.0.1 fwd=n/a origin=n/a host=127.0.0.1:18789 ua=n/a code=1000 reason=n/a

  1. CLI commands that fail completely:

openclaw browser status gateway connect failed: Error: gateway closed (1000): Error: gateway closed (1000 normal closure): no close reason

openclaw devices list --json gateway connect failed: Error: gateway closed (1000): [openclaw] Failed to start CLI: Error: gateway closed (1000 normal closure): no close reason

  1. Restart instability:

Started openclaw-gateway.service Stopping openclaw-gateway.service Main process exited, code=exited, status=1/FAILURE Failed with result 'exit-code' Started openclaw-gateway.service

Root Cause

After upgrading to OpenClaw 2026.3.13, the local loopback gateway behaves inconsistently.

This is broader than the already reported status/probe missing scope: operator.read issue.

In my case, the same gateway runtime shows:

  • successful local webchat/control-ui RPC for some connections
  • missing scope: operator.read for other local RPC calls
  • intermittent websocket handshake timeout / closed before connect
  • occasional failed first restart attempt before successful second start
  • some CLI commands failing completely with gateway closed (1000 normal closure): no close reason

So this looks like a wider local auth/scope/session instability, not only a misleading status/probe message. Environment

  • OpenClaw version: 2026.3.13
  • OS: Debian/Linux
  • Node: 22.22.1
  • Gateway mode: local
  • Gateway bind: loopback (ws://127.0.0.1:18789)
  • Gateway service: systemd user service
  • Browser server enabled locally
  • Telegram channel enabled and healthy

Code Example

1. openclaw status consistently reports:

Gateway | local · ws://127.0.0.1:18789 (local loopback) · unreachable (missing scope: operator.read)

2. Successful local webchat/control-ui session in the same runtime:

[ws] webchat connected conn=941cdd3b-28b4-4a9b-8a51-f3422a124241 remote=127.0.0.1 client=openclaw-control-ui webchat v2026.3.13
[ws] ⇄ res ✓ config.get 3072ms conn=941cdd3b…4241 id=26fca091…df2f
[ws] ⇄ res ✓ node.list 3137ms conn=941cdd3b…4241 id=dc9ead25…6e48
[ws] ⇄ res ✓ device.pair.list 3142ms conn=941cdd3b…4241 id=14c791cc…4dca

3. Scope failure after session churn / other local connection path:

[ws] webchat disconnected code=1001 reason=n/a conn=941cdd3b-28b4-4a9b-8a51-f3422a124241
[ws] ⇄ res ✗ status 1ms errorCode=INVALID_REQUEST errorMessage=missing scope: operator.read conn=2ca83214…deeb id=0b3ef1eb…28da
[ws] ⇄ res ✗ system-presence 0ms errorCode=INVALID_REQUEST errorMessage=missing scope: operator.read conn=2ca83214…deeb id=510e4a8a…00b1
[ws] ⇄ res ✗ config.get 1ms errorCode=INVALID_REQUEST errorMessage=missing scope: operator.read conn=2ca83214…deeb id=621de533…d410

4. Additional current failing example:

[ws] ⇄ res ✗ status 1ms errorCode=INVALID_REQUEST errorMessage=missing scope: operator.read conn=d4a8674c…5724 id=a5fc0b71…60ce
[ws] ⇄ res ✗ system-presence 1ms errorCode=INVALID_REQUEST errorMessage=missing scope: operator.read conn=d4a8674c…5724 id=347e5fd5…c63b
[ws] ⇄ res ✗ config.get 0ms errorCode=INVALID_REQUEST errorMessage=missing scope: operator.read conn=d4a8674c…5724 id=7802935c…5c1e

5. Websocket handshake instability:

[ws] handshake timeout conn=24f73c4b-bb95-43d8-a9be-6f6f2a15091a remote=127.0.0.1
[ws] closed before connect conn=24f73c4b-bb95-43d8-a9be-6f6f2a15091a remote=127.0.0.1 fwd=n/a origin=n/a host=127.0.0.1:18789 ua=n/a code=1000 reason=n/a

6. CLI commands that fail completely:

openclaw browser status
gateway connect failed: Error: gateway closed (1000):
Error: gateway closed (1000 normal closure): no close reason

openclaw devices list --json
gateway connect failed: Error: gateway closed (1000):
[openclaw] Failed to start CLI: Error: gateway closed (1000 normal closure): no close reason

7. Restart instability:

Started openclaw-gateway.service
Stopping openclaw-gateway.service
Main process exited, code=exited, status=1/FAILURE
Failed with result 'exit-code'
Started openclaw-gateway.service
RAW_BUFFERClick to expand / collapse

Bug type

Regression (worked before, now fails)

Summary

After upgrading to OpenClaw 2026.3.13, the local loopback gateway behaves inconsistently.

This is broader than the already reported status/probe missing scope: operator.read issue.

In my case, the same gateway runtime shows:

  • successful local webchat/control-ui RPC for some connections
  • missing scope: operator.read for other local RPC calls
  • intermittent websocket handshake timeout / closed before connect
  • occasional failed first restart attempt before successful second start
  • some CLI commands failing completely with gateway closed (1000 normal closure): no close reason

So this looks like a wider local auth/scope/session instability, not only a misleading status/probe message. Environment

  • OpenClaw version: 2026.3.13
  • OS: Debian/Linux
  • Node: 22.22.1
  • Gateway mode: local
  • Gateway bind: loopback (ws://127.0.0.1:18789)
  • Gateway service: systemd user service
  • Browser server enabled locally
  • Telegram channel enabled and healthy

Steps to reproduce

  1. Start or restart the local OpenClaw gateway service
  2. Open Control UI / local webchat
  3. Observe that some local RPC calls succeed:
  • config.get
  • node.list
  • device.pair.list
  1. Later, in the same gateway runtime, run local CLI commands such as:
  • openclaw status
  • openclaw browser status
  • openclaw devices list --json
  1. Observe mixed failure modes:
  • missing scope: operator.read
  • handshake timeout
  • closed before connect
  • gateway closed (1000 normal closure)

Expected behavior

  • Local operator/control/CLI clients on loopback should resolve scopes consistently
  • status/system-presence/config.get should not randomly lose operator.read
  • browser/control websocket connections should remain stable
  • CLI commands such as browser status and devices list should not fail with gateway closed (1000)
  • gateway restart path should be stable and not require a failed first attempt before a successful second start

Actual behavior

Observed behavior is inconsistent within the same local gateway runtime:

  1. Some local webchat/control-ui sessions connect successfully and can run:
  • config.get
  • node.list
  • device.pair.list
  • chat.history
  • models.list
  1. Other local RPC calls fail with:
  • status -> missing scope: operator.read
  • system-presence -> missing scope: operator.read
  • config.get -> missing scope: operator.read
  1. Some local websocket connections fail with:
  • handshake timeout
  • closed before connect
  1. Some CLI commands fail completely with:
  • gateway closed (1000 normal closure): no close reason
  1. Gateway restart path is sometimes unstable:
  • one restart attempt exits with status=1/FAILURE
  • the next start succeeds

OpenClaw version

2026.3.13

Operating system

Debian 13

Install method

npm global

Model

openai-codex/gpt-5.4

Provider / routing chain

OpenClaw local loopback gateway -> agent runtime -> openai-codex/gpt-5.4

Additional provider/model setup details

No response

Logs, screenshots, and evidence

1. openclaw status consistently reports:

Gateway | local · ws://127.0.0.1:18789 (local loopback) · unreachable (missing scope: operator.read)

2. Successful local webchat/control-ui session in the same runtime:

[ws] webchat connected conn=941cdd3b-28b4-4a9b-8a51-f3422a124241 remote=127.0.0.1 client=openclaw-control-ui webchat v2026.3.13
[ws] ⇄ res ✓ config.get 3072ms conn=941cdd3b…4241 id=26fca091…df2f
[ws] ⇄ res ✓ node.list 3137ms conn=941cdd3b…4241 id=dc9ead25…6e48
[ws] ⇄ res ✓ device.pair.list 3142ms conn=941cdd3b…4241 id=14c791cc…4dca

3. Scope failure after session churn / other local connection path:

[ws] webchat disconnected code=1001 reason=n/a conn=941cdd3b-28b4-4a9b-8a51-f3422a124241
[ws] ⇄ res ✗ status 1ms errorCode=INVALID_REQUEST errorMessage=missing scope: operator.read conn=2ca83214…deeb id=0b3ef1eb…28da
[ws] ⇄ res ✗ system-presence 0ms errorCode=INVALID_REQUEST errorMessage=missing scope: operator.read conn=2ca83214…deeb id=510e4a8a…00b1
[ws] ⇄ res ✗ config.get 1ms errorCode=INVALID_REQUEST errorMessage=missing scope: operator.read conn=2ca83214…deeb id=621de533…d410

4. Additional current failing example:

[ws] ⇄ res ✗ status 1ms errorCode=INVALID_REQUEST errorMessage=missing scope: operator.read conn=d4a8674c…5724 id=a5fc0b71…60ce
[ws] ⇄ res ✗ system-presence 1ms errorCode=INVALID_REQUEST errorMessage=missing scope: operator.read conn=d4a8674c…5724 id=347e5fd5…c63b
[ws] ⇄ res ✗ config.get 0ms errorCode=INVALID_REQUEST errorMessage=missing scope: operator.read conn=d4a8674c…5724 id=7802935c…5c1e

5. Websocket handshake instability:

[ws] handshake timeout conn=24f73c4b-bb95-43d8-a9be-6f6f2a15091a remote=127.0.0.1
[ws] closed before connect conn=24f73c4b-bb95-43d8-a9be-6f6f2a15091a remote=127.0.0.1 fwd=n/a origin=n/a host=127.0.0.1:18789 ua=n/a code=1000 reason=n/a

6. CLI commands that fail completely:

openclaw browser status
gateway connect failed: Error: gateway closed (1000):
Error: gateway closed (1000 normal closure): no close reason

openclaw devices list --json
gateway connect failed: Error: gateway closed (1000):
[openclaw] Failed to start CLI: Error: gateway closed (1000 normal closure): no close reason

7. Restart instability:

Started openclaw-gateway.service
Stopping openclaw-gateway.service
Main process exited, code=exited, status=1/FAILURE
Failed with result 'exit-code'
Started openclaw-gateway.service

Impact and severity

Affected users/systems/channels:

  • Local OpenClaw CLI + Control UI users on 2026.3.13 loopback gateway
  • Browser/control workflows in the same runtime
  • Telegram channel health appears unaffected

Severity:

  • Partial workflow blocker, not just cosmetic noise

Frequency:

  • Recurrent / intermittent

Consequence:

  • Local CLI commands can fail with gateway closed (1000)
  • Local RPC can fail with missing scope: operator.read
  • Browser/control access becomes unreliable
  • Diagnostics become misleading

Additional information

No response

extent analysis

Fix Plan

To address the inconsistent behavior of the local loopback gateway in OpenClaw 2026.3.13, follow these steps:

  1. Update OpenClaw Configuration:

    • Ensure that the operator.read scope is properly configured and enabled for local connections.
    • Review and adjust the config.json file to include the necessary scopes for local RPC calls.
  2. Implement Session Management:

    • Enhance session management to handle connection churn and scope validation more robustly.
    • Consider implementing a session refresh mechanism to prevent scope validation errors.
  3. Websocket Connection Handling:

    • Improve websocket connection handling to reduce handshake timeouts and premature closures.
    • Implement retry logic for websocket connections to handle transient failures.
  4. CLI Command Handling:

    • Modify CLI command handling to gracefully handle gateway connection failures.
    • Implement retry logic for CLI commands to handle transient gateway connection issues.
  5. Gateway Restart Mechanism:

    • Enhance the gateway restart mechanism to prevent intermittent failures.
    • Consider implementing a retry mechanism for gateway restarts to ensure successful initialization.

Example Code Snippets

Session Management

// Example session management enhancement
const sessions = {};

// Validate scope for each session
function validateScope(sessionId, scope) {
  if (sessions[sessionId] && sessions[sessionId].scopes.includes(scope)) {
    return true;
  }
  return false;
}

// Refresh session scopes periodically
setInterval(() => {
  Object.keys(sessions).forEach((sessionId) => {
    // Refresh scopes for each session
    sessions[sessionId].scopes = getUpdatedScopes(sessionId);
  });
}, 60000); // Refresh every 1 minute

Websocket Connection Handling

// Example websocket connection handling enhancement
const ws = require('ws');

// Create a websocket connection with retry logic
function createWsConnection(url, options) {
  const wsOptions = { ...options, retry: true };
  const wsConnection = new ws(url, wsOptions);

  wsConnection.on('error', (error) => {
    console.error('Websocket connection error:', error);
    // Retry connection after a short delay
    setTimeout(() => {
      createWsConnection(url, options);
    }, 5000);
  });

  return wsConnection;
}

CLI Command Handling

// Example CLI command handling enhancement
const cli = require('cli');

// Execute CLI command with retry logic
function executeCliCommand(command, args) {
  cli.execute(command, args, (error, result) => {
    if (error) {
      console.error('CLI command error:', error);
      // Retry command after a short delay
      setTimeout(() => {
        executeCliCommand(command, args);
      }, 5000);
    } else {
      console.log('CLI command result:', result);
    }
  });

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

  • Local operator/control/CLI clients on loopback should resolve scopes consistently
  • status/system-presence/config.get should not randomly lose operator.read
  • browser/control websocket connections should remain stable
  • CLI commands such as browser status and devices list should not fail with gateway closed (1000)
  • gateway restart path should be stable and not require a failed first attempt before a successful second start

Still need to ship something?

×6

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

Back to top recommendations

TRENDING