गहन समस्या-निवारण
सटीक कमांड लैडर और लॉग सिग्नेचर के साथ लक्षण-प्रथम निदान।
कॉन्फ़िगरेशन
कार्य-उन्मुख सेटअप गाइड + पूर्ण कॉन्फ़िगरेशन संदर्भ।
सीक्रेट्स प्रबंधन
SecretRef अनुबंध, रनटाइम स्नैपशॉट व्यवहार, और माइग्रेट/रीलोड संचालन।
सीक्रेट्स प्लान अनुबंध
सटीक
secrets apply लक्ष्य/पथ नियम और केवल-ref auth-profile व्यवहार।5-मिनट का स्थानीय स्टार्टअप
सेवा स्वास्थ्य सत्यापित करें
Runtime: running, Connectivity probe: ok, और Capability: ... जो आपकी अपेक्षा से मेल खाता हो। जब आपको केवल पहुंच-योग्यता नहीं, बल्कि read-scope RPC प्रमाण चाहिए, तो openclaw gateway status --require-rpc का उपयोग करें।Gateway कॉन्फ़िग रीलोड सक्रिय कॉन्फ़िग फ़ाइल पथ को देखता है (profile/state डिफ़ॉल्ट से resolve किया गया, या सेट होने पर
OPENCLAW_CONFIG_PATH से)।
डिफ़ॉल्ट मोड gateway.reload.mode="hybrid" है।
पहले सफल लोड के बाद, चल रही प्रक्रिया सक्रिय इन-मेमोरी कॉन्फ़िग स्नैपशॉट परोसती है; सफल रीलोड उस स्नैपशॉट को atomic रूप से बदल देता है।रनटाइम मॉडल
- रूटिंग, control plane, और चैनल कनेक्शन के लिए एक हमेशा-ऑन प्रक्रिया।
- इसके लिए एकल multiplexed पोर्ट:
- WebSocket control/RPC
- HTTP API (
/v1/models,/v1/embeddings,/v1/chat/completions,/v1/responses,/tools/invoke) - Plugin HTTP रूट, जैसे वैकल्पिक
/api/v1/admin/rpc - Control UI और hooks
- डिफ़ॉल्ट bind मोड:
loopback। - Auth डिफ़ॉल्ट रूप से आवश्यक है। Shared-secret सेटअप
gateway.auth.token/gateway.auth.password(याOPENCLAW_GATEWAY_TOKEN/OPENCLAW_GATEWAY_PASSWORD) का उपयोग करते हैं, और non-loopback reverse-proxy सेटअपgateway.auth.mode: "trusted-proxy"का उपयोग कर सकते हैं।
OpenAI-compatible endpoints
OpenClaw की सबसे उच्च-प्रभाव वाली compatibility surface अब है:GET /v1/modelsGET /v1/models/{id}POST /v1/embeddingsPOST /v1/chat/completionsPOST /v1/responses
- अधिकांश Open WebUI, LobeChat, और LibreChat इंटीग्रेशन पहले
/v1/modelsजांचते हैं। - कई RAG और memory pipelines
/v1/embeddingsकी अपेक्षा करते हैं। - Agent-native clients तेजी से
/v1/responsesको प्राथमिकता देते हैं।
/v1/modelsagent-first है: यहopenclaw,openclaw/default, औरopenclaw/<agentId>लौटाता है।openclaw/defaultस्थिर alias है जो हमेशा configured default agent पर map होता है।- जब आप backend provider/model override चाहते हैं, तो
x-openclaw-modelका उपयोग करें; अन्यथा चयनित agent का सामान्य model और embedding setup नियंत्रण में रहता है।
POST /api/v1/admin/rpc) host tooling के लिए एक अलग, default-off Plugin रूट है जो WebSocket RPC का उपयोग नहीं कर सकता। Admin HTTP RPC देखें।
पोर्ट और bind प्राथमिकता
| सेटिंग | Resolution order |
|---|---|
| Gateway पोर्ट | --port → OPENCLAW_GATEWAY_PORT → gateway.port → 18789 |
| Bind मोड | CLI/override → gateway.bind → loopback |
--port को supervisor metadata में रिकॉर्ड करती हैं। gateway.port बदलने के बाद, openclaw doctor --fix या openclaw gateway install --force चलाएं ताकि launchd/systemd/schtasks प्रक्रिया को नए पोर्ट पर शुरू करें।
Gateway startup non-loopback binds के लिए स्थानीय
Control UI origins seed करते समय उसी effective port और bind का उपयोग करता है। उदाहरण के लिए, --bind lan --port 3000
runtime validation चलने से पहले http://localhost:3000 और http://127.0.0.1:3000
seed करता है। किसी भी remote browser origins, जैसे HTTPS proxy URLs, को
gateway.controlUi.allowedOrigins में स्पष्ट रूप से जोड़ें।
Hot reload modes
gateway.reload.mode | व्यवहार |
|---|---|
off | कोई config reload नहीं |
hot | केवल hot-safe बदलाव लागू करें |
restart | reload-required बदलावों पर restart करें |
hybrid (default) | सुरक्षित होने पर hot-apply करें, आवश्यक होने पर restart करें |
Operator command set
gateway status --deep अतिरिक्त service discovery (LaunchDaemons/systemd system
units/schtasks) के लिए है, न कि गहरी RPC health probe के लिए।
Multiple gateways (same host)
अधिकांश इंस्टॉल में प्रति मशीन एक gateway चलना चाहिए। एक single gateway कई agents और channels host कर सकता है। आपको multiple gateways केवल तब चाहिए जब आप जानबूझकर isolation या rescue bot चाहते हों। उपयोगी जांचें:gateway status --deepOther gateway-like services detected (best effort)रिपोर्ट कर सकता है और stale launchd/systemd/schtasks installs अभी भी मौजूद होने पर cleanup hints print कर सकता है।gateway probedistinct gateways के जवाब देने पर, या जब OpenClaw यह prove नहीं कर सकता कि reachable targets वही gateway हैं,multiple reachable gateway identitiesके बारे में warn कर सकता है। उसी gateway के लिए SSH tunnel, proxy URL, या configured remote URL multiple transports वाला एक gateway है, भले ही transport ports अलग हों।- यदि यह जानबूझकर है, तो प्रति gateway ports, config/state, और workspace roots isolate करें।
- Unique
gateway.port - Unique
OPENCLAW_CONFIG_PATH - Unique
OPENCLAW_STATE_DIR - Unique
agents.defaults.workspace
Remote access
प्राथमिकता: Tailscale/VPN। Fallback: SSH tunnel।ws://127.0.0.1:18789 से connect करें।
देखें: Remote Gateway, Authentication, Tailscale.
Supervision and service lifecycle
production-like reliability के लिए supervised runs का उपयोग करें।- macOS (launchd)
- Linux (systemd user)
- Windows (native)
- Linux (system service)
openclaw gateway restart का उपयोग करें। restart substitute के रूप में openclaw gateway stop और openclaw gateway start को chain न करें।macOS पर, gateway stop डिफ़ॉल्ट रूप से launchctl bootout का उपयोग करता है — यह disable persist किए बिना current boot session से LaunchAgent को remove करता है, इसलिए unexpected crashes के बाद भी KeepAlive auto-recovery काम करती है और gateway start cleanly re-enable करता है। reboots के पार auto-respawn को persistently suppress करने के लिए, --disable pass करें: openclaw gateway stop --disable।LaunchAgent labels ai.openclaw.gateway (default) या ai.openclaw.<profile> (named profile) हैं। openclaw doctor service config drift का audit और repair करता है।Dev profile quick path
19001 शामिल हैं।
Protocol quick reference (operator view)
- पहला client frame
connectहोना चाहिए। - Gateway
hello-oksnapshot (presence,health,stateVersion,uptimeMs, limits/policy) लौटाता है। hello-ok.features.methods/eventsconservative discovery list हैं, हर callable helper route का generated dump नहीं।- Requests:
req(method, params)→res(ok/payload|error)। - सामान्य events में
connect.challenge,agent,chat,session.message,session.operation,session.tool,sessions.changed,presence,tick,health,heartbeat, pairing/approval lifecycle events, औरshutdownशामिल हैं।
- Immediate accepted ack (
status:"accepted") - Final completion response (
status:"ok"|"error"), बीच में streamedagentevents के साथ।
Operational checks
Liveness
- WS खोलें और
connectभेजें। - snapshot के साथ
hello-okresponse की अपेक्षा करें।
Readiness
Gap recovery
Events replay नहीं किए जाते। sequence gaps पर, जारी रखने से पहले state (health, system-presence) refresh करें।
Common failure signatures
| हस्ताक्षर | संभावित समस्या |
|---|---|
refusing to bind gateway ... without auth | मान्य Gateway प्रमाणीकरण पथ के बिना गैर-loopback बाइंड |
another gateway instance is already listening / EADDRINUSE | पोर्ट टकराव |
Gateway start blocked: set gateway.mode=local | कॉन्फिग रिमोट मोड पर सेट है, या क्षतिग्रस्त कॉन्फिग से local-mode स्टैम्प गायब है |
unauthorized during connect | क्लाइंट और Gateway के बीच प्रमाणीकरण बेमेल |
सुरक्षा गारंटियां
- Gateway प्रोटोकॉल क्लाइंट Gateway अनुपलब्ध होने पर तुरंत विफल होते हैं (कोई अंतर्निहित डायरेक्ट-चैनल फॉलबैक नहीं)।
- अमान्य/नॉन-कनेक्ट पहले फ्रेम अस्वीकार करके बंद कर दिए जाते हैं।
- व्यवस्थित शटडाउन सॉकेट बंद होने से पहले
shutdownइवेंट उत्सर्जित करता है।
संबंधित: