Deep troubleshooting
Symptom-first diagnostics with exact command ladders and log signatures.
Configuration
Task-oriented setup guide + full configuration reference.
Secrets management
SecretRef contract, runtime snapshot behavior, and migrate/reload operations.
Secrets plan contract
Exact
secrets apply target/path rules and ref-only auth-profile behavior.5-minute local startup
Verify service health
Runtime: running, Connectivity probe: ok, and Capability: ... that matches what you expect. Use openclaw gateway status --require-rpc when you need read-scope RPC proof, not just reachability.Gateway config reload watches the active config file path (resolved from profile/state defaults, or
OPENCLAW_CONFIG_PATH when set).
Default mode is gateway.reload.mode="hybrid".
After the first successful load, the running process serves the active in-memory config snapshot; successful reload swaps that snapshot atomically.Runtime model
- One always-on process for routing, control plane, and channel connections.
- Single multiplexed port for:
- WebSocket control/RPC
- HTTP APIs, OpenAI compatible (
/v1/models,/v1/embeddings,/v1/chat/completions,/v1/responses,/tools/invoke) - Control UI and hooks
- Default bind mode:
loopback. - Auth is required by default. Shared-secret setups use
gateway.auth.token/gateway.auth.password(orOPENCLAW_GATEWAY_TOKEN/OPENCLAW_GATEWAY_PASSWORD), and non-loopback reverse-proxy setups can usegateway.auth.mode: "trusted-proxy".
OpenAI-compatible endpoints
OpenClaw’s highest-leverage compatibility surface is now:GET /v1/modelsGET /v1/models/{id}POST /v1/embeddingsPOST /v1/chat/completionsPOST /v1/responses
- Most Open WebUI, LobeChat, and LibreChat integrations probe
/v1/modelsfirst. - Many RAG and memory pipelines expect
/v1/embeddings. - Agent-native clients increasingly prefer
/v1/responses.
/v1/modelsis agent-first: it returnsopenclaw,openclaw/default, andopenclaw/<agentId>.openclaw/defaultis the stable alias that always maps to the configured default agent.- Use
x-openclaw-modelwhen you want a backend provider/model override; otherwise the selected agent’s normal model and embedding setup stays in control.
Port and bind precedence
| Setting | Resolution order |
|---|---|
| Gateway port | --port → OPENCLAW_GATEWAY_PORT → gateway.port → 18789 |
| Bind mode | CLI/override → gateway.bind → loopback |
--bind lan --port 3000
seeds http://localhost:3000 and http://127.0.0.1:3000 before runtime
validation runs. Add any remote browser origins, such as HTTPS proxy URLs, to
gateway.controlUi.allowedOrigins explicitly.
Hot reload modes
gateway.reload.mode | Behavior |
|---|---|
off | No config reload |
hot | Apply only hot-safe changes |
restart | Restart on reload-required changes |
hybrid (default) | Hot-apply when safe, restart when required |
Operator command set
gateway status --deep is for extra service discovery (LaunchDaemons/systemd system
units/schtasks), not a deeper RPC health probe.
Multiple gateways (same host)
Most installs should run one gateway per machine. A single gateway can host multiple agents and channels. You only need multiple gateways when you intentionally want isolation or a rescue bot. Useful checks:gateway status --deepcan reportOther gateway-like services detected (best effort)and print cleanup hints when stale launchd/systemd/schtasks installs are still around.gateway probecan warn aboutmultiple reachable gatewayswhen more than one target answers.- If that is intentional, isolate ports, config/state, and workspace roots per gateway.
- Unique
gateway.port - Unique
OPENCLAW_CONFIG_PATH - Unique
OPENCLAW_STATE_DIR - Unique
agents.defaults.workspace
VoiceClaw real-time brain endpoint
OpenClaw exposes a VoiceClaw-compatible real-time WebSocket endpoint at/voiceclaw/realtime. Use it when a VoiceClaw desktop client should talk
directly to a real-time OpenClaw brain instead of going through a separate relay
process.
The endpoint uses Gemini Live for real-time audio and calls OpenClaw as the
brain by exposing OpenClaw tools directly to Gemini Live. Tool calls return an
immediate working result to keep the voice turn responsive, then OpenClaw
executes the actual tool asynchronously and injects the result back into the
live session. Set GEMINI_API_KEY in the gateway process environment. If
gateway auth is enabled, the desktop client sends the gateway token or password
in its first session.config message.
Real-time brain access runs owner-authorized OpenClaw agent commands. Keep
gateway.auth.mode: "none" limited to loopback-only test instances. Non-local
real-time brain connections require gateway auth.
For an isolated test gateway, run a separate instance with its own port, config,
and state:
Remote access
Preferred: Tailscale/VPN. Fallback: SSH tunnel.ws://127.0.0.1:18789.
See: Remote Gateway, Authentication, Tailscale.
Supervision and service lifecycle
Use supervised runs for production-like reliability.- macOS (launchd)
- Linux (systemd user)
- Windows (native)
- Linux (system service)
openclaw gateway restart for restarts. Do not chain openclaw gateway stop and openclaw gateway start; on macOS, gateway stop intentionally disables the LaunchAgent before stopping it.LaunchAgent labels are ai.openclaw.gateway (default) or ai.openclaw.<profile> (named profile). openclaw doctor audits and repairs service config drift.Dev profile quick path
19001.
Protocol quick reference (operator view)
- First client frame must be
connect. - Gateway returns
hello-oksnapshot (presence,health,stateVersion,uptimeMs, limits/policy). hello-ok.features.methods/eventsare a conservative discovery list, not a generated dump of every callable helper route.- Requests:
req(method, params)→res(ok/payload|error). - Common events include
connect.challenge,agent,chat,session.message,session.tool,sessions.changed,presence,tick,health,heartbeat, pairing/approval lifecycle events, andshutdown.
- Immediate accepted ack (
status:"accepted") - Final completion response (
status:"ok"|"error"), with streamedagentevents in between.
Operational checks
Liveness
- Open WS and send
connect. - Expect
hello-okresponse with snapshot.
Readiness
Gap recovery
Events are not replayed. On sequence gaps, refresh state (health, system-presence) before continuing.
Common failure signatures
| Signature | Likely issue |
|---|---|
refusing to bind gateway ... without auth | Non-loopback bind without a valid gateway auth path |
another gateway instance is already listening / EADDRINUSE | Port conflict |
Gateway start blocked: set gateway.mode=local | Config set to remote mode, or local-mode stamp is missing from a damaged config |
unauthorized during connect | Auth mismatch between client and gateway |
Safety guarantees
- Gateway protocol clients fail fast when Gateway is unavailable (no implicit direct-channel fallback).
- Invalid/non-connect first frames are rejected and closed.
- Graceful shutdown emits
shutdownevent before socket close.
Related: