@enderfga/claw-orchestrator 4.8.0 → 4.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  # Claw Orchestrator
6
6
 
7
- > A runtime for coding agents. Wrap Claude Code, Codex, Gemini, Cursor Agent, OpenCode, or any custom CLI as persistent programmable sessions; coordinate them in multi-agent councils; run autonomous Planner / Coder / Reviewer loops; or hand a five-question interview to an Opus council that ships a deployed web app at `localhost:19000/forge/<slug>/`.
7
+ > A runtime for coding agents. Wrap Claude Code, Codex, Antigravity, Cursor Agent, OpenCode, or any custom CLI as persistent programmable sessions; coordinate them in multi-agent councils; run autonomous Planner / Coder / Reviewer loops; or hand a five-question interview to an Opus council that ships a deployed web app at `localhost:19000/forge/<slug>/`.
8
8
 
9
9
  [![npm version](https://img.shields.io/npm/v/@enderfga/claw-orchestrator.svg)](https://www.npmjs.com/package/@enderfga/claw-orchestrator)
10
10
  [![CI](https://github.com/Enderfga/claw-orchestrator/actions/workflows/ci.yml/badge.svg)](https://github.com/Enderfga/claw-orchestrator/actions/workflows/ci.yml)
@@ -27,7 +27,7 @@ https://github.com/user-attachments/assets/fbd2b0ea-28d8-4387-9894-c29cf15ba030
27
27
  | Capability | What it does | Reference |
28
28
  | --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------- |
29
29
  | **Persistent Sessions** | Long-lived coding agents kept alive across requests, with full context, tool, model, and worktree control. | [`sessions.md`](./skills/references/sessions.md) |
30
- | **Multi-Engine Runtime** | One interface over Claude Code, Codex, Gemini, Antigravity (agy), Cursor Agent, OpenCode, and arbitrary custom CLIs. | [`multi-engine.md`](./skills/references/multi-engine.md) |
30
+ | **Multi-Engine Runtime** | One interface over Claude Code, Codex, Antigravity (agy), Cursor Agent, OpenCode, and arbitrary custom CLIs. | [`multi-engine.md`](./skills/references/multi-engine.md) |
31
31
  | **Multi-Agent Council** | Parallel agents in isolated git worktrees, voting on consensus until they agree. | [`council.md`](./skills/references/council.md) |
32
32
  | **Fan-out** | Run one task across N engine/model agents in parallel and collect their answers, with an optional synthesis pass — the cross-engine best-of-N / diverse-perspective primitive (no rounds or worktrees). | [`tools.md`](./skills/references/tools.md) |
33
33
  | **ultracode** | `session_start({ ultracode: true })` lets Claude orchestrate a dynamic JS workflow and fan out to subagents per task (Claude engine). | [`tools.md`](./skills/references/tools.md) |
@@ -93,10 +93,9 @@ Register `clawo-mcp` with any MCP-compatible host: Hermes Agent, Claude Desktop,
93
93
  | ------------ | ---------- | -------------- |
94
94
  | Claude Code | `claude` | 2.1.207 |
95
95
  | Codex | `codex` | 0.144.1 |
96
- | Gemini | `gemini` | 0.43.0 |
97
96
  | Antigravity | `agy` | 1.1.1 |
98
- | Cursor Agent | `agent` | 2026.04.08-a41fba1 |
99
- | OpenCode | `opencode` | 1.1.40 |
97
+ | Cursor Agent | `agent` | 2026.07.09-a3815c0 |
98
+ | OpenCode | `opencode` | 1.17.15 |
100
99
  | Custom CLI | any | — |
101
100
 
102
101
  Any coding CLI that runs as a subprocess can be wired up as a custom engine — see [`multi-engine.md`](./skills/references/multi-engine.md#custom-engine-enginecustom).
@@ -14,8 +14,14 @@ import type { SessionConfig, SessionSendOptions, TurnResult } from './types.js';
14
14
  import { BaseOneShotSession } from './base-oneshot-session.js';
15
15
  export declare class PersistentCursorSession extends BaseOneShotSession {
16
16
  private _currentRl;
17
+ /** Throwaway dir holding the read-only `.cursor/cli.json`; removed on stop(). */
18
+ private _roConfigDir?;
17
19
  constructor(config: SessionConfig, cursorBin?: string);
20
+ /** Materialize the read-only permission config once; return the dir to use as cwd. */
21
+ private _ensureReadOnlyConfigDir;
18
22
  protected _cleanupProc(): void;
19
23
  protected _run(message: string, options: SessionSendOptions): Promise<TurnResult>;
24
+ /** Detect an errored tool call across the shapes Cursor has used for it. */
25
+ private _cursorToolErrored;
20
26
  private _handleStreamEvent;
21
27
  }
@@ -12,13 +12,38 @@
12
12
  */
13
13
  import { spawn } from 'node:child_process';
14
14
  import * as readline from 'node:readline';
15
+ import * as fs from 'node:fs';
16
+ import * as os from 'node:os';
17
+ import * as path from 'node:path';
15
18
  import { estimateTokens } from './models.js';
16
19
  import { sanitizeSecrets } from './sanitize.js';
17
20
  import { SESSION_EVENT } from './constants.js';
18
21
  import { BaseOneShotSession } from './base-oneshot-session.js';
22
+ /**
23
+ * Enforced read-only for Cursor Agent.
24
+ *
25
+ * `--mode plan` is NOT a permission boundary — Cursor's docs say the mode
26
+ * "influences how the agent approaches tasks rather than enforcing permissions",
27
+ * and it was verified empirically to let an adversarial prompt write files
28
+ * (edit-tool calls went through). Cursor's ACTUAL enforcement is the permission
29
+ * config (`.cursor/cli.json`): "Deny rules take precedence over allow rules",
30
+ * and a `deny` was verified to hold even under `--force` and even against a
31
+ * repo that ships a permissive config of its own.
32
+ *
33
+ * `allow: []` means default-allow, so read / grep / search / list still work;
34
+ * only the write vectors are denied. We write this config into a throwaway temp
35
+ * dir and run Cursor with that dir as its process cwd (Cursor reads the config
36
+ * from cwd) while pointing `--workspace` at the real project — so the user's
37
+ * repository is never touched.
38
+ */
39
+ const READ_ONLY_CLI_CONFIG = JSON.stringify({
40
+ permissions: { allow: [], deny: ['Write(**)', 'Edit(**)', 'Shell(**)'] },
41
+ });
19
42
  // ─── PersistentCursorSession ────────────────────────────────────────────────
20
43
  export class PersistentCursorSession extends BaseOneShotSession {
21
44
  _currentRl = null;
45
+ /** Throwaway dir holding the read-only `.cursor/cli.json`; removed on stop(). */
46
+ _roConfigDir;
22
47
  constructor(config, cursorBin) {
23
48
  super(config, cursorBin || process.env.CURSOR_BIN || 'agent', {
24
49
  enginePrefix: 'cursor',
@@ -28,6 +53,16 @@ export class PersistentCursorSession extends BaseOneShotSession {
28
53
  engineDisplayName: 'Cursor',
29
54
  });
30
55
  }
56
+ /** Materialize the read-only permission config once; return the dir to use as cwd. */
57
+ _ensureReadOnlyConfigDir() {
58
+ if (this._roConfigDir)
59
+ return this._roConfigDir;
60
+ const dir = path.join(os.tmpdir(), `claw-cursor-ro-${this.sessionId}`);
61
+ fs.mkdirSync(path.join(dir, '.cursor'), { recursive: true });
62
+ fs.writeFileSync(path.join(dir, '.cursor', 'cli.json'), READ_ONLY_CLI_CONFIG, 'utf8');
63
+ this._roConfigDir = dir;
64
+ return dir;
65
+ }
31
66
  _cleanupProc() {
32
67
  if (this._currentRl) {
33
68
  this._currentRl.close();
@@ -38,12 +73,26 @@ export class PersistentCursorSession extends BaseOneShotSession {
38
73
  this.currentProc.stdout?.destroy();
39
74
  this.currentProc.stderr?.destroy();
40
75
  }
76
+ if (this._roConfigDir) {
77
+ try {
78
+ fs.rmSync(this._roConfigDir, { recursive: true, force: true });
79
+ }
80
+ catch {
81
+ // Never created / already gone.
82
+ }
83
+ this._roConfigDir = undefined;
84
+ }
41
85
  super._cleanupProc();
42
86
  }
43
87
  _run(message, options) {
44
88
  // agent -p <prompt> [--force | --mode plan] --trust --output-format stream-json
89
+ const readOnly = this.options.sandboxMode === 'read-only';
45
90
  const args = ['-p', message];
46
- if (this.options.sandboxMode === 'read-only')
91
+ // `--mode plan` steers the model toward read-only behavior; the binding
92
+ // guarantee comes from the deny config injected via the process cwd below.
93
+ // Do NOT add `--sandbox` here — it does not restrict in-workspace writes and
94
+ // was verified to override the mode and re-enable them.
95
+ if (readOnly)
47
96
  args.push('--mode', 'plan');
48
97
  else
49
98
  args.push('--force');
@@ -54,13 +103,17 @@ export class PersistentCursorSession extends BaseOneShotSession {
54
103
  if (this.options.cwd)
55
104
  args.push('--workspace', this.options.cwd);
56
105
  const timeout = options.timeout || 300_000;
106
+ // Read-only sessions run with an isolated temp dir as their process cwd so
107
+ // Cursor loads our deny config (`.cursor/cli.json`) from there while still
108
+ // operating on the real project via `--workspace`. The repo is never touched.
109
+ const spawnCwd = readOnly ? this._ensureReadOnlyConfigDir() : this.options.cwd;
57
110
  return new Promise((resolve, reject) => {
58
111
  const resultText = { value: '' };
59
112
  let stderr = '';
60
113
  let settled = false;
61
114
  let gotUsageFromEvents = false;
62
115
  const proc = spawn(this.engineBin, args, {
63
- cwd: this.options.cwd,
116
+ cwd: spawnCwd,
64
117
  env: { ...process.env },
65
118
  stdio: ['pipe', 'pipe', 'pipe'],
66
119
  });
@@ -142,6 +195,13 @@ export class PersistentCursorSession extends BaseOneShotSession {
142
195
  });
143
196
  });
144
197
  }
198
+ /** Detect an errored tool call across the shapes Cursor has used for it. */
199
+ _cursorToolErrored(event) {
200
+ if (event.is_error === true)
201
+ return true;
202
+ const status = event.status || event.result?.status;
203
+ return status === 'error' || status === 'failed';
204
+ }
145
205
  // ─── Stream Event Handling ────────────────────────────────────────────
146
206
  _handleStreamEvent(event, options, resultText, markUsageReceived) {
147
207
  const type = event.type;
@@ -194,6 +254,36 @@ export class PersistentCursorSession extends BaseOneShotSession {
194
254
  }
195
255
  break;
196
256
  }
257
+ // Cursor 2026.05+ emits `tool_call` with `subtype: 'started' | 'completed'`
258
+ // (one event each) instead of the older `tool_use` / `tool_result` pair.
259
+ // Count once on 'started'; read error state off the 'completed' event
260
+ // (there is no top-level `is_error` on a separate result event anymore).
261
+ case 'tool_call': {
262
+ const subtype = event.subtype;
263
+ if (subtype === 'started') {
264
+ this._stats.toolCalls++;
265
+ try {
266
+ options.callbacks?.onToolUse?.(event);
267
+ }
268
+ catch {
269
+ // User callback error
270
+ }
271
+ this.emit(SESSION_EVENT.TOOL_USE, event);
272
+ }
273
+ else if (subtype === 'completed') {
274
+ try {
275
+ options.callbacks?.onToolResult?.(event);
276
+ }
277
+ catch {
278
+ // User callback error
279
+ }
280
+ if (this._cursorToolErrored(event))
281
+ this._stats.toolErrors++;
282
+ this.emit(SESSION_EVENT.TOOL_RESULT, event);
283
+ }
284
+ break;
285
+ }
286
+ // Legacy event names (older Cursor builds) — keep for back-compat.
197
287
  case 'tool_use':
198
288
  this._stats.toolCalls++;
199
289
  try {
@@ -1 +1 @@
1
- {"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I,KAAK,CAAC,aAAa,IAAI,CAAC,CAAC;oBAC5F,IAAI,CAAC,MAAM,CAAC,SAAS,IAAI,KAAK,CAAC,YAAY,IAAI,KAAK,CAAC,aAAa,IAAI,KAAK,CAAC,iBAAiB,IAAI,CAAC,CAAC;oBACnG,MAAM,MAAM,GAAG,KAAK,CAAC,eAAe,IAAI,KAAK,CAAC,aAAa,IAAI,CAAC,CAAC;oBACjE,IAAI,MAAM;wBAAE,IAAI,CAAC,MAAM,CAAC,YAAY,IAAI,MAAM,CAAC;oBAC/C,IAAI,CAAC,WAAW,EAAE,CAAC;oBACnB,iBAAiB,EAAE,CAAC;gBACtB,CAAC;gBACD,8DAA8D;gBAC9D,MAAM,SAAS,GAAG,KAAK,CAAC,MAA4B,CAAC;gBACrD,IAAI,SAAS,IAAI,CAAC,UAAU,CAAC,KAAK;oBAAE,UAAU,CAAC,KAAK,GAAG,SAAS,CAAC;gBACjE,MAAM;YACR,CAAC;YAED,KAAK,OAAO;gBACV,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,GAAG,EAAE,kBAAkB,KAAK,CAAC,KAAK,IAAI,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;gBACvF,MAAM;YAER;gBACE,MAAM;QACV,CAAC;IACH,CAAC;CACF"}
@@ -26,11 +26,11 @@
26
26
  * `anthropic/claude-sonnet-4`). We pass `--model` through only when the
27
27
  * configured value contains a `/`; otherwise opencode's default applies.
28
28
  *
29
- * Permissions: opencode 1.1.40's `run` subcommand does not gate tool use
30
- * behind interactive prompts, so no skip-permissions flag is needed (and
31
- * `--dangerously-skip-permissions` doesn't exist on this version — yargs
32
- * strict mode would reject it and print help). If a future opencode version
33
- * reintroduces prompting on `run`, add a flag here behind a version probe.
29
+ * Permissions: on opencode 1.17.15's `run`, a tool that would prompt for a
30
+ * permission is auto-REJECTED in non-interactive mode (it does not hang), so a
31
+ * write-enabled session needs no skip flag. (`--dangerously-skip-permissions`,
32
+ * `--auto`, and `--yolo` do exist as of opencode 1.4.0 if an allow-all run is
33
+ * ever wanted — verified against 1.17.15.)
34
34
  */
35
35
  import type { SessionConfig, SessionSendOptions, TurnResult } from './types.js';
36
36
  import { BaseOneShotSession } from './base-oneshot-session.js';
@@ -26,11 +26,11 @@
26
26
  * `anthropic/claude-sonnet-4`). We pass `--model` through only when the
27
27
  * configured value contains a `/`; otherwise opencode's default applies.
28
28
  *
29
- * Permissions: opencode 1.1.40's `run` subcommand does not gate tool use
30
- * behind interactive prompts, so no skip-permissions flag is needed (and
31
- * `--dangerously-skip-permissions` doesn't exist on this version — yargs
32
- * strict mode would reject it and print help). If a future opencode version
33
- * reintroduces prompting on `run`, add a flag here behind a version probe.
29
+ * Permissions: on opencode 1.17.15's `run`, a tool that would prompt for a
30
+ * permission is auto-REJECTED in non-interactive mode (it does not hang), so a
31
+ * write-enabled session needs no skip flag. (`--dangerously-skip-permissions`,
32
+ * `--auto`, and `--yolo` do exist as of opencode 1.4.0 if an allow-all run is
33
+ * ever wanted — verified against 1.17.15.)
34
34
  */
35
35
  import { spawn } from 'node:child_process';
36
36
  import * as readline from 'node:readline';
@@ -113,6 +113,11 @@ export class PersistentOpencodeSession extends BaseOneShotSession {
113
113
  };
114
114
  let stderr = '';
115
115
  let settled = false;
116
+ // Read-only safety: if our injected agent fails to load, opencode prints
117
+ // `agent "clawo-readonly" not found. Falling back to default agent` (to
118
+ // stdout) and silently runs the DEFAULT, writable agent. We must never let
119
+ // a read-only session degrade to writable — detect that line and fail.
120
+ let readOnlyAgentMissing = false;
116
121
  const proc = spawn(this.engineBin, args, {
117
122
  cwd: this.options.cwd,
118
123
  env: readOnly ? { ...process.env, OPENCODE_CONFIG_CONTENT: READ_ONLY_AGENT_CONFIG } : { ...process.env },
@@ -140,6 +145,9 @@ export class PersistentOpencodeSession extends BaseOneShotSession {
140
145
  }
141
146
  catch {
142
147
  // Non-JSON line — opencode banner or stray text. Treat as plain text.
148
+ if (readOnly && /\bnot found\. Falling back to default agent/i.test(line)) {
149
+ readOnlyAgentMissing = true;
150
+ }
143
151
  const fallback = line + '\n';
144
152
  // Accumulate fallback text under one stable key (the old code wrote to
145
153
  // __raw_<size> but read __raw_acc, so it never actually accumulated).
@@ -168,6 +176,16 @@ export class PersistentOpencodeSession extends BaseOneShotSession {
168
176
  if (settled)
169
177
  return;
170
178
  settled = true;
179
+ // A read-only session whose enforcement agent failed to load ran writable.
180
+ // Refuse the result rather than hand back output produced without the
181
+ // sandbox the caller asked for.
182
+ if (readOnlyAgentMissing) {
183
+ this._recordTurnComplete();
184
+ reject(new Error("OpenCode read-only enforcement failed: the 'clawo-readonly' agent did not load, so the session " +
185
+ 'would have run with write access. Refusing the turn. (Check that OPENCODE_CONFIG_CONTENT is honored ' +
186
+ 'by this opencode version.)'));
187
+ return;
188
+ }
171
189
  // Collapse per-part text snapshots to a single string in insertion order.
172
190
  const finalText = Array.from(state.textParts.values()).join('');
173
191
  // Account tool usage stats (count uniques only).
@@ -1 +1 @@
1
- {"version":3,"file":"persistent-opencode-session.js","sourceRoot":"","sources":["../../src/persistent-opencode-session.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAG1C,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAE/D;;;;;;;;;;GAUG;AACH,MAAM,eAAe,GAAG,gBAAgB,CAAC;AACzC,MAAM,sBAAsB,GAAG,IAAI,CAAC,SAAS,CAAC;IAC5C,KAAK,EAAE;QACL,CAAC,eAAe,CAAC,EAAE;YACjB,IAAI,EAAE,SAAS;YACf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;wBACH,OAAO,CAAC,SAAS,EAAE,YAAY,EAAE,CAAC,KAAK,CAAC,CAAC;oBAC3C,CAAC;oBAAC,MAAM,CAAC;wBACP,sBAAsB;oBACxB,CAAC;oBACD,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;gBAC9C,CAAC;gBACD,MAAM;YACR,CAAC;YAED,KAAK,YAAY;gBACf,gCAAgC;gBAChC,MAAM;YAER,KAAK,aAAa,CAAC,CAAC,CAAC;gBACnB,IAAI,CAAC,IAAI;oBAAE,MAAM;gBACjB,MAAM,MAAM,GAAG,IAAI,CAAC,MAEP,CAAC;gBACd,IAAI,MAAM,EAAE,CAAC;oBACX,IAAI,CAAC,MAAM,CAAC,QAAQ,IAAI,MAAM,CAAC,KAAK,IAAI,CAAC,CAAC;oBAC1C,IAAI,CAAC,MAAM,CAAC,SAAS,IAAI,MAAM,CAAC,MAAM,IAAI,CAAC,CAAC;oBAC5C,IAAI,MAAM,CAAC,KAAK,EAAE,IAAI;wBAAE,IAAI,CAAC,MAAM,CAAC,YAAY,IAAI,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC;oBACtE,IAAI,CAAC,WAAW,EAAE,CAAC;oBACnB,KAAK,CAAC,QAAQ,GAAG,IAAI,CAAC;gBACxB,CAAC;gBACD,MAAM;YACR,CAAC;YAED,KAAK,OAAO;gBACV,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,GAAG,EAAE,oBAAoB,KAAK,CAAC,KAAK,IAAI,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;gBACzF,MAAM;YAER;gBACE,yDAAyD;gBACzD,MAAM;QACV,CAAC;IACH,CAAC;CACF"}
1
+ {"version":3,"file":"persistent-opencode-session.js","sourceRoot":"","sources":["../../src/persistent-opencode-session.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,OAAO,EAAE,KAAK,EAAE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CAAC;gBACnB,IAAI,CAAC,IAAI;oBAAE,MAAM;gBACjB,MAAM,MAAM,GAAG,IAAI,CAAC,MAEP,CAAC;gBACd,IAAI,MAAM,EAAE,CAAC;oBACX,IAAI,CAAC,MAAM,CAAC,QAAQ,IAAI,MAAM,CAAC,KAAK,IAAI,CAAC,CAAC;oBAC1C,IAAI,CAAC,MAAM,CAAC,SAAS,IAAI,MAAM,CAAC,MAAM,IAAI,CAAC,CAAC;oBAC5C,IAAI,MAAM,CAAC,KAAK,EAAE,IAAI;wBAAE,IAAI,CAAC,MAAM,CAAC,YAAY,IAAI,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC;oBACtE,IAAI,CAAC,WAAW,EAAE,CAAC;oBACnB,KAAK,CAAC,QAAQ,GAAG,IAAI,CAAC;gBACxB,CAAC;gBACD,MAAM;YACR,CAAC;YAED,KAAK,OAAO;gBACV,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,GAAG,EAAE,oBAAoB,KAAK,CAAC,KAAK,IAAI,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;gBACzF,MAAM;YAER;gBACE,yDAAyD;gBACzD,MAAM;QACV,CAAC;IACH,CAAC;CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@enderfga/claw-orchestrator",
3
- "version": "4.8.0",
3
+ "version": "4.8.1",
4
4
  "description": "Claw Orchestrator — run Claude Code, Codex, Gemini, Cursor Agent, OpenCode and custom coding CLIs as one unified runtime. Drop into Hermes Agent, Claude Desktop, Cursor, Cline, Continue, Zed, Windsurf, Goose or any Model Context Protocol (MCP) host, install as an OpenClaw plugin, or run standalone. Persistent sessions, multi-agent council, ultraplan, ultrareview, autoloop, tool orchestration.",
5
5
  "type": "module",
6
6
  "main": "./dist/src/index.js",
package/skills/SKILL.md CHANGED
@@ -1,12 +1,12 @@
1
1
  ---
2
2
  name: claw-orchestrator
3
- description: Manage persistent coding sessions across Claude Code, Codex, Gemini, Antigravity (agy), Cursor, and OpenCode engines. Use when orchestrating multi-engine coding agents, starting/sending/stopping sessions, running multi-agent council collaborations, cross-session messaging, ultraplan deep planning, ultrareview parallel code review, autoloop autonomous workspace iteration, ultraapp building deployable web apps from a structured Q&A interview, switching models/tools at runtime, or exposing the orchestrator's 65 tools as an MCP server to Hermes Agent / Claude Desktop / Cursor / Cline / Continue / Zed / Windsurf / Goose. Triggers on "start a session", "send to session", "run council", "ultraplan", "ultrareview", "autoloop", "ultraapp", "Forge tab", "build a web app", "one-click app", "AppSpec", "autonomous iteration", "iterate until goal", "deep paper review", "auto research", "switch model", "multi-agent", "coding session", "session inbox", "cursor agent", "opencode", "mcp server", "clawo-mcp", "hermes mcp", "model context protocol", "ultracode", "dynamic workflow", "fanout", "fan-out", "best-of-N", "steer turn", "interrupt turn", "fork thread", "rollback turns".
3
+ description: Manage persistent coding sessions across Claude Code, Codex, Antigravity (agy), Cursor, and OpenCode engines. Use when orchestrating multi-engine coding agents, starting/sending/stopping sessions, running multi-agent council collaborations, cross-session messaging, ultraplan deep planning, ultrareview parallel code review, autoloop autonomous workspace iteration, ultraapp building deployable web apps from a structured Q&A interview, switching models/tools at runtime, or exposing the orchestrator's 65 tools as an MCP server to Hermes Agent / Claude Desktop / Cursor / Cline / Continue / Zed / Windsurf / Goose. Triggers on "start a session", "send to session", "run council", "ultraplan", "ultrareview", "autoloop", "ultraapp", "Forge tab", "build a web app", "one-click app", "AppSpec", "autonomous iteration", "iterate until goal", "deep paper review", "auto research", "switch model", "multi-agent", "coding session", "session inbox", "cursor agent", "opencode", "mcp server", "clawo-mcp", "hermes mcp", "model context protocol", "ultracode", "dynamic workflow", "fanout", "fan-out", "best-of-N", "steer turn", "interrupt turn", "fork thread", "rollback turns".
4
4
  metadata:
5
5
  {
6
6
  "openclaw":
7
7
  {
8
8
  "emoji": "🤖",
9
- "requires": { "anyBins": ["claude", "codex", "gemini", "agy", "agent"] },
9
+ "requires": { "anyBins": ["claude", "codex", "agy", "agent"] },
10
10
  "install":
11
11
  [
12
12
  {
@@ -28,13 +28,6 @@ metadata:
28
28
  "package": "@openai/codex",
29
29
  "bins": ["codex"],
30
30
  "label": "Install Codex CLI"
31
- },
32
- {
33
- "id": "node-gemini",
34
- "kind": "node",
35
- "package": "@google/gemini-cli",
36
- "bins": ["gemini"],
37
- "label": "Install Gemini CLI"
38
31
  }
39
32
  ]
40
33
  }
@@ -43,7 +36,7 @@ metadata:
43
36
 
44
37
  # Claw Orchestrator Skill
45
38
 
46
- Claw Orchestrator — persistent multi-engine coding session manager for claw-style agent systems. Runs as a standalone CLI/server, with first-class OpenClaw plugin support. Wraps Claude Code, Codex, Gemini, Cursor Agent, OpenCode, and custom CLIs into headless agentic engines with 65 tools.
39
+ Claw Orchestrator — persistent multi-engine coding session manager for claw-style agent systems. Runs as a standalone CLI/server, with first-class OpenClaw plugin support. Wraps Claude Code, Codex, Antigravity, Cursor Agent, OpenCode, and custom CLIs into headless agentic engines with 65 tools.
47
40
 
48
41
  ## Engine Quick Reference
49
42
 
@@ -51,8 +44,7 @@ Claw Orchestrator — persistent multi-engine coding session manager for claw-st
51
44
  |--------|-----|-------------|----------|
52
45
  | `claude` | `claude` | Persistent subprocess | Multi-turn, complex tasks |
53
46
  | `codex` | `codex exec` | Per-message spawn | One-shot execution |
54
- | `gemini` | `gemini -p` | Per-message spawn | One-shot execution |
55
- | `agy` | `agy -p` | Per-message spawn | Antigravity (Gemini CLI successor); plain-text, auto conversation resume |
47
+ | `agy` | `agy -p` | Per-message spawn | Google Antigravity; plain-text, auto conversation resume |
56
48
  | `cursor` | `agent -p` | Per-message spawn | One-shot execution |
57
49
  | `opencode` | `opencode run` | Per-message spawn | Provider-agnostic (`provider/model`) |
58
50
 
@@ -62,7 +54,6 @@ Claw Orchestrator — persistent multi-engine coding session manager for claw-st
62
54
  // 1. Start session (any engine)
63
55
  session_start({ name: "myproject", cwd: "/path/to/project", engine: "claude" })
64
56
  session_start({ name: "codex-task", cwd: "/path/to/project", engine: "codex" })
65
- session_start({ name: "gemini-task", cwd: "/path/to/project", engine: "gemini" })
66
57
  session_start({ name: "agy-task", cwd: "/path/to/project", engine: "agy" })
67
58
  session_start({ name: "cursor-task", cwd: "/path/to/project", engine: "cursor" })
68
59
  session_start({ name: "opencode-task", cwd: "/path/to/project", engine: "opencode", model: "anthropic/claude-sonnet-4" })
@@ -82,8 +73,8 @@ session_stop({ name: "myproject" })
82
73
 
83
74
  | Parameter | Description |
84
75
  |-----------|-------------|
85
- | `engine` | `claude` (default), `codex`, `gemini`, `agy`, `cursor`, `opencode` |
86
- | `model` | Model name or alias (`fable`, `opus`, `sonnet`, `haiku`, `gpt-5.5`, `gemini-pro`, `composer-2`) |
76
+ | `engine` | `claude` (default), `codex`, `agy`, `cursor`, `opencode` |
77
+ | `model` | Model name or alias (`fable`, `opus`, `sonnet`, `haiku`, `gpt-5.5`, `agy-pro`, `composer-2`) |
87
78
  | `permissionMode` | `acceptEdits`, `auto`, `plan`, `bypassPermissions`, `manual`, `dontAsk` (`default` = legacy alias for `manual`) |
88
79
  | `effort` | `low`, `medium`, `high`, `xhigh`, `max`, `auto` (`xhigh` is Opus 4.7-only, between `high` and `max`) |
89
80
  | `maxBudgetUsd` | Cost limit in USD |
@@ -175,7 +166,7 @@ autoloop_start({
175
166
  workspace: '/path/to/repo',
176
167
  planner_engine: 'claude',
177
168
  coder_engine: 'codex',
178
- reviewer_engine: 'gemini',
169
+ reviewer_engine: 'agy',
179
170
  });
180
171
  autoloop_chat({ run_id: 'fix-parser', text: 'Read the repo and design a plan to fix the parser.' });
181
172
  autoloop_chat({ run_id: 'fix-parser', text: 'Plan approved; start the loop.' });
@@ -212,6 +203,6 @@ Each engine requires its own auth before use:
212
203
 
213
204
  - **Claude**: `claude /login` or `ANTHROPIC_API_KEY`
214
205
  - **Codex**: `codex login` or `OPENAI_API_KEY`
215
- - **Gemini**: `gemini login` or `GEMINI_API_KEY`
206
+ - **Antigravity**: run `agy` once and complete the Google OAuth login
216
207
  - **Cursor**: `agent login` or `CURSOR_API_KEY`
217
208
  - **OpenCode**: `opencode auth login` (provider-agnostic; use `provider/model` form for `model`)
@@ -34,19 +34,18 @@ uses its own default model rather than receiving the Claude `opus` / `sonnet`
34
34
  defaults. Role instructions are included in-band for engines that do not expose a
35
35
  native system-prompt flag.
36
36
 
37
- Engines without native multi-turn conversation (Gemini, Cursor, OpenCode, one-shot
38
- custom engines) spawn a fresh process per send, so the dispatcher replays that
39
- role's transcript in-band as a `<conversation_history>` block, oldest turns dropped
40
- past a character budget. Claude, Codex and Antigravity keep context themselves and
41
- get no replay.
37
+ Engines without native multi-turn conversation (Cursor, OpenCode, one-shot custom
38
+ engines) spawn a fresh process per send, so the dispatcher replays that role's
39
+ transcript in-band as a `<conversation_history>` block, oldest turns dropped past a
40
+ character budget. Claude, Codex and Antigravity keep context themselves and get no
41
+ replay.
42
42
 
43
43
  The Planner runs read-only so strategy cannot turn into source edits, and that is
44
44
  enforced by the engine rather than requested politely: Claude uses plan mode,
45
- Gemini gets `--approval-mode plan` **plus an admin policy denying `exit_plan_mode`**
46
- (plan mode on its own is model-cooperative — the agent can call that tool and walk
47
- out of it), OpenCode gets a generated `clawo-readonly` agent that denies
48
- `edit`/`bash`/`external_directory` (its built-in `plan` agent is a user-overridable
49
- preset that denies neither), and Antigravity/Cursor use their plan modes. A custom
45
+ Antigravity and Cursor use their plan modes, and OpenCode gets a generated
46
+ `clawo-readonly` agent that denies `edit`/`bash`/`external_directory` (its built-in
47
+ `plan` agent is a user-overridable preset that denies neither, so a "read-only"
48
+ session could otherwise still author files through a shell heredoc). A custom
50
49
  Planner receives `permissionMode: 'manual'` and its `CustomEngineConfig` **must**
51
50
  map that mode to the CLI's read-only flag — if it cannot, the session refuses to
52
51
  start rather than silently running write-enabled.
@@ -44,7 +44,7 @@ The server exposes an OpenAI-compatible chat completions endpoint, enabling any
44
44
  - `gpt-*` → Codex engine
45
45
  - `composer-*` → Cursor engine
46
46
  - `gemini-3.5-flash`, `gemini-3.1-pro`, `agy-*`, `agy/*` → Antigravity (`agy`) engine
47
- - other `gemini-*` → Gemini engine
47
+ - other `gemini-*` → the legacy `gemini` engine (Gemini CLI is sunset; prefer `agy`)
48
48
 
49
49
  **CORS:** `/v1/` paths allow cross-origin requests by default. Set `OPENCLAW_CORS_ORIGINS=*` to allow all origins on all paths.
50
50
 
@@ -61,7 +61,7 @@ clawo session-start [name] [options]
61
61
  | Flag | Description |
62
62
  |------|-------------|
63
63
  | `-d, --cwd <dir>` | Working directory |
64
- | `-e, --engine <engine>` | Engine: `claude` (default), `codex`, `codex-app`, `gemini`, `agy`, `cursor`, `opencode`, or `custom` |
64
+ | `-e, --engine <engine>` | Engine: `claude` (default), `codex`, `codex-app`, `agy`, `cursor`, `opencode`, or `custom` |
65
65
  | `-m, --model <model>` | Model name or alias |
66
66
  | `--permission-mode <mode>` | `acceptEdits`, `plan`, `auto`, `bypassPermissions`, `manual`, `dontAsk` |
67
67
  | `--effort <level>` | `low`, `medium`, `high`, `max`, `auto` |
@@ -106,7 +106,7 @@ Agents can use different engines and models:
106
106
  "agents": [
107
107
  { "name": "Claude", "emoji": "🎭", "engine": "claude", "model": "opus", "persona": "Deep reasoning" },
108
108
  { "name": "Codex", "emoji": "🧠", "engine": "codex", "model": "gpt-5.5", "persona": "Fast implementation" },
109
- { "name": "Gemini", "emoji": "💎", "engine": "gemini", "model": "gemini-3.1-pro-preview", "persona": "Creative solutions" }
109
+ { "name": "Antigravity", "emoji": "💎", "engine": "agy", "model": "agy-pro", "persona": "Creative solutions" }
110
110
  ]
111
111
  }
112
112
  ```
@@ -23,7 +23,7 @@ openclaw plugins install @enderfga/claw-orchestrator --dangerously-force-unsafe-
23
23
  openclaw gateway restart
24
24
  ```
25
25
 
26
- > **Why `--dangerously-force-unsafe-install`?** Claw Orchestrator spawns Claude Code / Codex / Gemini / Cursor Agent / OpenCode CLI subprocesses via `child_process`, which OpenClaw's security scanner flags by design. The flag is required — there is no way to drive coding CLIs without process spawning.
26
+ > **Why `--dangerously-force-unsafe-install`?** Claw Orchestrator spawns Claude Code / Codex / Antigravity / Cursor Agent / OpenCode CLI subprocesses via `child_process`, which OpenClaw's security scanner flags by design. The flag is required — there is no way to drive coding CLIs without process spawning.
27
27
 
28
28
  Agents automatically get access to all session, council, and management tools.
29
29
 
@@ -52,7 +52,7 @@ await manager.stopSession('backend-fix');
52
52
  - **Claude Code CLI >= 2.1** — `npm install -g @anthropic-ai/claude-code`
53
53
  - **OpenClaw >= 2026.3.0** — for plugin mode (optional)
54
54
  - **OpenAI Codex CLI >= 0.112** — `npm install -g @openai/codex` (optional, for codex engine)
55
- - **Gemini CLI >= 0.35** — `npm install -g @google/gemini-cli` (optional, for gemini engine)
55
+ - **Antigravity CLI** — `curl -fsSL https://antigravity.google/cli/install.sh | bash` (optional, for the `agy` engine — Google's successor to the sunset Gemini CLI)
56
56
 
57
57
  ### Engine Authentication
58
58
 
@@ -60,7 +60,7 @@ Each engine requires its own authentication before use:
60
60
 
61
61
  - **Claude Code** — run `claude /login` or set `ANTHROPIC_API_KEY`
62
62
  - **Codex** — run `codex login` or set `OPENAI_API_KEY`
63
- - **Gemini** — run `gemini login` or set `GEMINI_API_KEY`
63
+ - **Antigravity** — run `agy` once and complete the Google OAuth login
64
64
 
65
65
  The plugin does not manage authentication — it expects each CLI to be ready to run.
66
66
 
@@ -87,7 +87,7 @@ Quick config for any client:
87
87
  |---------|-------|
88
88
  | API Base URL | `http://127.0.0.1:18796/v1` |
89
89
  | API Key | The value of `OPENCLAW_SERVER_TOKEN`, or any string if auth is disabled |
90
- | Model | `claude-fable-5`, `claude-opus-4-8`, `claude-sonnet-5`, `gpt-5.5`, `gemini-3.1-pro-preview`, etc. |
90
+ | Model | `claude-fable-5`, `claude-opus-4-8`, `claude-sonnet-5`, `gpt-5.5`, `agy-pro`, etc. |
91
91
 
92
92
  See [openai-compat.md](./openai-compat.md) for the full session-keying rules, `X-Session-Reset` semantics, the legacy-heuristic env var, and the `/v1/sessions` inspection endpoint.
93
93
 
@@ -12,8 +12,6 @@ SessionManager
12
12
  │ └── Wraps: codex exec --sandbox workspace-write --json (per-message spawning)
13
13
  ├── engine: 'codex-app' → PersistentCodexAppServerSession
14
14
  │ └── Wraps: codex app-server --listen stdio:// (long-running JSON-RPC; required for /goal)
15
- ├── engine: 'gemini' → PersistentGeminiSession
16
- │ └── Wraps: gemini -p --output-format stream-json (per-message spawning)
17
15
  ├── engine: 'agy' → PersistentAgySession
18
16
  │ └── Wraps: agy -p (Google Antigravity CLI, per-message spawning, plain-text output)
19
17
  ├── engine: 'cursor' → PersistentCursorSession
@@ -107,28 +105,6 @@ await manager.startSession({
107
105
  // await tool('codex_goal_set', { name: 'codex-goal-task', objective: 'build a tic-tac-toe app' });
108
106
  ```
109
107
 
110
- ### Google Gemini (`engine: 'gemini'`)
111
-
112
- Wraps the `gemini` CLI with `--output-format stream-json`. Each `send()` spawns a new process.
113
-
114
- - One-shot execution per message (no persistent subprocess)
115
- - Working directory carries accumulated changes across sends
116
- - Real token counts from stream-json `result` events (not estimated)
117
- - Permission modes: `bypassPermissions` → `--yolo`, `default` → `--sandbox`; `sandboxMode: 'read-only'` → `--approval-mode plan` (takes precedence)
118
- - Always passes `--skip-trust` to bypass the "trusted folders" gate introduced
119
- in Gemini CLI 0.43 (otherwise headless runs in worktrees / arbitrary cwds
120
- abort before producing output)
121
- - Requires `gemini` CLI installed: `npm install -g @google/gemini-cli`
122
-
123
- ```typescript
124
- await manager.startSession({
125
- name: 'gemini-task',
126
- engine: 'gemini',
127
- model: 'gemini-3.1-pro-preview',
128
- cwd: '/project',
129
- });
130
- ```
131
-
132
108
  ### Google Antigravity (`engine: 'agy'`)
133
109
 
134
110
  Wraps Google's **Antigravity CLI** (`agy`) — the successor to Gemini CLI (consumer
@@ -169,14 +145,22 @@ await manager.startSession({
169
145
  });
170
146
  ```
171
147
 
148
+ > **Legacy: `engine: 'gemini'`.** Google sunset the consumer Gemini CLI (tiers stopped
149
+ > serving 2026-06-18) in favour of Antigravity. The `gemini` engine still exists and
150
+ > still works — existing callers are not broken, and `gemini-*` model strings outside
151
+ > agy's registered slugs still route to it — but it is no longer a documented option,
152
+ > is not version-tracked, and gets no new work. Use `agy` for Google. (Unrelated: the
153
+ > multi-model **proxy** still talks to the Gemini **API**; that is a different
154
+ > subsystem and is unaffected.)
155
+
172
156
  ### Cursor Agent (`engine: 'cursor'`)
173
157
 
174
- Wraps the Cursor Agent CLI (`agent`) with `--print --output-format stream-json`. Write-enabled sessions use `--force`; `sandboxMode: 'read-only'` uses `--mode plan`. Each `send()` spawns a new process.
158
+ Wraps the Cursor Agent CLI (`agent`) with `--print --output-format stream-json`. Write-enabled sessions use `--force`. Each `send()` spawns a new process.
175
159
 
176
160
  - One-shot execution per message (no persistent subprocess)
177
161
  - Working directory via `--workspace` flag
178
162
  - Real token counts from stream-json `result` events (camelCase: `inputTokens`, `outputTokens`, `cacheReadTokens`)
179
- - `--force` enables auto-approval of file changes; `sandboxMode: 'read-only'` replaces it with `--mode plan`
163
+ - `--force` enables auto-approval of file changes. `sandboxMode: 'read-only'` does **not** use `--force`; it enforces read-only via a binding `.cursor/cli.json` deny config (`Write`/`Edit`/`Shell` denied) written into an isolated temp dir used as the process cwd, with `--workspace` pointing at the real project (the repo tree is never modified). `--mode plan` is passed too as model steering, but the deny config is the actual boundary — plan mode alone is model-cooperative and was verified to let an adversarial prompt write. Do not add `--sandbox` (it does not restrict in-workspace writes and overrides the mode). Read/grep/search remain available
180
164
  - `--trust` auto-trusts the workspace without prompting
181
165
  - Cursor uses its own model routing (e.g., `sonnet-4`, `gpt-5`, `auto`)
182
166
  - Requires Cursor Agent CLI: `curl https://cursor.com/install -fsSL | bash`
@@ -202,7 +186,7 @@ Wraps the [sst/opencode](https://github.com/sst/opencode) CLI with `run --format
202
186
  - Real token counts from `step_finish.part.tokens.{input,output,cache.read}`
203
187
  - The wrapper closes the subprocess's stdin immediately after spawn (opencode otherwise reads stdin and blocks on EOF, hanging the call)
204
188
  - Provider-agnostic: opencode's `--model` expects `provider/model` form (e.g. `anthropic/claude-sonnet-4`). The wrapper passes `--model` through only when the value contains a `/`; otherwise opencode's own default applies
205
- - `sandboxMode: 'read-only'` selects OpenCode's built-in `plan` agent via `--agent plan`
189
+ - `sandboxMode: 'read-only'` spawns a generated `clawo-readonly` agent (`--agent clawo-readonly` plus an `OPENCODE_CONFIG_CONTENT` env var defining it) whose permissions deny `edit` / `bash` / `external_directory`. It deliberately does **not** use OpenCode's built-in `plan` agent: that is a user-overridable preset whose compiled rules start with `{"permission":"*","action":"allow"}` and deny neither `bash` nor `edit`, so a "read-only" session could still author files through a shell heredoc. Verified against opencode 1.17.15 by attempting a real write, which the agent cannot perform (its toolset has no write/bash tools). Note that `opencode agent list` renders compiled permission rules and does not show the tool-level restriction — trust an actual write attempt, not that view
206
190
  - Requires opencode installed: `brew install sst/tap/opencode` or `npm install -g opencode-ai`. Auth via `opencode auth login` **or** any provider env var (`ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, `GEMINI_API_KEY`, etc.) — opencode picks up either path
207
191
  - Binary: `opencode` (set `OPENCODE_BIN` env var to override)
208
192
 
@@ -265,7 +249,7 @@ Team tools (`team_list`, `team_send`) operate on the same virtual-team layer for
265
249
  |--------|------------|-------------|
266
250
  | Claude | Lists other active SessionManager sessions | Routes via cross-session inbox |
267
251
  | Codex | Lists other active SessionManager sessions | Routes via cross-session inbox |
268
- | Gemini | Lists other active SessionManager sessions | Routes via cross-session inbox |
252
+ | Antigravity | Lists other active SessionManager sessions | Routes via cross-session inbox |
269
253
  | Cursor | Lists other active SessionManager sessions | Routes via cross-session inbox |
270
254
 
271
255
  Messages are delivered via the inbox system — idle sessions receive immediately, busy sessions queue for later delivery.
@@ -321,7 +305,7 @@ Integrate **any** coding agent CLI without writing engine-specific code. You pro
321
305
 
322
306
  Two protocol modes:
323
307
  - **Persistent** (`persistent: true`) — long-running subprocess with stream-json I/O over stdin/stdout (like Claude Code)
324
- - **One-shot** (`persistent: false`, default) — new process spawned per `send()` (like Gemini/Codex)
308
+ - **One-shot** (`persistent: false`, default) — new process spawned per `send()` (like Codex/Antigravity)
325
309
 
326
310
  ### CustomEngineConfig
327
311
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  > **Cost warning**: This bridge routes requests through the Claude Code CLI, which uses your Claude Max subscription's **extra usage** quota. When OpenClaw's agent loop sends its system prompt (with distinctive tool definitions and agent instructions), Anthropic's backend recognizes this as programmatic/agent traffic and bills it against extra usage — **not** the included allowance. This is by design: the bridge does NOT bypass Anthropic's billing or subscription enforcement. Using it as OpenClaw's primary model backend means every agent turn consumes extra usage credits at standard API rates ($15/M input, $75/M output for Opus). Monitor your usage at [claude.ai/settings/usage](https://claude.ai/settings/usage).
4
4
 
5
- The embedded server exposes a drop-in OpenAI-compatible endpoint so any client that speaks `/v1/chat/completions` can talk to a persistent Claude Code (or Codex / Gemini / Cursor) session. The bridge is designed to serve **two kinds of clients as first-class citizens**:
5
+ The embedded server exposes a drop-in OpenAI-compatible endpoint so any client that speaks `/v1/chat/completions` can talk to a persistent Claude Code (or Codex / Antigravity / Cursor) session. The bridge is designed to serve **two kinds of clients as first-class citizens**:
6
6
 
7
7
  1. **Upstream agents** that maintain their own conversation state and forward only the latest user turn — OpenClaw's main agent loop, cron jobs, subagents, programmatic clients.
8
8
  2. **OpenAI-compatible webchat / labeling tools** that re-send the full transcript on every turn — ChatGPT-Next-Web, Open WebUI, LobeChat, data-labeling pipelines.
@@ -29,8 +29,8 @@ Key options:
29
29
 
30
30
  | Option | Description |
31
31
  |--------|-------------|
32
- | `engine` | `'claude'` (default), `'codex'`, `'codex-app'`, `'gemini'`, `'agy'`, `'cursor'`, `'opencode'`, or `'custom'` — see [Multi-Engine](./multi-engine.md) |
33
- | `model` | Model alias (`opus`, `sonnet`, `haiku`, `gemini-pro`) or full name |
32
+ | `engine` | `'claude'` (default), `'codex'`, `'codex-app'`, `'agy'`, `'cursor'`, `'opencode'`, or `'custom'` — see [Multi-Engine](./multi-engine.md) |
33
+ | `model` | Model alias (`fable`, `opus`, `sonnet`, `haiku`, `agy-pro`) or full name |
34
34
  | `permissionMode` | `acceptEdits`, `bypassPermissions`, `plan`, `auto`, `manual`, `dontAsk` (`default` = legacy alias for `manual`) |
35
35
  | `effort` | `low`, `medium`, `high`, `max`, `auto` |
36
36
  | `bare` | Skip hooks, LSP, auto-memory, CLAUDE.md |
@@ -162,7 +162,7 @@ SessionManager tracks consecutive failures per engine type. After 3 consecutive
162
162
 
163
163
  ## Orphaned Process Cleanup
164
164
 
165
- If the plugin crashes without calling `stop()`, child CLI processes (claude, codex, gemini, agent) may become orphans. SessionManager tracks PIDs in `~/.openclaw/session-pids.json` and cleans up stale processes on startup:
165
+ If the plugin crashes without calling `stop()`, child CLI processes (claude, codex, agy, agent, opencode) may become orphans. SessionManager tracks PIDs in `~/.openclaw/session-pids.json` and cleans up stale processes on startup:
166
166
 
167
167
  1. Reads PID file from previous run
168
168
  2. For each PID, checks if process is alive (`kill -0`)
@@ -12,10 +12,10 @@ Start a persistent coding session with full CLI flag support.
12
12
  |-----------|------|-------------|
13
13
  | `name` | string | Session name (auto-generated if omitted) |
14
14
  | `cwd` | string | Working directory |
15
- | `engine` | `'claude'` \| `'codex'` \| `'codex-app'` \| `'gemini'` \| `'agy'` \| `'cursor'` \| `'opencode'` \| `'custom'` | Engine to use (default: `claude`). `agy` wraps Google Antigravity CLI. `opencode` wraps sst/opencode (pass model as `provider/model`). Use `custom` with `customEngine` for any CLI. |
15
+ | `engine` | `'claude'` \| `'codex'` \| `'codex-app'` \| `'agy'` \| `'cursor'` \| `'opencode'` \| `'custom'` | Engine to use (default: `claude`). `agy` wraps Google Antigravity CLI. `opencode` wraps sst/opencode (pass model as `provider/model`). Use `custom` with `customEngine` for any CLI. (`'gemini'` is still accepted for existing callers, but Gemini CLI is sunset — use `agy` for Google.) |
16
16
  | `model` | string | Model alias or full name |
17
17
  | `permissionMode` | string | `acceptEdits`, `bypassPermissions`, `plan`, `auto`, `manual`, `dontAsk` (`default` = legacy alias for `manual`) |
18
- | `sandboxMode` | `'read-only'` \| `'workspace-write'` \| `'danger-full-access'` | Sandbox policy. Codex supports all values. `read-only` is enforced on every other built-in engine too: Claude → plan mode; Gemini → `--approval-mode plan` + an admin policy denying `exit_plan_mode`; OpenCode → a generated `clawo-readonly` agent denying `edit`/`bash`; Antigravity/Cursor → plan mode. A `custom` engine must map it via `permissionModes`, or the session refuses to start. Persisted across session resume. |
18
+ | `sandboxMode` | `'read-only'` \| `'workspace-write'` \| `'danger-full-access'` | Sandbox policy. Codex supports all values. `read-only` is enforced on every other built-in engine too: Claude → plan mode; Antigravity / Cursor → their plan modes; OpenCode → a generated `clawo-readonly` agent denying `edit`/`bash`. A `custom` engine must map it via `permissionModes`, or the session refuses to start. Persisted across session resume. |
19
19
  | `effort` | string | `low`, `medium`, `high`, `max`, `auto` |
20
20
  | `allowedTools` | string[] | Tools to auto-approve |
21
21
  | `disallowedTools` | string[] | Tools to deny |