Problem
When running multiple OpenClaw agents on the same machine (each with its own Gateway on a different port), the openclaw agent CLI always connects to a hardcoded local port (18789) and ignores gateway.remote.url from the config file.
This makes it impossible for one agent to trigger another agent's Gateway directly via CLI — which is the documented approach for bot-to-bot communication.
Current behavior
OPENCLAW_CONFIG_PATH=/root/.openclaw-poseidon/openclaw.json openclaw agent --agent main --message "Hello" --deliver
Even with gateway.remote.url: ws://127.0.0.1:19000 set in the config, the CLI connects to ws://127.0.0.1:18789 (default port) and fails with:
gateway connect failed: unauthorized: gateway token mismatch
Gateway target: ws://127.0.0.1:18789
Expected behavior
Either:
- A
--url <ws://host:port> flag to explicitly target a specific Gateway
- OR: The CLI respects
gateway.remote.url from the specified config file
Use case
Multi-agent Council setup: Three OpenClaw agents (Kronos, Poseidon, Hades) each on their own port, communicating through a shared Discord channel. Agent A wants to trigger Agent B's session with --deliver to post a reply in the channel.
Workaround
Currently no clean workaround. sessions_send works inter-session but does NOT post visibly to Discord. openclaw message send can post to Discord but does not trigger the agent logic.
Environment
- OpenClaw version: 2026.3.23-2
- OS: Ubuntu 24.04
- Setup: 3 agents on ports 18789, 19000, 18790
Problem
When running multiple OpenClaw agents on the same machine (each with its own Gateway on a different port), the
openclaw agentCLI always connects to a hardcoded local port (18789) and ignoresgateway.remote.urlfrom the config file.This makes it impossible for one agent to trigger another agent's Gateway directly via CLI — which is the documented approach for bot-to-bot communication.
Current behavior
OPENCLAW_CONFIG_PATH=/root/.openclaw-poseidon/openclaw.json openclaw agent --agent main --message "Hello" --deliverEven with
gateway.remote.url: ws://127.0.0.1:19000set in the config, the CLI connects tows://127.0.0.1:18789(default port) and fails with:Expected behavior
Either:
--url <ws://host:port>flag to explicitly target a specific Gatewaygateway.remote.urlfrom the specified config fileUse case
Multi-agent Council setup: Three OpenClaw agents (Kronos, Poseidon, Hades) each on their own port, communicating through a shared Discord channel. Agent A wants to trigger Agent B's session with
--deliverto post a reply in the channel.Workaround
Currently no clean workaround.
sessions_sendworks inter-session but does NOT post visibly to Discord.openclaw message sendcan post to Discord but does not trigger the agent logic.Environment