Skip to content

[Feature]: Cross-gateway messaging (sessions_send between machines) #43605

Description

@SPFAdvisors

Description

sessions_send only works within the same gateway. In multi-machine setups (e.g., agents split across a MacBook, iMac, and Mac Studio each running their own gateway), there's no native way for agents on different gateways to communicate.

Environment

  • OpenClaw 2026.3.8
  • 3 machines: MacBook (1 agent), iMac (7 agents), Mac Studio (1 agent)
  • Each running its own gateway instance
  • Connected via Tailscale

Current State

  • sessions_send validates agent IDs against local config and fails if the target agent isn't on the same gateway
  • openclaw agent with OPENCLAW_GATEWAY_URL pointing to a remote gateway also doesn't work — CLI validates agent IDs locally first
  • The only working cross-gateway communication method is SSH + openclaw agent --agent <id> --message '<text>' on the remote machine

Proposed Solutions

  1. Gateway federation — gateways discover each other (via Tailscale, mDNS, or manual config) and can route sessions_send to remote agents
  2. Remote agent registry — config option to register agents on remote gateways: remoteAgents: [{id: "jarvis", gateway: "ws://100.82.32.94:18789"}]
  3. Message relay — a lightweight relay that accepts messages and forwards them to the correct gateway based on agent ID

Current Workaround

SSH scripts with base64 encoding (msg-jarvis, msg-pepper) that shell into the remote machine and run openclaw agent. Works but fragile — requires SSH key setup, correct PATH exports, and doesn't integrate with session history.

Impact

Essential for anyone running a distributed agent setup. As OpenClaw grows, multi-machine deployments will become more common (home server + laptop, office + cloud, etc.).

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High-priority user-facing bug, regression, or broken workflow.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:needs-security-reviewClawSweeper marked this issue as needing security-sensitive review.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.impact:securitySecurity boundary, credential, authz, sandbox, or sensitive-data risk.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.maturity:stableIssue affects a taxonomy feature currently scored M4/M5.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions