You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 0015076
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: docs/gateway/cli-backends.md
+37-13Lines changed: 37 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -116,6 +116,29 @@ The `openclaw agent` command also has its own request deadline. Its 600-second f
116
116
117
117
### Claude CLI specifics
118
118
119
+
OpenClaw's managed Claude stdio sessions require the `msg_lifecycle_v1`
120
+
capability, first observed in the published Claude Code 2.1.206 build. At
121
+
runtime OpenClaw does not trust the version string alone: it waits for
122
+
Claude Code's `system/init` record to advertise `msg_lifecycle_v1`, then accepts
123
+
assistant, tool, and result records only after the matching input lifecycle has
124
+
started. Unknown capabilities are ignored. A CLI that omits the required
125
+
capability fails immediately with `claude update` and gateway-restart guidance
126
+
instead of waiting for the no-output watchdog.
127
+
128
+
Setup and Doctor treat 2.1.206 as advisory, so a lower-version compatible
129
+
backport or wrapper remains selectable and is verified by the runtime gate.
130
+
131
+
```bash
132
+
claude --version
133
+
claude update
134
+
# Restart the OpenClaw gateway after updating.
135
+
```
136
+
137
+
Claude Code's public CLI documentation covers stream-json mode and updates but
138
+
does not currently document the lifecycle event itself. OpenClaw therefore
139
+
feature-detects the advertised capability; 2.1.206 is the first published
140
+
Claude Code build observed to provide it.
141
+
119
142
The bundled `claude-cli` backend prefers Claude Code's native skill resolver. When the current skills snapshot has at least one selected skill with a materialized path, OpenClaw passes a temporary Claude Code plugin via `--plugin-dir` and omits the duplicate OpenClaw skills catalog from the appended system prompt. Without a materialized plugin skill, OpenClaw keeps the prompt catalog as a fallback. Skill env/API key overrides still apply to the child process environment for the run.
120
143
121
144
Claude CLI has its own noninteractive permission mode; OpenClaw maps that to the existing exec policy instead of adding Claude-specific config. For OpenClaw-managed Claude live sessions, the effective exec policy is authoritative: YOLO (`tools.exec.mode: "full"`) normally launches Claude with `--permission-mode bypassPermissions`, while a restrictive policy launches it with `--permission-mode default`. Root-run gateways also use `default` because Claude Code rejects bypass mode for root. Per-agent `agents.entries.*.tools.exec` settings override the global `tools.exec` for that agent. The Anthropic plugin normalizes Claude's permission flags to match the effective policy and host restriction.
@@ -202,19 +225,20 @@ Anthropic owns `claude-cli` and Google owns `google-gemini-cli`. OpenAI Codex ag
202
225
203
226
The bundled Anthropic plugin registers for `claude-cli`:
return`${params.label}${params.requirement.minimumVersion} is the first published build known to advertise ${params.requirement.capability}; found ${params.version}. OpenClaw verifies this capability at runtime. If this build is rejected, run \`${params.requirement.updateCommand}\`, restart OpenClaw, and retry.`;
0 commit comments