Skip to content

gateway probe: false positive "multiple reachable gateways" when SSH tunnel + remote.url hit the same gateway #69135

@sk8man121

Description

@sk8man121

Summary

openclaw gateway probe reports "Unconventional setup: multiple reachable gateways detected" when there is a single logical gateway but two successful probe transports (SSH tunnel + direct WebSocket URL to the same host).

Symptom

  • With gateway.mode=remote, gateway.remote.sshTarget set (SSH tunnel succeeds), and gateway.remote.url pointing at the same logical gateway over a direct path (e.g. ws://chromebox:18789), the probe succeeds for both targets but emits a multiple gateways warning.
  • Both probe targets succeed; behavior matches one gateway, two transports, not two distinct gateways.

Context

buildGatewayStatusWarnings treats reachable.length > 1 as multiple gateways. When an SSH tunnel target is in play, the probe includes both the tunnel URL and the configured gateway.remote.url, so two successes can mean redundant paths to one identity—not two separate gateway instances.

Relevant upstream sources (current main):

Environment

  • OpenClaw: 2026.4.15 (Homebrew); bundled gateway-status-B2JeYHAg.js contains the same logic (e.g. line ~408 for targets construction).
  • Client: macOS (thin client)
  • Gateway: Linux (remote)

Expected behavior

Either:

  • No warning when all reachable targets resolve to the same gateway identity (self / presence from pickGatewaySelfPresence), or
  • A clearer warning that distinguishes "same gateway, multiple transports" from "multiple distinct gateways".

Actual behavior

A misleading multiple_gateways warning despite a single logical gateway.

Possible fixes

  1. Dedupe by gateway identity — Before emitting multiple_gateways, collapse reachable entries that share the same non-null identity key (e.g. normalized host + ip from pickGatewaySelfPresence). Only warn when ≥ 2 distinct identities (define policy for probes with self == null).
  2. Skip redundant configRemote when tunnel is active — Narrower change; tradeoff: loses automatic direct-path check unless probe --url or explicit second target is used.
  3. Improve warning copy — If reachable.length > 1 but identities match, downgrade to an informational line instead of "multiple gateways."

Repro steps

  1. On the client, configure remote mode with both SSH tunnel target and direct URL to the same gateway (placeholders only):
{
  "gateway": {
    "mode": "remote",
    "remote": {
      "sshTarget": "user@gateway-host",
      "url": "ws://gateway-host:18789",
      "token": "${OPENCLAW_GATEWAY_TOKEN}"
    }
  }
}
  1. Ensure SSH resolves (e.g. ~/.ssh/config Host entry) and the direct ws:// URL is reachable on the LAN.
  2. Run: openclaw gateway probe
  3. Observe two successful targets (e.g. Remote over SSH ws://127.0.0.1:18789 and Remote (configured) ws://gateway-host:18789) plus the multiple-gateways warning.

Tests

Existing: src/commands/gateway-status/helpers.test.ts. Consider adding output.test.ts (or extending an existing suite) for buildGatewayStatusWarnings / multiple_gateways when two probes share identity.

Docs

Warning currently references: Gateway — multiple gateways same host

Suggested labels

bug, cli, gateway

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal backlog priority with limited blast radius.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.

    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