codex-supervisor-mcp 0.5.7 → 0.5.8

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.en.md CHANGED
@@ -8,317 +8,206 @@ English | [中文](README.md)
8
8
  [![CI](https://github.com/zriyox/codex-supervisor-mcp/actions/workflows/ci.yml/badge.svg)](https://github.com/zriyox/codex-supervisor-mcp/actions/workflows/ci.yml)
9
9
  [![node](https://img.shields.io/badge/node-%3E%3D22.13.0-339933.svg)](package.json)
10
10
 
11
- Let one main thread (Claude Code, Codex, any MCP client) run several Codex workers at once.
11
+ Let one main thread (Claude Code, Codex, or any MCP client) run several Codex workers at once. One Git worktree per worker, every state change on disk, and a web board to watch the batch.
12
12
 
13
- ![Demo: one Claude Code main thread dispatches 3 Codex workers, each in its own worktree, and merges the result into a single commit](https://raw.githubusercontent.com/zriyox/codex-supervisor-mcp/main/assets/demo.gif)
13
+ ![Demo: one Claude Code main thread dispatches three Codex workers into separate worktrees, waits, and merges the result](https://raw.githubusercontent.com/zriyox/codex-supervisor-mcp/main/assets/demo.gif)
14
14
 
15
- *30 seconds, recorded live rather than staged: the Claude Code main thread calls `create_codex_worker` three times, the workers run in parallel in their own worktrees, then the main thread collects three diffs and merges them into one commit.*
15
+ *30 seconds, recorded live: the main thread calls `create_codex_worker` three times, the workers run in parallel in their own worktrees, the main thread collects three diffs and makes one commit.*
16
16
 
17
- One worker per Git worktree, one worker per native Codex goal, every state written to disk. The main thread dispatches, waits, reads results back, reconnects after a crash, and cancels.
17
+ ## What it is
18
18
 
19
- ## What this solves
19
+ Point several agents at one repository and they overwrite each other, and nobody can say afterwards who changed what. This MCP takes dispatching and bookkeeping out of the model's context and puts them on disk:
20
20
 
21
- Point several agents at one repo and they overwrite each other, and afterwards nobody can tell who changed what. This MCP moves dispatch and bookkeeping out of the model context and onto disk:
22
-
23
- | Problem | How it's handled |
21
+ | Problem | What happens here |
24
22
  |---|---|
25
- | Workers stepping on each other's files | One Git worktree per worker; `ownedPaths` conflicts are checked before dispatch |
26
- | The main thread can't hold every worker's output | Events go to `data/runs/<taskId>.jsonl`; reading them has three gates: `limit`, `maxChars`, `kinds` |
27
- | One read blows up the main thread's context | `get_orchestration_overview` squeezes every worker under 2k tokens |
28
- | After a restart you don't know what's still running | One row per work in `supervisor.sqlite`, `thread_id` included |
29
- | A new session can't pick up an old worker | `resume_codex_worker` runs `codex exec resume <thread_id>`, which reattaches the same Codex session |
30
- | "It failed" and "the process is gone" look alike | The state machine keeps `failed` and `lost` apart |
31
-
32
- ## How is this different from Claude Code subagents?
23
+ | Workers step on each other's files | One Git worktree per worker; `ownedPaths` is checked for overlap before anything starts |
24
+ | A worker's output floods the main thread | Events go to `data/runs/<taskId>.jsonl`; reads have `limit` / `maxChars` / `kinds` gates |
25
+ | One status read fills the context | `get_orchestration_overview` fits every worker into 7000 bytes |
26
+ | Nobody knows who is still running after a restart | `supervisor.sqlite` has one row per work, with the `thread_id` |
27
+ | A new session cannot pick up an old worker | `resume_codex_worker` runs `codex exec resume <thread_id>`, the same Codex conversation |
28
+ | "It failed" and "the process vanished" look alike | The state machine keeps `failed` and `lost` apart |
29
+ | You cannot see where a batch is | `codex-supervisor-web` opens a board, one session at a time, one line per worker |
33
30
 
34
- One thing that used to be a difference is not one anymore: a Claude Code subagent can run in its own worktree (`isolation: worktree`; see "Isolate subagents with worktrees" in the [official worktrees docs](https://docs.claude.com/en/docs/claude-code/worktrees)). File isolation is built in now, so don't install this plugin for that.
31
+ Workers are `codex exec` processes and `model` is passed straight through. The main thread stays on Claude for judgement; the workers can run DeepSeek or whatever Codex has a provider for, on a separate bill.
35
32
 
36
- The real gap is the model. A subagent's `model` field takes a Claude alias or a full Claude model ID (`sonnet` / `opus` / `haiku` / `inherit`); a non-Claude model like DeepSeek has no way in, and every token is billed at Anthropic's rates. Dispatch three and you pay for three.
33
+ ## Five minutes to a running batch
37
34
 
38
- What gets dispatched here is a `codex exec` subprocess, and the `model` argument is passed straight through to the Codex CLI (`src/codex-runner.js:336`). A worker's model has nothing to do with the main thread's. Keep the main thread on Claude for judgment, put the workers on DeepSeek, and configure the provider in Codex's `config.toml`. The token-heavy work lands on the workers. The main thread reads the `get_orchestration_overview` table, and pulls a diff from the worker's worktree when it wants one.
39
-
40
- | | Claude Code subagent | codex-supervisor worker |
41
- |---|---|---|
42
- | Models it can run | Claude only: an alias or a full Claude model ID | `model` goes to the Codex CLI, so DeepSeek works |
43
- | What does the work | Claude Code itself | A separate `codex exec` process |
44
- | Working directory | Shared with the main thread by default, or `isolation: worktree` | One Git worktree per worker |
45
- | Two workers writing the same file | Separated by worktrees, with no declared paths and no conflict check | `ownedPaths` is intersected before dispatch; on overlap no worktree is created and you get `ownership_conflict` |
46
- | Main thread context | Subagent results come back into it | Events go to `data/runs/<taskId>.jsonl`; the overview runs on a hard 7000-byte budget (`src/mcp-server.js:32`) |
47
- | Main thread process dies | Workers die with it | `thread_id` is in sqlite; `resume_codex_worker` reattaches the same session |
48
- | What can drive it | Claude Code only | Any MCP client |
49
- | Watching a worker work | Only the conclusion it returns | Raw JSONL, read through `kinds` / `limit` / `maxChars` |
35
+ Requirements: Node.js 22.13.0 or newer, and the `codex` CLI on `PATH`. macOS, Linux and Windows.
50
36
 
51
- ## Architecture
37
+ ### 1. Install
52
38
 
53
- ```
54
- MCP client (Claude Code / Codex / ...)
55
- │ stdio (MCP)
56
- ▼
57
- codex-supervisor-mcp
58
- │ spawn: codex exec --json
59
- ▼
60
- Codex worker ──► data/runs/<taskId>.jsonl raw JSONL event stream
61
- ──► supervisor.sqlite tasks + task_events
62
- ──► worktrees/<taskId>/ the worker's own Git worktree
39
+ ```bash
40
+ npm install -g codex-supervisor-mcp
63
41
  ```
64
42
 
65
- ## Install
66
-
67
- Requirements: **Node.js >= 22.13.0** (`node:sqlite` had no unflagged build before that) and the `codex` CLI on `PATH`. macOS, Linux, and Windows are all supported.
68
-
69
- ### Quick start
43
+ A global install's `postinstall` does two things: it copies the bundled skill into `~/.claude/skills/`, `~/.agents/skills/` and `~/.codex/skills/`, and it registers the MCP with `claude mcp add -s user` and `codex mcp add`. Check:
70
44
 
71
45
  ```bash
72
- # 1. install
73
- npm install -g codex-supervisor-mcp
74
-
75
- # 2. confirm it registered
76
46
  claude mcp list | grep codex-supervisor
77
47
  codex mcp list | grep codex-supervisor
78
48
  ```
79
49
 
80
- A global install runs `postinstall`, which does two things with **no manual configuration**:
81
-
82
- 1. Copies the bundled skill into whichever client directories it finds: `~/.claude/skills/`, `~/.agents/skills/`, `~/.codex/skills/`.
83
- 2. Registers the MCP server through the client's own CLI: `claude mcp add -s user` / `codex mcp add`, pointing at `node <absolute path inside the package>`.
84
-
85
- If a skill already exists with different content, it writes `SKILL.md.bak-<timestamp>` first and then overwrites. A failure in either step does not fail the install.
86
-
87
- ### Registering by hand
88
-
89
- When `postinstall` doesn't run (`--ignore-scripts`, `npx`, pnpm, and similar), add the line yourself:
90
-
91
- | Client | Command |
92
- |---|---|
93
- | Claude Code | `claude mcp add -s user codex-supervisor -- npx -y codex-supervisor-mcp` |
94
- | Codex | `codex mcp add codex-supervisor -- npx -y codex-supervisor-mcp` |
95
-
96
- To re-run it, repair it, target one client only, or just see what it plans to do:
50
+ If it is missing (`npx`, `--ignore-scripts` and pnpm installs skip `postinstall`), add it by hand:
97
51
 
98
52
  ```bash
99
- codex-supervisor-setup # detect clients, install skill + register MCP
100
- codex-supervisor-setup --target claude,codex
101
- codex-supervisor-setup --skill-only # skill only, leave MCP config alone
102
- codex-supervisor-setup --mcp-only # register MCP only, no skill
103
- codex-supervisor-setup --dry-run # print the plan, change nothing
53
+ claude mcp add -s user codex-supervisor -- npx -y codex-supervisor-mcp
54
+ codex mcp add codex-supervisor -- npx -y codex-supervisor-mcp
104
55
  ```
105
56
 
106
- ### GUI clients
107
-
108
- Write the config file yourself and add this block. GUI clients never run `postinstall`:
109
-
110
- ```json
111
- {
112
- "mcpServers": {
113
- "codex-supervisor": {
114
- "command": "npx",
115
- "args": ["-y", "codex-supervisor-mcp"]
116
- }
117
- }
118
- }
119
- ```
57
+ Restart Claude Code / Codex so the MCP process is the new one.
120
58
 
121
- | Client | macOS | Windows | Linux |
122
- |---|---|---|---|
123
- | Claude Desktop | `~/Library/Application Support/Claude/claude_desktop_config.json` | `%APPDATA%\Claude\claude_desktop_config.json` | `~/.config/Claude/claude_desktop_config.json` |
124
- | Cursor | `~/.cursor/mcp.json` | `%APPDATA%\Cursor\mcp.json` | `~/.config/cursor/mcp.json` |
125
- | Windsurf | `~/.codeium/windsurf/mcp_config.json` | `%APPDATA%\Codeium\windsurf\mcp_config.json` | `~/.config/.codeium/windsurf/mcp_config.json` |
59
+ ### 2. Dispatch a batch
126
60
 
127
- ### The npx gotcha
61
+ In Claude Code, say it in plain words; the skill makes it follow the right sequence:
128
62
 
129
- `npx` does not run `postinstall`, so **the skill is not installed and the MCP server is not registered**. Only the server itself will start. If you want the bundled skill, either `npm install -g` or run `codex-supervisor-setup` once by hand.
63
+ > Fill in the unit tests for these three modules. Use codex-supervisor, three workers in parallel, session title "unit tests".
130
64
 
131
- ### Upgrading
65
+ What the main thread does underneath (you can call the tools yourself):
132
66
 
133
- ```bash
134
- npm install -g codex-supervisor-mcp@latest
135
- npm ls -g --depth=0 | grep codex-supervisor # confirm the version actually changed
136
67
  ```
137
-
138
- `postinstall` runs again: it compares the skill by content, backs up to `SKILL.md.bak-<timestamp>` when it differs, and skips clients that already have the MCP registered.
139
-
140
- Three known traps:
141
-
142
- - **A freshly published version lags a few minutes behind the registry's `latest`.** If the version number didn't move, wait and reinstall, or pin it: `npm install -g codex-supervisor-mcp@0.5.3`.
143
- - **`npm link` / `npm i -g .` produce a symlink.** Editing `src/` takes effect immediately, but editing `skills/SKILL.md` does not sync on its own; run `codex-supervisor-setup` once. To go back to a normal install, `npm install -g codex-supervisor-mcp@latest` overwrites the symlink.
144
- - **Switching Node versions breaks the registration.** What gets registered is an absolute path (`~/.nvm/versions/node/<version>/lib/node_modules/...`), and `postinstall` sees "already registered" and skips, so the path is never rewritten. Remove it first, then install:
145
-
146
- ```bash
147
- claude mcp remove -s user codex-supervisor
148
- codex mcp remove codex-supervisor
149
- npm install -g codex-supervisor-mcp@latest
68
+ create_codex_worker ×3 each with session_id, session_title, ownedPaths, goal
69
+ wait_codex_workers two-minute budget by default; returns a snapshot, call again if still running
70
+ get_worker_result ×3 the full report and change list per worker
150
71
  ```
151
72
 
152
- To re-run the installer without upgrading, use `codex-supervisor-setup`.
73
+ Each worker's changes sit on its own `codex/<taskId>` branch. Whether and how to merge is the main thread's call.
153
74
 
154
- ### Uninstall
75
+ ### 3. Open the board
155
76
 
156
77
  ```bash
157
- npm uninstall -g codex-supervisor-mcp
158
- claude mcp remove -s user codex-supervisor
159
- codex mcp remove codex-supervisor
160
- rm -rf ~/.claude/skills/codex-supervisor ~/.agents/skills/codex-supervisor ~/.codex/skills/codex-supervisor
161
- rm -rf ~/.codex-supervisor # state directory: sqlite, event streams, worktrees
78
+ codex-supervisor-web
79
+ # without a global install:
80
+ npx -p codex-supervisor-mcp codex-supervisor-web
162
81
  ```
163
82
 
164
- ### Windows
83
+ Open `http://127.0.0.1:7877`. The left column lists sessions with the title given at dispatch and how many workers are still running; a session opens into its worker ledger; a worker opens a drawer with its full report, change list, commands, event stream, task text and token usage. It refreshes every 2.5 seconds while something runs, every 8 seconds otherwise.
165
84
 
166
- - An npm-installed CLI on Windows is `codex.cmd`, not an executable, and Node refuses to `spawn` it directly since 18.20 / 20.12 (the behavior after CVE-2024-27980, reported as `EINVAL`). This package does not fall back to `shell: true` — that turns the shell into a child process, so cancelling kills the shell while the real Codex keeps running and the state machine sticks on `running`. Instead it goes around the shim to the npm package's own entry point (`node_modules/@openai/codex/bin/codex.js`) and starts it with `node`. The same path is taken when `CODEX_BIN` points at a `.js` file.
167
- - Cross-process cancel uses `taskkill /PID <pid> /T /F` to take down the whole tree. Confirming that pid is still Codex reads its command line through PowerShell's `Get-CimInstance Win32_Process`, falling back to `tasklist`. `ps` is only used on macOS and Linux.
168
- - Besides `PATH`, it probes `%APPDATA%\npm`, `%LOCALAPPDATA%\pnpm`, `%LOCALAPPDATA%\Volta\bin`, and `%ProgramFiles%\nodejs`.
85
+ `SUPERVISOR_WEB_PORT` changes the port; `SUPERVISOR_HOME` points it at a state directory (it has to be the one the MCP uses). The board reads. It does not dispatch or cancel.
169
86
 
170
- Auto-install only happens on a **global install**. `npx`, `--ignore-scripts`, and being installed as someone else's dependency all skip it. Set `CODEX_SUPERVISOR_SKIP_SETUP=1` to opt out.
87
+ ## What the board shows
171
88
 
172
- ### Troubleshooting
89
+ | Where | What |
90
+ |---|---|
91
+ | Left column | One line per session: title (the `session_title` from dispatch, or a line built from the workers' goals when none was given), worker count, how many are running, last activity. The current version and any update notice sit at the bottom |
92
+ | Session page | Title, note, first dispatch and last activity; a count line (total / running / completed / failed / lost); while workers run, the command each one is executing; when idle, the last report |
93
+ | Worker ledger | One row per worker: status, title, the running command or the last line reported, time taken, files changed (the worktree's real diff, committed work included), commands run, last update. Hovering the title shows the full goal, the owned paths and the branch |
94
+ | Worker drawer | Duration / exit code / run count; model, tokens, sandbox, thread, session; branch, base commit, worktree path; Codex startup notices folded away; five tabs: report (rendered markdown), changes, commands, events (virtualized), task text |
173
95
 
174
- | Symptom | Cause | Fix |
175
- |---|---|---|
176
- | `claude mcp list` has no `codex-supervisor` | `npx` / `--ignore-scripts` installs don't run `postinstall` | Run `codex-supervisor-setup`, or register by hand above |
177
- | Dispatch fails with `codex only resolved to a shell shim` | On Windows only the `.cmd` was found and the npm package entry point behind it is gone | Reinstall `@openai/codex`, or point `CODEX_BIN` at the real executable / `codex.js` |
178
- | A worker goes `failed` immediately with `spawn codex ENOENT` | The process started by a GUI client has no `codex` on `PATH` | Set `CODEX_BIN` explicitly in the client config |
179
- | `Cannot find module 'node:sqlite'` | Node < 22.13.0 | Upgrade Node |
180
- | A worker is stuck in `lost` | The MCP process was killed and the worker was orphaned | Let `list_codex_workers` settle it, or pick it back up with `resume_codex_worker` |
181
- | `ownedPaths overlap with active worker(s)` | Two workers claimed the same path | Change the path, or `cancel_codex_worker` whichever is holding it |
96
+ Light and dark follow the system. System fonts only, nothing fetched from the network.
182
97
 
183
98
  ## Tools
184
99
 
185
- Sixteen of them.
100
+ Sixteen.
186
101
 
187
102
  | Tool | Arguments | What it does |
188
103
  |---|---|---|
189
- | `create_codex_worker` | `task`, `cwd`, **`ownedPaths`**, **`goal`**, `session_id`, `session_title`, `session_note`, `dependsOn`, `baseRef`, `sandbox`, `model`, `reasoningEffort`, `title`, `skipGitRepoCheck` | Start a worker. `session_title` / `session_note` record what the batch is for, so the board and `get_session_works` show that instead of a bare id. `baseRef` picks the commit the worktree is cut from (default: the repository's `HEAD`); pass another worker's `codex/<id>` branch to build on work that isn't on the main line yet |
190
- | `create_codex_followup_worker` | `task_id`, `followup_prompt`, `session_id`, plus the same arguments | Start a **new session**, seeded with the old worker's prompt, status, and recent events |
191
- | `resume_codex_worker` | `task_id`, `prompt` | Continue the **same** Codex session |
192
- | `list_codex_workers` | `status`, `includeHistory`, `includeDetails` | List workers; running ones only by default |
193
- | `get_orchestration_overview` | `status`, `limit` | A compact status table for every worker, meant for the main thread |
194
- | `wait_codex_workers` | `task_ids`, `mode`(any/all), `timeoutMinutes`, `timeoutMs`, `includeEvents`, `eventLimit`, `eventMaxChars`, `eventKinds` | Wait for a terminal state, then return summaries. The default wait is 2 minutes: when it runs out you get a progress snapshot and the workers keep going, so call it again. Events are **off** by default (`includeEvents: false`) |
195
- | `get_codex_worker_status` | `task_id`, `includePrompt`, `promptMaxChars` | Status for one worker: lifecycle, phase, current action, changed files, goal, recent commands, with the prompt clipped. Pass `includePrompt: true` for the full prompt |
196
- | `get_codex_worker_events` | `task_id`, `limit`, `maxChars`, `kinds` | Read the raw event stream |
197
- | `get_worker_goal` | `task_id` | Read a worker's goal (supervisor side and native Codex side) |
198
- | `get_worker_summary` | `task_id` | One paragraph about a worker; what the main thread reads when wrapping up |
199
- | `get_worker_result` | `task_id`, `limit`, `maxChars` | A worker's own final report, in full. The overview and `wait_codex_workers` clip the last message to 400 characters and keep only the head; read this for the conclusion |
200
- | `get_session_works` | `session_id` | Every worker dispatched under one session, oldest first. This is how a dead main thread finds its batch again |
201
- | `search_works` | `query`, `limit` | Substring match over title / goal / prompt / last_message, newest first |
202
- | `describe_session` | `session_id`, `title`, `note` | Record a title and a note for a session; fields you leave out keep their value. For when the first dispatch forgot |
203
- | `check_for_update` | `force` | Ask the npm registry whether a newer version is published and whether the installed files match the published tarball. The same check runs at startup; this forces a fresh one |
204
- | `cancel_codex_worker` | `task_id` | Stop a worker; falls back to the pid when the process handle isn't in this process |
205
-
206
- ### Why `ownedPaths` and `goal` are required
207
-
208
- - `ownedPaths`: the paths this worker is allowed to write, relative to `cwd` or absolute. Before dispatch it is intersected against every running worker; on overlap the dispatch is refused and the conflicting `task_id` comes back. No worktree gets created and then thrown away.
209
- - `goal`: `{ objective, tokenBudget? }`. This anchors the main thread's L1 summary and decides when the work should stop.
210
-
211
- `dependsOn` records the dependency edges between workers. It's stored, so the main thread can see who is waiting on whom.
212
-
213
- ### Three gates on reading events
214
-
215
- `get_codex_worker_events` keeps the cost of a read under control with three arguments:
216
-
217
- | Argument | Effect |
218
- |---|---|
219
- | `limit` | At most this many events |
220
- | `maxChars` | Long strings inside a single event are truncated in the middle, keeping head and tail |
221
- | `kinds` | Only these event types; the filter runs before `limit` is applied |
104
+ | `create_codex_worker` | `task`, `cwd`, **`ownedPaths`**, **`goal`**, `session_id`, `session_title`, `session_note`, `dependsOn`, `baseRef`, `sandbox`, `model`, `reasoningEffort`, `title`, `skipGitRepoCheck` | Start a worker. `session_title` / `session_note` say what the batch is for; `baseRef` picks the commit the worktree is cut from (default: the repository's `HEAD`), pass another worker's `codex/<id>` branch to build on work not yet on the main line |
105
+ | `create_codex_followup_worker` | `task_id`, `followup_prompt`, `session_id`, plus the above | A new session seeded with the old worker's prompt, status and recent events |
106
+ | `resume_codex_worker` | `task_id`, `prompt` | Continue the same Codex conversation; `thread_id` stays |
107
+ | `wait_codex_workers` | `task_ids`, `mode` (any/all), `timeoutMinutes`, `timeoutMs`, `includeEvents`, `eventLimit`, `eventMaxChars`, `eventKinds` | Wait for terminal states. Two minutes by default, then a snapshot; `still_running: true` means call again with the same ids. Events off by default |
108
+ | `get_orchestration_overview` | `status`, `limit` | Every worker in one table, capped at 7000 bytes. Carries `version` and `update` |
109
+ | `get_worker_result` | `task_id`, `limit`, `maxChars` | The worker's own full report plus `status` / `exit_code` / `changed_files`. The door for conclusions |
110
+ | `get_worker_summary` | `task_id` | One paragraph: goal, status, changes, last command and message |
111
+ | `get_codex_worker_status` | `task_id`, `includePrompt`, `promptMaxChars` | One worker in detail; the prompt is clipped to 300 characters unless asked for |
112
+ | `get_codex_worker_events` | `task_id`, `limit`, `maxChars`, `kinds` | The raw event stream |
113
+ | `get_worker_goal` | `task_id` | The goal recorded at dispatch plus the native Codex goal (tokens, time) |
114
+ | `list_codex_workers` | `status`, `includeHistory`, `includeDetails` | List workers, active ones by default |
115
+ | `get_session_works` | `session_id` | Every worker of one session, with its title and note. The way back after a main-thread restart |
116
+ | `describe_session` | `session_id`, `title`, `note` | Record a title and note; fields left out keep their value |
117
+ | `search_works` | `query`, `limit` | Substring search over title / goal / prompt / last_message, newest first |
118
+ | `check_for_update` | `force` | Ask the registry for a newer version and whether the installed files match the published tarball |
119
+ | `cancel_codex_worker` | `task_id` | Stop a worker. Falls back to the pid when the handle is in another process, after confirming that pid runs codex |
120
+
121
+ ### The three things to always pass
122
+
123
+ - `ownedPaths`: the paths this worker may write. Checked against every running worker before dispatch; an overlap refuses the call with the conflicting `task_id` and no worktree is created. It is a dispatch-time check, not a runtime sandbox.
124
+ - `goal.objective`: one line on what the worker is for. The worker creates a native Codex goal from it and marks it complete when done.
125
+ - `session_id`: not required by the schema, but without it nothing groups the batch and neither the board nor `get_session_works` can find it again. Same value for the whole batch, and `session_title` on the first dispatch.
126
+
127
+ ### Reading results without filling the context
128
+
129
+ | Want | Use | Cost |
130
+ |---|---|---|
131
+ | Status of every worker | `get_orchestration_overview` | 7000 bytes, hard cap |
132
+ | One worker's conclusion | `get_worker_result` | The full report, tens of thousands of characters for a big job |
133
+ | Alive or finished | `get_worker_summary` | A paragraph |
134
+ | What it did | `get_codex_worker_events` | Filter with `kinds`, bound with `limit`, clip with `maxChars` |
222
135
 
223
- The truncation rule copies Codex's own `TruncationPolicy::Bytes`: cut the middle, keep both ends, and prefix with
136
+ The dispatch receipt is small and does not echo the task text. `wait_codex_workers` clips `last_message` to 400 characters and `current_action` to 300; the full text is behind `get_worker_result` and `get_codex_worker_events`. That clipping is what takes a five-worker wait from tens of KB to a few KB, which matters when a client backgrounds a timed-out call and replays the result as a notification.
224
137
 
225
- ```
226
- Warning: truncated output (original token count: N)
227
- Total output lines: M
228
- ```
138
+ ## How this differs from Claude Code subagents
229
139
 
230
- `get_orchestration_overview` has the same kind of hard guarantee. Field limits tighten step by step until the whole JSON payload fits in 7000 bytes (about 1750 tokens). The `approx_tokens` it returns is its own real cost.
140
+ File isolation is not the difference: subagents can open their own worktree (`isolation: worktree`). The difference is the model and the process.
141
+
142
+ | | Claude Code subagent | codex-supervisor worker |
143
+ |---|---|---|
144
+ | Models | Claude only | `model` goes to the Codex CLI; DeepSeek works |
145
+ | Who does the work | Claude Code itself | A separate `codex exec` process |
146
+ | Two workers, one file | Separate worktrees, no path declaration | `ownedPaths` intersection before dispatch; overlap is refused |
147
+ | Main thread dies | Workers die with it | `thread_id` is in SQLite; `resume_codex_worker` picks the conversation back up |
148
+ | Who can drive it | Claude Code only | Any MCP client |
149
+ | Watching the work | Only the returned conclusion | Raw JSONL and the web board |
231
150
 
232
- ## The work state machine
151
+ ## The state machine
233
152
 
234
- `status` is the lifecycle. One value per work, never overwritten by progress:
153
+ `status` is the lifecycle, one value per work:
235
154
 
236
155
  | Value | Meaning |
237
156
  |---|---|
238
157
  | `queued` | Dispatched, not started |
239
158
  | `running` | Running |
240
- | `completed` | Succeeded |
241
- | `failed` | Failed (non-zero exit code, `turn.failed`, spawn failure) |
242
- | `cancelled` | Interrupted by `cancel_codex_worker` |
243
- | `lost` | Killed by an external signal, or the MCP process vanished without writing a terminal event |
244
-
245
- `phase` only has a value while `running`, and goes back to `null` at a terminal state:
159
+ | `completed` | Finished with exit code 0 |
160
+ | `failed` | Non-zero exit, `turn.failed`, or spawn failure |
161
+ | `cancelled` | Stopped by `cancel_codex_worker` |
162
+ | `lost` | Killed by an outside signal, the MCP process vanished, or the row was written and no process ever started |
246
163
 
247
- ```
248
- starting → thinking → command → editing → reporting
249
- ```
164
+ `phase` has a value only while `running`: `starting → thinking → command → editing → reporting`.
250
165
 
251
- Keeping `failed` and `lost` apart is useful: the first sends you to the logs, the second means just run it again.
166
+ `failed` sends you to the logs; `lost` means run it again. A terminal state lands in two steps: `turn.completed` sets `completed`, the process exit writes `exit_code`. `wait_codex_workers` waits for the second step; a direct status read that sees `completed` with `exit_code: null` is in the gap, read again.
252
167
 
253
- Windows has no signals, so only one of the two is decidable there. libuv kills a process with `TerminateProcess(handle, 1)`, and an external kill looks exactly like the process calling `exit(1)` from the parent's point of view: `exit_code=1`, `signal=null` in both cases. In that situation it reports the one it can prove, `failed` plus an exit code, rather than inventing a signal name the platform never delivered. `lost` still happens on Windows, through the MCP process disappearing and orphans being settled on the next start.
168
+ Windows has no signals. An outside kill and the process calling `exit(1)` look the same to the parent, so there it reports `failed` with the exit code.
254
169
 
255
- ### Goal states mapped to work states
256
-
257
- A native Codex goal has six states. They map onto work status like this:
258
-
259
- | Goal state | Work status | Note |
260
- |---|---|---|
261
- | `active` | `running` | Progressing normally |
262
- | `paused` | `running` | Paused, waiting on a person |
263
- | `blocked` | `running` | Stuck, needs the main thread to step in |
264
- | `usageLimited` / `usage_limited` | `failed` | Quota exhausted |
265
- | `budgetLimited` / `budget_limited` | `failed` | Budget exhausted |
266
- | `complete` | `completed` | Done |
267
-
268
- `paused` and `blocked` are not endings. They mean someone needs to look. `get_orchestration_overview` lists both under `needs_attention`, so you don't have to guess with a timeout.
170
+ Native Codex goal states map like this: `active` / `paused` / `blocked` are `running` (the last two land in `needs_attention`), `usageLimited` / `budgetLimited` are `failed`, `complete` is `completed`.
269
171
 
270
172
  ## Where state lives
271
173
 
272
- By default under `~/.codex-supervisor/`:
174
+ `~/.codex-supervisor/` by default:
273
175
 
274
- | File | Contents |
176
+ | File | Content |
275
177
  |---|---|
276
- | `data/supervisor.sqlite` | `tasks` (one row per work) and `task_events` (structured events with a `seq`) |
277
- | `data/runs/<taskId>.jsonl` | Codex `--json` raw output, one event per line |
278
- | `worktrees/<taskId>/` | That worker's own Git worktree |
279
-
280
- A database from 0.1.x migrates automatically the first time it's opened. Process values that used to live in `status` (`editing`, `command`, `command_completed`, `reporting`) move into `phase`, and `status` becomes `running`. Nothing is dropped. The migration runs inside one `BEGIN IMMEDIATE` transaction, so if several processes start at once only one of them actually migrates.
281
-
282
- `changed_files` has three sources: Codex's `file_change` events, `git status --porcelain` in the worker's own worktree (the uncommitted part), and `git diff --name-only <base_commit> HEAD` (the committed part). The last two exist because a worker that edits files through a shell command (`printf > file`) never emits a `file_change` event, and once it commits on its branch `git status` is clean again - a real batch of five workers did exactly that and every read came back empty. `base_commit` is recorded on the row at dispatch; rows older than that column fall back to the oldest reflog entry of the `codex/<taskId>` branch, which is where the branch was created.
283
-
284
- ## The board
178
+ | `data/supervisor.sqlite` | `tasks` (one row per work), `task_events` (structured events), `sessions` (titles and notes) |
179
+ | `data/runs/<taskId>.jsonl` | The raw `codex --json` output |
180
+ | `data/update-check.json` | Cache for the update check |
181
+ | `worktrees/<taskId>/` | That worker's Git worktree |
285
182
 
286
- The package ships a read-only web view over the same SQLite file:
183
+ `changed_files` has three sources: Codex's `file_change` events; `git status --porcelain` in the worktree (uncommitted); `git diff --name-only <base_commit> HEAD` (committed). The last two exist because a worker editing through the shell emits no `file_change` event, and once it commits `git status` is clean again. A real batch of five did exactly that and every read came back empty. `base_commit` is recorded at dispatch; older rows fall back to the oldest reflog entry of the branch. Every git read passes `core.quotePath=false`, so non-ASCII file names come back as written instead of octal-escaped.
287
184
 
288
- ```bash
289
- codex-supervisor-web # after a global install
290
- npx -p codex-supervisor-mcp codex-supervisor-web # without installing
291
- ```
292
-
293
- It listens on `http://127.0.0.1:7877`; `SUPERVISOR_WEB_PORT` / `SUPERVISOR_WEB_HOST` move it, `SUPERVISOR_HOME` points it at another state directory.
294
-
295
- The left column lists sessions by the `session_title` recorded at dispatch (or, failing that, a line built from the workers' goals) and how many of their workers are still running. A session opens into its worker ledger: status, title, the command being run or the last line reported, time taken, files changed (the worktree's real diff, committed work included), commands run. A worker opens a drawer with the full report rendered from markdown, the change list, commands, the raw event stream, the task text, token usage and the native Codex goal. It refreshes every 2.5 seconds while something is running, every 8 seconds otherwise.
296
-
297
- It reads. It does not dispatch or cancel; that stays with the MCP.
185
+ A 0.1.x database migrates itself the first time it is opened, without losing a row.
298
186
 
299
187
  ## Update check
300
188
 
301
- When the MCP process starts it asks the npm registry which version is `latest` and what that tarball's integrity is, then compares two things:
189
+ When the MCP process starts it asks the npm registry which version is `latest` and what that tarball's integrity is, then compares two things with the install:
302
190
 
303
- - The installed version. If it is behind `latest`, `get_orchestration_overview`, the dispatch receipt and the `wait_codex_workers` response gain an `update` field with `latest_version` and the command to run (`npm i -g codex-supervisor-mcp@latest`). The skill tells the main thread to pass that on to the user.
304
- - The installed files. A global install records the integrity of the unpacked tarball in `node_modules/.package-lock.json`; if it differs from what the registry publishes for that version, the files on disk are not the published build, and the notice says to reinstall. A git checkout has no such value and reports its commit instead.
191
+ - The version. If it is behind, `get_orchestration_overview`, the dispatch receipt and the `wait_codex_workers` response gain an `update` field with `latest_version` and `npm i -g codex-supervisor-mcp@latest`. The skill tells the main thread to pass that on.
192
+ - The files. A global install records the unpacked tarball's integrity in `node_modules/.package-lock.json`; if it differs from the registry's value for that version, the files on disk are not the published build and the notice says to reinstall. A git checkout has no such value and reports its commit.
305
193
 
306
- The answer is cached for an hour and refreshed every six hours while the process runs. An unreachable registry is not an error: the result says `source: "offline"` and nothing nags. `CODEX_SUPERVISOR_NO_UPDATE_CHECK=1` turns the check off; `CODEX_SUPERVISOR_REGISTRY` points it at a private registry. The board shows the same result in its lower left corner.
194
+ Cached an hour, re-checked every six while running. An unreachable registry is not an error; the result says `source: "offline"`. The board shows the same result in the lower left. `CODEX_SUPERVISOR_NO_UPDATE_CHECK=1` turns it off, `CODEX_SUPERVISOR_REGISTRY` points at a private registry.
307
195
 
308
196
  ## Environment variables
309
197
 
310
198
  | Variable | Default | Effect |
311
199
  |---|---|---|
312
- | `SUPERVISOR_HOME` | `~/.codex-supervisor` | State root. sqlite, event streams, and worktrees all live under it |
313
- | `CODEX_HOME` | `~/.codex` | Read-only. Used to read Codex's own `goals_1.sqlite` |
314
- | `CODEX_BIN` | `codex` (via `PATH`) | Path to the Codex CLI. On Windows a bare name is expanded through `PATHEXT` and the `.cmd` shim is stepped over automatically; a `.js` / `.cjs` / `.mjs` target is started with `node` |
315
- | `GIT_BIN` | `git` (via `PATH`) | Path to the Git executable |
200
+ | `SUPERVISOR_HOME` | `~/.codex-supervisor` | State root. The MCP and the board must use the same one |
201
+ | `CODEX_HOME` | `~/.codex` | Read-only, for Codex's native `goals_1.sqlite` |
202
+ | `CODEX_BIN` | `codex` | Path to the Codex CLI. The Windows `.cmd` shim is bypassed; a `.js` target is started with `node` |
203
+ | `GIT_BIN` | `git` | Path to git |
316
204
  | `SUPERVISOR_WEB_PORT` / `SUPERVISOR_WEB_HOST` | `7877` / `127.0.0.1` | Where the board listens |
317
- | `CODEX_SUPERVISOR_NO_UPDATE_CHECK` | unset | Set to `1` to disable the update check |
318
- | `CODEX_SUPERVISOR_REGISTRY` | `https://registry.npmjs.org` | Registry the update check asks |
319
- | `CODEX_SUPERVISOR_UPDATE_TIMEOUT_MS` | `4000` | How long the update check waits for the registry |
205
+ | `CODEX_SUPERVISOR_NO_UPDATE_CHECK` | unset | `1` disables the update check |
206
+ | `CODEX_SUPERVISOR_REGISTRY` | `https://registry.npmjs.org` | Registry for the update check |
207
+ | `CODEX_SUPERVISOR_UPDATE_TIMEOUT_MS` | `4000` | How long to wait for the registry |
208
+ | `CODEX_SUPERVISOR_SKIP_SETUP` | unset | `1` skips the `postinstall` setup |
320
209
 
321
- When the MCP client starts without `codex` on `PATH`, which is common for GUI-launched apps, set `CODEX_BIN` explicitly:
210
+ A process started by a GUI client often has no `codex` on `PATH`; set `CODEX_BIN` in the config:
322
211
 
323
212
  ```json
324
213
  {
@@ -332,81 +221,114 @@ When the MCP client starts without `codex` on `PATH`, which is common for GUI-la
332
221
  }
333
222
  ```
334
223
 
335
- ## Known limitations
224
+ ## Install details
336
225
 
337
- - **A worker's lifetime is tied to the MCP process.** `codex` is a child of the MCP process, so killing the MCP process leaves workers behind. They get settled as `lost` on the next `list_codex_workers` / `get_orchestration_overview`. The real fix is a resident daemon, see the Roadmap.
338
- - **The worktree is created from a commit, so uncommitted work isn't in it.** The default is the repository's `HEAD`; `baseRef` accepts any branch, tag or sha (one that doesn't resolve refuses the dispatch with `invalid_base_ref` instead of quietly falling back to `HEAD`). Modified and untracked files sitting in the main thread's checkout don't exist inside the worker's worktree. Give the task absolute paths, or commit first. The worker's own changes land on the `codex/<taskId>` branch and never touch the main checkout.
339
- - **Only the working directory is isolated.** Temp directories (`TMPDIR`), databases, and ports are process-level resources and stay shared, so two workers writing the same temp file still collide. Give each one its own paths, database name, and port in the task if you need that.
340
- - **`ownedPaths` is a pre-dispatch conflict check, not a runtime sandbox.** It stops two workers from registering the same file; it does not stop a worker from creating a file it never listed, because the sandbox is `workspace-write` and any path inside its own worktree is writable. Verify the output from the diff.
341
- - **It reports "it finished", not "it's correct".** Terminal states come from Codex's `turn.completed` and the process exit code; `exit_code: 0` only means it didn't crash. Judging the output is the main thread's job: run the checks, spot-read the content.
342
- - **A terminal state lands in two steps, and wait only returns once both have.** `turn.completed` flips `status` to `completed` first; `exit_code` is written when the process exits. `wait_codex_workers` counts a worker as finished only once `exit_code` is recorded (or nobody is left to record it), so the snapshot it returns matches the next `get_codex_worker_status` read. A direct status read can still land between the two steps: `completed` with `exit_code: null` is that gap, read again a moment later.
343
- - **Don't expect one `wait_codex_workers` call to cover a long job.** Your client's MCP tool timeout is a hard wall (the `timeout` field in `.mcp.json`, or `MCP_TOOL_TIMEOUT`), and hitting it kills the call. The default wait returns after 2 minutes with a progress snapshot; loop instead of waiting once.
344
- - **Long text comes back clipped by default.** `current_action` is cut at 300 characters, the prompt inside `get_codex_worker_status` is cut at 300 (`includePrompt: true` lifts that), and `last_message` is cut at 400 in the overview and the wait response (4000 in the status response). Nothing is lost: the full command stream is in `get_codex_worker_events` and the full report is in `get_worker_result`. This is what takes one `wait_codex_workers` round trip from tens of KB down to a few KB - which matters because a client that backgrounds a timed-out call replays the whole result as a notification.
345
- - **Nothing is written to Codex's native goal store.** `goals_1.sqlite` belongs to Codex and this MCP only reads it. Once a worker starts, it calls Codex's own `create_goal`; this MCP only splices that instruction into the prompt at dispatch time.
346
- - **Native goals depend on the model complying.** `codex exec` does not create a goal on its own; the instruction at dispatch time is what makes the worker create one. The model occasionally skips it, in which case `native_goal` is `null` and `get_worker_goal` falls back to the copy recorded at dispatch. The state machine is unaffected.
347
- - **`search_works` is substring matching, not a full-text index.** At a few hundred works, a `LIKE` scan is fast enough and costs nothing to maintain. Talk about something else at tens of thousands.
348
- - **Cross-process cancel goes through the pid.** When the process handle isn't in this process, it first confirms the pid's command line contains `codex` (`ps` on macOS and Linux, CIM on Windows, `tasklist` as a fallback), then sends `SIGTERM` (`taskkill /T /F` on Windows), so a recycled pid doesn't get killed by mistake.
349
- - **`create_codex_followup_worker` and `resume_codex_worker` are not the same thing.** The first opens a new session and restates the context in prose; the second reattaches the same session. Use the second when details matter.
350
- - **`session_id` comes from the dispatcher; this MCP doesn't generate it.** Pass the same value for a batch of work and `get_session_works` can group it afterwards. Without it the column is `NULL` and the batch is unrecoverable by session.
226
+ ### GUI clients
351
227
 
352
- ## Roadmap
228
+ GUI clients do not run `postinstall`; add the JSON above to the config file:
353
229
 
354
- 1. ~~De-personalize: `CODEX_BIN` / `SUPERVISOR_HOME` / `GIT_BIN` environment variables~~ ✅
355
- 2. ~~Work state machine: split `status` and `phase`, add `lost`~~ ✅
356
- 3. ~~Tool surface: `ownedPaths` / `goal` / `dependsOn`, four new tools, event gates~~ ✅
357
- 4. ~~Cross-session continuation: persist `thread_id` + `resume_codex_worker`~~ ✅
358
- 5. ~~Concurrency stability: two crash points, ownership conflicts, multi-process writes~~ ✅
359
- 6. ~~Session dimension: persist `session_id` + `get_session_works` for reconnects~~
360
- 7. ~~Find past work by keyword: `search_works`~~
361
- 8. ~~Worker-native goals: inject a `create_goal` instruction at dispatch~~
362
- 9. ~~Windows support: `.cmd` shim bypass, `taskkill` process tree, cross-platform `PATH` / `PATHEXT`~~ ✅
363
- 10. Resident daemon: move dispatch and process lifetime out of the MCP process
364
- 11. ~~A live React board~~ ✅
365
- 12. ~~Session titles and notes, update check~~ ✅
366
-
367
- Rejected, with the reasoning, so nobody brings them up again:
368
-
369
- | Idea | Why not |
370
- |---|---|
371
- | Vector search | `search_works` substring matching is faster and needs zero maintenance at a few hundred works. Both vendors' official memory systems (Codex `memories`, Claude auto-memory) are file search too, not vectors |
372
- | Sorting by `usage_count` | Measured: of 80 works, only 2 were ever referenced again. Every counter sat at 0 or 1, so sorting did nothing |
373
- | Reusing Codex's `usage_count` | That number counts how often a memory entry was cited, which is a different question from how often the main thread looked it up |
374
- | A three-layer memory index | The current data volume can't justify one layer. `get_worker_summary` is enough |
230
+ | Client | macOS | Windows | Linux |
231
+ |---|---|---|---|
232
+ | Claude Desktop | `~/Library/Application Support/Claude/claude_desktop_config.json` | `%APPDATA%\Claude\claude_desktop_config.json` | `~/.config/Claude/claude_desktop_config.json` |
233
+ | Cursor | `~/.cursor/mcp.json` | `%APPDATA%\Cursor\mcp.json` | `~/.config/cursor/mcp.json` |
234
+ | Windsurf | `~/.codeium/windsurf/mcp_config.json` | `%APPDATA%\Codeium\windsurf\mcp_config.json` | `~/.config/.codeium/windsurf/mcp_config.json` |
235
+
236
+ ### Running the setup again
375
237
 
376
- ## Using the bundled skill
238
+ ```bash
239
+ codex-supervisor-setup # detect clients, install the skill, register the MCP
240
+ codex-supervisor-setup --target claude,codex
241
+ codex-supervisor-setup --skill-only
242
+ codex-supervisor-setup --mcp-only
243
+ codex-supervisor-setup --dry-run # print the plan only
244
+ ```
245
+
246
+ An existing skill with different content is backed up to `SKILL.md.bak-<timestamp>` before it is overwritten.
377
247
 
378
- The repo ships `skills/codex-supervisor/SKILL.md`. After installing, drop it into the main thread's skill directory so it knows when to dispatch:
248
+ ### Upgrading
379
249
 
380
250
  ```bash
381
- # Claude Code
382
- mkdir -p ~/.claude/skills/codex-supervisor
383
- cp "$(npm root -g)/codex-supervisor-mcp/skills/codex-supervisor/SKILL.md" ~/.claude/skills/codex-supervisor/
251
+ npm install -g codex-supervisor-mcp@latest
252
+ npm ls -g --depth=0 | grep codex-supervisor
253
+ ```
254
+
255
+ Then restart Claude Code / Codex. Three things to know:
384
256
 
385
- # Codex / any client that reads ~/.agents/skills
386
- mkdir -p ~/.agents/skills/codex-supervisor
387
- cp "$(npm root -g)/codex-supervisor-mcp/skills/codex-supervisor/SKILL.md" ~/.agents/skills/codex-supervisor/
257
+ - The registry takes a few minutes to move `latest` after a publish. If the version did not change, wait, or pin the version.
258
+ - `npm link` installs a symlink: `src/` changes apply at once, the skill does not sync by itself; run `codex-supervisor-setup`.
259
+ - Switching Node versions breaks the registered absolute path. Run `claude mcp remove -s user codex-supervisor` and `codex mcp remove codex-supervisor` first, then install.
260
+
261
+ ### Uninstall
262
+
263
+ ```bash
264
+ npm uninstall -g codex-supervisor-mcp
265
+ claude mcp remove -s user codex-supervisor
266
+ codex mcp remove codex-supervisor
267
+ rm -rf ~/.claude/skills/codex-supervisor ~/.agents/skills/codex-supervisor ~/.codex/skills/codex-supervisor
268
+ rm -rf ~/.codex-supervisor
388
269
  ```
389
270
 
390
- The skill covers the dispatch flow, the order to read results in, how to tell `failed` from `lost`, and how to reconnect after a crash.
271
+ ### Windows
272
+
273
+ - The npm-installed CLI is `codex.cmd`, and Node refuses to spawn it directly since 18.20 / 20.12 (the behaviour after CVE-2024-27980). `shell: true` is not used, because cancelling would then only kill the shell. Instead the package's own entry, `node_modules/@openai/codex/bin/codex.js`, is started with `node`.
274
+ - Cross-process cancel runs `taskkill /PID <pid> /T /F` on the whole tree, after `Get-CimInstance Win32_Process` confirms the pid runs codex.
275
+ - Beyond `PATH` it probes `%APPDATA%\npm`, `%LOCALAPPDATA%\pnpm`, `%LOCALAPPDATA%\Volta\bin` and `%ProgramFiles%\nodejs`.
276
+
277
+ ### Troubleshooting
278
+
279
+ | Symptom | Cause | Fix |
280
+ |---|---|---|
281
+ | Not in `claude mcp list` | The install method skipped `postinstall` | `codex-supervisor-setup`, or `claude mcp add` by hand |
282
+ | Dispatch says `codex only resolved to a shell shim` | Windows found only the `.cmd`; the package entry behind it is gone | Reinstall `@openai/codex`, or point `CODEX_BIN` at `codex.js` |
283
+ | Worker is `failed` at once with `spawn codex ENOENT` | No `codex` on the process's `PATH` | Set `CODEX_BIN` in the config |
284
+ | `Cannot find module 'node:sqlite'` | Node older than 22.13.0 | Upgrade Node |
285
+ | Worker stuck in `lost` | The MCP process was killed and the worker orphaned | `resume_codex_worker`, or dispatch again |
286
+ | `ownedPaths overlap with active worker(s)` | Two workers claimed the same paths | Split differently, or cancel the one holding them |
287
+ | The board is empty | The board and the MCP use different `SUPERVISOR_HOME`s | Start the board with the same one |
288
+
289
+ ## Known limitations
290
+
291
+ - A worker's lifetime is tied to the MCP process. Kill the MCP and the worker is left behind, settled as `lost` on the next read. The fix is a resident daemon; see the Roadmap.
292
+ - The worktree is cut from a commit, so uncommitted work in your checkout is not in it. Give the task absolute paths, or commit first.
293
+ - Only the working directory is isolated. Temp directories, databases and ports are shared; workers that would hit the same dev server need to be kept apart in the task.
294
+ - `ownedPaths` is checked at dispatch only; it does not stop a worker from creating a file it never listed. Review the diff.
295
+ - It reports "finished", not "correct". `exit_code: 0` means it did not crash; acceptance is the main thread's job.
296
+ - Do not expect one `wait_codex_workers` call to cover a long job. The client's MCP tool timeout is a hard wall; the default returns a snapshot after two minutes, loop instead.
297
+ - Nothing is written to Codex's native goal store; `goals_1.sqlite` is read-only here. The worker creates its own goal and sometimes skips it, in which case `native_goal` is `null` and the state machine is unaffected.
298
+ - `search_works` is substring matching. Fine at hundreds of rows; revisit at tens of thousands.
299
+
300
+ ## Roadmap
301
+
302
+ 1. ~~`CODEX_BIN` / `SUPERVISOR_HOME` / `GIT_BIN`~~ ✅
303
+ 2. ~~`status` and `phase` split, `lost` added~~ ✅
304
+ 3. ~~`ownedPaths` / `goal` / `dependsOn`, event gates~~ ✅
305
+ 4. ~~`thread_id` on disk + `resume_codex_worker`~~ ✅
306
+ 5. ~~Concurrency: crash points, ownership conflicts, multi-process writes~~ ✅
307
+ 6. ~~`session_id` + `get_session_works`~~ ✅
308
+ 7. ~~`search_works`~~ ✅
309
+ 8. ~~Native worker goals~~ ✅
310
+ 9. ~~Windows~~ ✅
311
+ 10. ~~Web board~~ ✅
312
+ 11. ~~Session titles, update check, `baseRef`, committed changes visible~~ ✅
313
+ 12. Resident daemon: move dispatch and process lifetime out of the MCP process
314
+
315
+ Not planned: vector search (substring matching is faster at this scale and costs nothing to maintain), `usage_count` ordering (2 of 80 real works were ever referenced again), a layered memory index (not enough data to need one).
391
316
 
392
317
  ## Development
393
318
 
394
319
  ```bash
395
320
  npm install
396
- npm test # deterministic: truncation, state machine, v1→v2 migration, setup, Windows routing, 23 regression cases, 40 edge cases
321
+ npm test # truncation, state machine, migration, setup, Windows routing, 23 regression cases, 40 edge cases
397
322
  npm run test:edge # test/edge only: update check against a fake registry, session titles, baseRef, non-ASCII paths, ghost rows, board API
398
- npm run test:real # end-to-end against the real codex CLI (includes cross-process resume and worktree isolation)
399
- npm run smoke # basic smoke test (real codex)
323
+ npm run test:real # end to end with the real codex CLI
400
324
  npm run smoke:mcp # MCP protocol smoke test
401
325
  npm run monitor # Ink terminal board
402
- npm run web:install # board dependencies (web/)
403
- npm run web:build # bundle the board into web/dist; runs before publish
326
+ npm run web:install # board dependencies
404
327
  npm run web:dev # board with hot reload, /api proxied to 7877
328
+ npm run web:build # bundle into web/dist; runs before publish
405
329
  ```
406
330
 
407
- `npm test` replays a fixed Codex event stream through `src/test-fixtures/fake-codex.js`, so it's fast and deterministic. `npm run test:real` actually invokes `codex exec`. It's slower, but it's the evidence that this still works against the current Codex.
408
-
409
- CI runs on Ubuntu, macOS, and Windows, plus a separate Node 22.13.0 job that pins the lower bound declared in `engines`, since `node:sqlite` had no unflagged build before it. The four `setup-windows-test.js` cases use a real filesystem to simulate the `.cmd` shim under `%APPDATA%\npm`, verifying that automatic MCP registration genuinely works rather than just passing a parser unit test.
331
+ `npm test` replays fixed Codex event streams through `src/test-fixtures/fake-codex.js`, fast and deterministic; `npm run test:real` is the evidence of compatibility with the current Codex. CI runs Ubuntu / macOS / Windows plus one Node 22.13.0 job that pins the `engines` floor.
410
332
 
411
333
  ## License
412
334