openclaw - ✅(Solved) Fix Bug: gateway.auth.mode "none" breaks subagent spawning with "device identity required" [1 pull requests, 1 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#75780Fetched 2026-05-02 05:30:19
View on GitHub
Comments
1
Participants
2
Timeline
2
Reactions
2
Timeline (top)
commented ×1cross-referenced ×1

When gateway.auth.mode is set to "none" (a documented, valid configuration for trusted local loopback setups), all internal backend RPC connections fail with WebSocket close code 1008: "device identity required". This silently breaks:

  • sessions_spawn / subagent spawning from within agent sessions
  • In-process gateway tool calls (e.g., config.schema.lookup, config.patch)
  • CLI commands that open new connections to the gateway

Existing connections (main session, web UI) continue working because they were established before the gateway restart or reconnected successfully.

Error Message

  • The error message sends users down the wrong diagnostic path (device pairing issues)

Root Cause

In src/gateway/server/ws-connection/handshake-auth-helpers.ts, the shouldSkipLocalBackendSelfPairing function determines whether internal backend RPC connections (from gateway-client / backend mode clients) can skip device identity pairing:

const usesSharedSecretAuth = params.authMethod === "token" || params.authMethod === "password";

When auth.mode: "none", the authMethod resolves to "none" and sharedAuthOk is true (since no auth is needed), but usesSharedSecretAuth evaluates to false because "none" is not in the check. This means the backend self-pairing skip never triggers, forcing device identity checks that the internal spawner does not satisfy.

Fix Action

Workaround

Change gateway.auth.mode from "none" to "token" (keep the existing token in config). This makes usesSharedSecretAuth return true and the backend self-pairing skip works correctly.

PR fix notes

PR #75781: fix(gateway): include auth mode "none" in backend self-pairing skip

Description (problem / solution / changelog)

Summary

Fixes #75780

When gateway.auth.mode is "none", internal backend RPC connections (subagent spawns, gateway tool calls) fail with "device identity required" because shouldSkipLocalBackendSelfPairing only recognized "token" and "password" as valid shared-secret auth methods.

Changes

  • handshake-auth-helpers.ts: Added "none" to the usesSharedSecretAuth check in shouldSkipLocalBackendSelfPairing
  • handshake-auth-helpers.test.ts: Added test cases for authMethod: "none" covering:
    • direct_local + sharedAuthOk: true + auth:none → skip (true) ✅
    • shared_secret_loopback_local + sharedAuthOk: true + auth:none → skip (true) ✅
    • remote + auth:none → no skip (false) ✅
    • direct_local + sharedAuthOk: false + auth:none → no skip (false) ✅

Testing

Tests were added but could not be validated locally due to OOM constraints on the development machine. CI should confirm all tests pass.

Security Impact

None. auth.mode: "none" is only valid for trusted local loopback (as documented). The fix simply ensures backend RPCs on that trusted loopback are not incorrectly rejected.

Co-Authored-By: Paperclip [email protected]

Changed files

  • src/gateway/server/ws-connection/auth-context.state.test.ts (modified, +22/-0)
  • src/gateway/server/ws-connection/auth-context.ts (modified, +2/-1)
  • src/gateway/server/ws-connection/handshake-auth-helpers.test.ts (modified, +47/-0)
  • src/gateway/server/ws-connection/handshake-auth-helpers.ts (modified, +4/-1)

Code Example

const usesSharedSecretAuth = params.authMethod === "token" || params.authMethod === "password";

---

const usesSharedSecretAuth = params.authMethod === "token" || params.authMethod === "password" || params.authMethod === "none";
RAW_BUFFERClick to expand / collapse

Summary

When gateway.auth.mode is set to "none" (a documented, valid configuration for trusted local loopback setups), all internal backend RPC connections fail with WebSocket close code 1008: "device identity required". This silently breaks:

  • sessions_spawn / subagent spawning from within agent sessions
  • In-process gateway tool calls (e.g., config.schema.lookup, config.patch)
  • CLI commands that open new connections to the gateway

Existing connections (main session, web UI) continue working because they were established before the gateway restart or reconnected successfully.

Root Cause

In src/gateway/server/ws-connection/handshake-auth-helpers.ts, the shouldSkipLocalBackendSelfPairing function determines whether internal backend RPC connections (from gateway-client / backend mode clients) can skip device identity pairing:

const usesSharedSecretAuth = params.authMethod === "token" || params.authMethod === "password";

When auth.mode: "none", the authMethod resolves to "none" and sharedAuthOk is true (since no auth is needed), but usesSharedSecretAuth evaluates to false because "none" is not in the check. This means the backend self-pairing skip never triggers, forcing device identity checks that the internal spawner does not satisfy.

Reproduction

  1. Set gateway.auth.mode to "none" in openclaw.json
  2. Restart the gateway
  3. Attempt to spawn a subagent or use the gateway tool from an active session
  4. Observe: gateway closed (1008): device identity required

Expected Behavior

Internal backend RPC connections on local loopback should skip device identity pairing when auth.mode: "none", since "none" means auth is already satisfied.

Environment

  • OpenClaw 2026.4.27
  • Linux x64, Node 22.22.2
  • gateway.auth.mode: "none", gateway.bind: "loopback"

Workaround

Change gateway.auth.mode from "none" to "token" (keep the existing token in config). This makes usesSharedSecretAuth return true and the backend self-pairing skip works correctly.

Proposed Fix

Add "none" to the usesSharedSecretAuth check:

const usesSharedSecretAuth = params.authMethod === "token" || params.authMethod === "password" || params.authMethod === "none";

PR with fix + tests incoming.

Impact

  • "none" is a documented config option ("use only for trusted local loopback setups")
  • The error message sends users down the wrong diagnostic path (device pairing issues)
  • The failure is silent — no startup warning, no doctor check
  • First-time users who skip auth during onboarding will have broken subagents

extent analysis

TL;DR

To fix the issue, update the usesSharedSecretAuth check in handshake-auth-helpers.ts to include "none" as a valid auth method.

Guidance

  • Verify the issue by setting gateway.auth.mode to "none" and attempting to spawn a subagent or use the gateway tool from an active session.
  • Apply the proposed fix by adding "none" to the usesSharedSecretAuth check: const usesSharedSecretAuth = params.authMethod === "token" || params.authMethod === "password" || params.authMethod === "none";.
  • As a temporary workaround, change gateway.auth.mode from "none" to "token" (keeping the existing token in config) to make usesSharedSecretAuth return true.
  • Test the fix by restarting the gateway and attempting to spawn a subagent or use the gateway tool from an active session.

Example

const usesSharedSecretAuth = params.authMethod === "token" || params.authMethod === "password" || params.authMethod === "none";

Notes

The proposed fix assumes that adding "none" to the usesSharedSecretAuth check will correctly skip device identity pairing for internal backend RPC connections when auth.mode is set to "none". However, this fix may have unintended consequences and should be thoroughly tested.

Recommendation

Apply the proposed fix by updating the usesSharedSecretAuth check to include "none" as a valid auth method, as this directly addresses the root cause of the issue.

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…

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.auth.mode "none" breaks subagent spawning with "device identity required" [1 pull requests, 1 comments, 2 participants]