Overview
OpenClawGatewayService turns OpenClaw Gateway traffic into frames, and frames into Gateway calls. The Gateway is the websocket an OpenClaw agent publishes for other programs to drive it, so a pipeline can start a run, redirect it while it’s going, and stop it.
An agent run is not a spoken turn. It can take minutes and it answers in prose, so the service deliberately reads and writes no conversational frames — what a run should sound like belongs to whatever wraps it. The usual shape is a voice loop that answers the user itself and forwards real work to the agent, so asking for something that takes ten minutes doesn’t cost you the conversation for ten minutes.
Example Implementation
Voice loop with an OpenClaw agent behind it
Installation
No extra required — the service is part of the base install.Prerequisites
A running OpenClaw agent with its Gateway enabled.openclaw gateway status reports which port it’s on and whether it’s running.
gateway.auth.token in ~/.openclaw/openclaw.json.
A NemoClaw sandbox prints its own token with
nemoclaw <sandbox> gateway-token --quiet and republishes the Gateway on port 18790, so a bot running outside
the sandbox points OPENCLAW_GATEWAY_URL at that port.Configuration
The Gateway websocket, or the port a NemoClaw sandbox republishes it on.
Maximum time, in seconds, to wait for the Gateway to acknowledge the closing
handshake before dropping the connection.
Maximum time, in seconds, a single send may wait on a Gateway that has stopped
reading before the connection is dropped.
None waits indefinitely.Properties
client
Frames
Sent to the service:
Pushed by the service:
status is "completed", "cancelled", or "failed".
Usage
Notes
- One run at a time: a session runs one turn at a time, so a send arriving while a run is live stops that run first.
- Paired frames: every
OpenClawStartedFrameis followed by exactly oneOpenClawEndFrame, whatever the outcome. - Connects during setup: the Gateway connection is established in
setup(), before frames start flowing, rather than on theStartFrame.