Skip to content

Loopback connections require device pairing on every gateway restart (2026.2.19) #21647

@borntobeyours

Description

@borntobeyours

Bug Description

After upgrading to OpenClaw 2026.2.19-2, loopback (ws://127.0.0.1:18789) connections require device pairing approval on every gateway restart. Previously, loopback connections were auto-approved.

Environment

  • OpenClaw: 2026.2.19-2 (45d9b20)
  • OS: macOS 26.2 (arm64)
  • Node: v25.4.0
  • Gateway bind: loopback
  • Auth: token mode

Steps to Reproduce

  1. Fresh install or upgrade to 2026.2.19-2
  2. Set gateway.bind: "loopback" in ~/.openclaw/openclaw.json
  3. Start gateway: openclaw gateway start
  4. Device pairs successfully (via Control UI approval)
  5. Restart gateway: openclaw gateway restart
  6. All tool calls that use gateway WS now fail with: gateway closed (1008): pairing required

Expected Behavior

Loopback connections should auto-approve device pairing (as documented in security docs: "Device pairing is auto-approved for local connects (loopback or the gateway host's own tailnet address)").

Actual Behavior

After any gateway restart, the device pairing state is lost or invalidated. Tools that connect via gateway WS (sessions_spawn, sessions_list, cron, etc.) fail with "pairing required". The nodes tool sometimes works (read-only scope) while write operations fail.

Observations

  • ~/.openclaw/identity/device.json exists with valid keys
  • ~/.openclaw/devices/paired.json contains the local device with matching deviceId
  • ~/.openclaw/identity/device-auth.json has operator token
  • Device IS in paired list but gateway still rejects connections after restart
  • Manually approving via Control UI fixes it temporarily until next restart
  • openclaw status CLI command works fine (different connection path?)
  • Non-loopback bind (lan) triggers separate SECURITY ERROR for ws:// to non-loopback

Workaround

Manually approve the device via Control UI (http://127.0.0.1:18789/) after every gateway restart.

Impact

  • Sub-agent spawning broken after restarts
  • Cron jobs cannot execute
  • Session management tools unavailable
  • Requires manual intervention after every restart/update

Metadata

Metadata

Assignees

No one assigned

    Labels

    staleMarked as stale due to inactivity

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions