惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Microsoft Azure Blog
Microsoft Azure Blog
WordPress大学
WordPress大学
Google DeepMind News
Google DeepMind News
美团技术团队
大猫的无限游戏
大猫的无限游戏
H
Help Net Security
小众软件
小众软件
aimingoo的专栏
aimingoo的专栏
博客园 - 聂微东
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
M
MIT News - Artificial intelligence
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - Franky
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Microsoft Security Blog
Microsoft Security Blog
F
Fortinet All Blogs
A
About on SuperTechFans
Recent Announcements
Recent Announcements
D
Docker
Vercel News
Vercel News
Engineering at Meta
Engineering at Meta
腾讯CDC
Martin Fowler
Martin Fowler
阮一峰的网络日志
阮一峰的网络日志

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
feat: add codex supervisor extension · openclaw/openclaw@...
steipete · 2026-05-29 · via Recent Commits to openclaw:main
1+

---

2+

title: Claw Supervisor

3+

description: Fleet supervision plan for Codex app-server sessions controlled by OpenClaw.

4+

readWhen:

5+

- Designing Codex fleet supervision

6+

- Building OpenClaw tools that read, steer, or spawn Codex sessions

7+

- Choosing between local, Cloudflare, and VPS deployment for supervised Codex

8+

---

9+10+

# Claw Supervisor

11+12+

## Goal

13+14+

Claw Supervisor lets one always-on OpenClaw instance monitor and drive a fleet of Codex sessions without changing the normal Codex user experience. A user can SSH into a host, start Codex, work in the TUI, and still have the supervisor read the session, steer it, interrupt it, spawn related sessions, and accept handoffs. Codex sessions can also call back into OpenClaw through MCP.

15+16+

## Product Model

17+18+

Codex remains the primary work surface. OpenClaw supervises Codex rather than hiding Codex inside an opaque OpenClaw subagent.

19+20+

The OpenClaw plugin is named `codex-supervisor`. `crabfleet` remains the deployment

21+

and host-fleet profile for CRAB machines rather than the reusable plugin name.

22+23+

The model has three roles:

24+25+

- Human-attached Codex: a normal interactive Codex TUI launched through a shared app-server.

26+

- Autonomous Codex: a Codex app-server thread spawned by the supervisor that a human can later attach to.

27+

- Supervisor Claw: an always-on OpenClaw agent with tools for fleet state, transcript reads, steering, interruption, spawning, and handoff.

28+29+

OpenClaw may use its existing subagent machinery internally, but the external contract is an attachable Codex session with a Codex thread id.

30+31+

## Architecture

32+33+

```text

34+

user SSH session

35+

-> codex --remote unix://... or ws://...

36+

-> local codex app-server daemon

37+

<-> host sidecar / supervisor connector

38+

<-> OpenClaw fleet supervisor

39+

<-> supervisor MCP exposed back to Codex

40+

```

41+42+

Each Codex-capable host runs:

43+44+

- Codex app-server daemon.

45+

- A launcher that always starts interactive Codex with `--remote`.

46+

- A connector that registers app-server endpoints and live threads with the supervisor.

47+48+

The supervisor runs:

49+50+

- Endpoint registry.

51+

- Session registry.

52+

- Codex app-server JSON-RPC client pool.

53+

- MCP server for Codex-to-Claw calls.

54+

- OpenClaw tools for Claw-to-Codex control.

55+

- Policy engine for autonomous actions, approvals, and loop prevention.

56+57+

## Codex App-Server Contract

58+59+

Use Codex app-server APIs as the canonical control plane:

60+61+

- `initialize`, `initialized`

62+

- `thread/loaded/list`

63+

- `thread/list`

64+

- `thread/read`

65+

- `thread/resume`

66+

- `thread/start`

67+

- `turn/start`

68+

- `turn/steer`

69+

- `turn/interrupt`

70+

- `model/list`

71+72+

Interactive Codex must be launched with `codex --remote <endpoint>` so the TUI and supervisor connect to the same app-server. Standalone `codex exec` is not a live-shared session today; use app-server APIs for autonomous work until Codex supports `exec --remote`.

73+74+

## Session Registry

75+76+

Supervisor stores one record per observed Codex thread:

77+78+

```json

79+

{

80+

"sessionId": "codex-thread-id",

81+

"endpointId": "host-a",

82+

"host": "host-a.example",

83+

"workspace": "/workspace/repo",

84+

"repo": "owner/repo",

85+

"branch": "feature/example",

86+

"source": "vscode",

87+

"status": "idle",

88+

"humanAttached": true,

89+

"lastSeenAt": "2026-05-28T10:00:00.000Z",

90+

"summary": "Short working-state summary"

91+

}

92+

```

93+94+

The local implementation can derive most fields from Codex thread metadata. Fleet deployment should enrich records with host identity, user attachment state, git state, and sidecar health.

95+96+

## MCP Surface For Codex

97+98+

Every supervised Codex gets an MCP server named `openclaw-codex-supervisor`.

99+100+

Tools:

101+102+

- `codex_sessions_list`: list visible Codex sessions.

103+

- `codex_session_read`: read one transcript.

104+

- `codex_session_send`: send a message to an idle thread or steer an active thread.

105+

- `codex_session_interrupt`: interrupt the active turn.

106+

- `codex_endpoint_probe`: verify endpoint connectivity.

107+

- `claw_report_progress`: publish current task state to the supervisor.

108+

- `claw_ask`: ask the supervisor for help or delegation.

109+

- `codex_spawn`: create a new autonomous Codex session.

110+

- `codex_handoff`: request human or peer takeover.

111+112+

Resources:

113+114+

- `codex://sessions`

115+

- `codex://sessions/{sessionId}`

116+

- `codex://sessions/{sessionId}/transcript`

117+118+

## Claw Control Surface

119+120+

The always-on Claw gets the same primitives as internal tools:

121+122+

- list sessions and endpoints

123+

- read transcripts

124+

- send/steer text

125+

- interrupt active work

126+

- spawn new sessions

127+

- summarize and assign sessions

128+

- broadcast instructions to a filtered group

129+

- mark sessions blocked, done, or abandoned

130+131+

Tool behavior:

132+133+

- If a target thread is idle, `codex_session_send` maps to `turn/start`.

134+

- If a target thread is active and an in-progress turn id is visible, it maps to `turn/steer`.

135+

- If the active turn cannot be identified, the tool fails closed instead of creating an unrelated turn.

136+

- Codex-exposed MCP write controls stay disabled unless a trusted supervisor-only policy enables them.

137+

- Raw transcript reads stay disabled unless a trusted supervisor-only policy enables them.

138+

- Autonomous approval defaults deny tool/file approvals unless an explicit policy says otherwise.

139+140+

## Launch Flow

141+142+

Interactive host login:

143+144+

1. User SSHes into a CRAB host.

145+

2. SSH service starts or verifies `codex app-server daemon start`.

146+

3. Login wrapper launches `codex --remote unix:// --cd <workspace>`.

147+

4. Host connector registers endpoint and loaded thread.

148+

5. Supervisor emits a high-priority fleet event: new Codex session, workspace, human-attached state, current task preview.

149+

6. Supervisor Claw can read and steer immediately.

150+151+

Autonomous spawn:

152+153+

1. Supervisor selects host and workspace.

154+

2. Host connector opens or resumes a Codex app-server thread.

155+

3. Supervisor starts the first turn with task text and MCP config.

156+

4. Session registry marks it autonomous and attachable.

157+

5. Human can later attach with `codex --remote <endpoint> resume <threadId>` once Codex supports that exact UX, or via current resume flow on the same app-server.

158+159+

## Deployment

160+161+

Preferred control plane:

162+163+

- Host connectors keep outbound WebSocket connections to the supervisor.

164+

- Supervisor state lives in OpenClaw Gateway storage.

165+

- Codex app-server remains local to each host; never expose a raw unauthenticated app-server to the public internet.

166+167+

Cloudflare viability:

168+169+

- Good for registry, durable objects, WebSocket fan-in, lightweight event routing, and public MCP/gateway endpoints.

170+

- Not enough by itself for direct private host control because Workers cannot dial arbitrary private Unix sockets or local loopback app-servers.

171+

- Use Cloudflare when every host connector phones home over outbound WebSocket.

172+173+

VPS fallback:

174+175+

- Use a Hetzner service when long-lived process control, SSH tunnels, private network routing, or local filesystem access is needed.

176+

- Keep the same protocol: host connectors outbound, supervisor registry central, Codex app-server local.

177+178+

## Security

179+180+

- Default bind is local Unix socket.

181+

- Remote app-server uses token or signed bearer auth.

182+

- Host connector authenticates to supervisor with a scoped host token.

183+

- Supervisor tools enforce per-session policy: read, steer, interrupt, spawn, approval.

184+

- Cross-agent messages include `originSessionId`; self-echo is dropped.

185+

- Broadcast requires an explicit filter and bounded target count.

186+

- Transcript reads redact secrets at OpenClaw boundary.

187+

- Approval requests default to deny for supervisor-originated turns unless policy allows them.

188+189+

## Implementation Plan

190+191+

Phase 1: Local supervisor MVP

192+193+

- Add Codex app-server JSON-RPC client for stdio proxy and WebSocket endpoints.

194+

- Add supervisor endpoint/session registry.

195+

- Add MCP tools: list, read, send, interrupt, probe.

196+

- Add local env config for endpoints.

197+

- Add fake app-server tests and one live local app-server smoke.

198+199+

Phase 2: OpenClaw integration

200+201+

- Register supervisor tools in the `codex-supervisor` plugin.

202+

- Inject supervisor MCP into Codex thread config.

203+

- Add session summaries to agent context.

204+

- Add event notifications when new Codex threads appear.

205+

- Add policy config for autonomous send/interrupt/spawn.

206+207+

Phase 3: Fleet connector

208+209+

- Host sidecar registers app-server endpoint, host metadata, git/workspace metadata, and human attachment state.

210+

- Add outbound WebSocket connector for Cloudflare or VPS control plane.

211+

- Add reconnect, heartbeat, and stale-session cleanup.

212+

- Add CRAB SSH launcher wrapper.

213+214+

Phase 4: Autonomous operation

215+216+

- Add spawn/resume/takeover flows.

217+

- Add broadcast and delegation.

218+

- Add progress reports and task-state summaries.

219+

- Add loop prevention and rate limits.

220+

- Add dashboard views.

221+222+

Phase 5: Multi-Claw

223+224+

- Shard sessions by group.

225+

- Add leadership/lease for each session.

226+

- Add audit log and replay.

227+

- Add escalation between Claw groups.

228+229+

## Acceptance Tests

230+231+

- A human launches Codex TUI through a shared app-server.

232+

- Supervisor lists the live thread via `thread/loaded/list`.

233+

- Supervisor reads transcript via `thread/read`.

234+

- Supervisor sends text to an idle thread via `turn/start`.

235+

- Supervisor steers an active thread via `turn/steer`.

236+

- Supervisor interrupt stops an active turn via `turn/interrupt`.

237+

- Codex calls supervisor MCP and lists peer sessions.

238+

- An autonomous Codex is spawned and later human-attached.

239+

- Lost host connector marks sessions stale without deleting history.

240+241+

## Open Questions

242+243+

- Exact Codex TUI attach UX for an app-server thread spawned without a TUI.

244+

- Whether Codex should add `exec --remote` for headless live-shared runs.

245+

- Durable state owner: OpenClaw Gateway DB, Cloudflare Durable Object, or VPS database.

246+

- Approval policy granularity for supervisor-originated turns.

247+

- How much transcript summary should be injected into the always-on Claw context versus kept as a tool/resource.