packages/adapters/openclaw-gateway/README.md
This document describes how @paperclipai/adapter-openclaw-gateway invokes OpenClaw over the Gateway protocol.
This adapter always uses WebSocket gateway transport.
ws:// or wss://connect.challengereq connect (protocol/client/auth/device payload)req agentreq agent.waitevent agent frames into Paperclip logs/transcript parsingGateway credentials can be provided in any of these ways:
authToken / token in adapter configheaders.x-openclaw-tokenheaders.x-openclaw-auth (legacy)password (shared password mode)When a token is present and authorization header is missing, the adapter derives Authorization: Bearer <token>.
By default the adapter sends a signed device payload in connect params.
disableDeviceAuth=true to omit device signingdevicePrivateKeyPem to pin a stable signing keydevicePrivateKeyPem, the adapter generates an ephemeral Ed25519 keypair per runautoPairOnFirstConnect is enabled (default), the adapter handles one initial pairing required by calling device.pair.list + device.pair.approve over shared auth, then retries once.The adapter supports the same session routing model as HTTP OpenClaw mode:
sessionKeyStrategy=issue|fixed|runsessionKey is used when strategy is fixedResolved session key is sent as agent.sessionKey.
The agent request is built as:
message (wake text plus optional payloadTemplate.message/payloadTemplate.text prefix)idempotencyKey (Paperclip runId)sessionKey (resolved strategy)payloadTemplate fields merged inagentId from config if set and not already in templatetimeoutSec controls adapter-level request budgetwaitTimeoutMs controls agent.wait.timeoutMsIf agent.wait returns timeout, adapter returns openclaw_gateway_wait_timeout.
Structured gateway event logs use:
[openclaw-gateway] ... for lifecycle/system logs[openclaw-gateway:event] run=<id> stream=<stream> data=<json> for event agent framesUI/CLI parsers consume these lines to render transcript updates.