codex-supervisor-mcp 0.7.0 → 0.7.2

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
@@ -16,23 +16,23 @@ English | [中文](README.md)
16
16
 
17
17
  ## What it is
18
18
 
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:
19
+ Point several agents at one repository and they overwrite each other, and nobody can say who changed what. This MCP takes dispatch and bookkeeping out of the model's context and puts them on disk:
20
20
 
21
- | Problem | What happens here |
21
+ | Problem | What it does |
22
22
  |---|---|
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 |
23
+ | Workers trample each other's files | One Git worktree per worker, `ownedPaths` checked for overlap before dispatch |
24
+ | Worker output floods the main thread | Events go to `data/runs/<taskId>.jsonl`; reads are gated by `limit` / `maxChars` / `kinds` |
25
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 |
26
+ | Nobody knows who is still running after a restart | `supervisor.sqlite`, one row per work, with `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
+ | "Failed" and "process gone" look alike | The state machine keeps `failed` and `lost` apart |
29
+ | No view of where a batch is | `codex-supervisor-web`, a board that shows every worker by session |
30
30
 
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.
31
+ Workers run `codex exec`; `model` is passed through. The main thread stays on Claude for judgement, workers can run DeepSeek or any model Codex has a provider for, and the bills stay separate.
32
32
 
33
33
  ## Five minutes to a running batch
34
34
 
35
- Requirements: Node.js 22.13.0 or newer, and the `codex` CLI on `PATH`. macOS, Linux and Windows.
35
+ Prerequisites: Node.js 22.13.0 or newer, `codex` on `PATH`. macOS, Linux and Windows.
36
36
 
37
37
  ### 1. Install
38
38
 
@@ -40,37 +40,30 @@ Requirements: Node.js 22.13.0 or newer, and the `codex` CLI on `PATH`. macOS, Li
40
40
  npm install -g codex-supervisor-mcp
41
41
  ```
42
42
 
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:
44
-
45
- ```bash
46
- claude mcp list | grep codex-supervisor
47
- codex mcp list | grep codex-supervisor
48
- ```
49
-
50
- If it is missing (`npx`, `--ignore-scripts` and pnpm installs skip `postinstall`), add it by hand:
43
+ `postinstall` copies the skill into `~/.claude/skills/`, `~/.agents/skills/` and `~/.codex/skills/` and registers the MCP with `claude mcp add -s user` and `codex mcp add`. If `claude mcp list` does not show it (`npx`, `--ignore-scripts` and pnpm skip `postinstall`), add it by hand:
51
44
 
52
45
  ```bash
53
46
  claude mcp add -s user codex-supervisor -- npx -y codex-supervisor-mcp
54
47
  codex mcp add codex-supervisor -- npx -y codex-supervisor-mcp
55
48
  ```
56
49
 
57
- Restart Claude Code / Codex so the MCP process is the new one.
50
+ Restart Claude Code / Codex. Updates take care of themselves from here; see "Updating".
58
51
 
59
52
  ### 2. Dispatch a batch
60
53
 
61
- In Claude Code, say it in plain words; the skill makes it follow the right sequence:
54
+ Say it in plain words in Claude Code; the skill makes it follow the right steps:
62
55
 
63
- > Fill in the unit tests for these three modules. Use codex-supervisor, three workers in parallel, session title "unit tests".
56
+ > Fill in the unit tests for these three modules, three codex-supervisor workers in parallel, session "unit tests".
64
57
 
65
58
  What the main thread does underneath (you can call the tools yourself):
66
59
 
67
60
  ```
68
61
  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
62
+ wait_codex_workers two minutes by default, then a snapshot, call again until done
63
+ get_worker_result ×3 each worker's full report and changed files
71
64
  ```
72
65
 
73
- Each worker's changes sit on its own `codex/<taskId>` branch. Whether and how to merge is the main thread's call.
66
+ Each worker's changes sit on its own `codex/<taskId>` branch; whether and how to merge is the main thread's call.
74
67
 
75
68
  ### 3. Open the board
76
69
 
@@ -80,17 +73,13 @@ codex-supervisor-web
80
73
  npx -p codex-supervisor-mcp codex-supervisor-web
81
74
  ```
82
75
 
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.
84
-
85
- Which store it opens: `SUPERVISOR_HOME` from the environment if set; otherwise the nearest `.mcp.json` above the current directory, if its `codex-supervisor` entry sets `SUPERVISOR_HOME`; otherwise the default `~/.codex-supervisor`. The startup line says which one and where it came from, so running it inside the project directory is enough.
86
-
87
- `SUPERVISOR_WEB_PORT` changes the port. A taken port (usually a board that is already running) is reported in one line and the process exits. The board does not dispatch or cancel; the ask tab starts a read-only Codex side session, described below.
76
+ Open `http://127.0.0.1:7877`. State directory: `SUPERVISOR_HOME` if set, else the one configured in the nearest `.mcp.json` above the current directory, else `~/.codex-supervisor`. `SUPERVISOR_WEB_PORT` changes the port; a taken port is reported. The board never dispatches or cancels.
88
77
 
89
78
  ## How I use it
90
79
 
91
- The boundary first: this MCP does not care who the main thread is. Claude Code, Codex itself, Cursor, anything that speaks MCP can dispatch. Workers run `codex exec`, so any model you have configured as a Codex provider works, DeepSeek on one worker and GPT on the next. You can describe the batch in plain words and let the skill make the calls, or call the tools yourself. What follows is my way, not the only way.
80
+ This MCP does not care who the main thread is: Claude Code, Codex, Cursor, anything that speaks MCP can dispatch, and workers use whatever model Codex has a provider for. What follows is my way, not the only way.
92
81
 
93
- I run two Claude Code sessions. One writes documents, the other dispatches. A session that writes the design and watches the workers fills its context in two hours, and mixes the judgement that goes into code with the judgement that goes into dispatch.
82
+ I run two Claude Code sessions, one for documents and one for dispatch. A session that writes the design and watches the workers fills its context in two hours.
94
83
 
95
84
  | Who | Where | Does what |
96
85
  |---|---|---|
@@ -99,7 +88,7 @@ I run two Claude Code sessions. One writes documents, the other dispatches. A se
99
88
  | Main-brain session | A worktree of the code repository | Read the brief, dispatch Codex workers, check every worker's diff, write results back into the brief, report to me. Writes no business code |
100
89
  | Codex workers | Their own worktrees | One worker per step, one commit per step, build and verify on a remote machine. No push, no merge |
101
90
 
102
- Only one block of text passes between the two sessions. The planning session writes it, I paste it into the main-brain session and hand it over with `/goal`. Its shape is always the same:
91
+ One block of text passes between the two sessions: the planning session writes it, I paste it into the main-brain session and hand it over with `/goal`. Its shape is fixed:
103
92
 
104
93
  ```text
105
94
  [Role] You are the main brain: read docs and code, dispatch workers, check results, update docs, report to me. You write no business code.
@@ -134,19 +123,19 @@ land_codex_worker checked, then landed on the integration branch
134
123
 
135
124
  The last block was 25 steps. The main-brain session ran it end to end with nothing in its context but the brief and each worker's report. The tokens the workers burn are not on the main brain's bill.
136
125
 
137
- "One worker per step, one commit per step, checked before the next" came from trying it the other way. A worker returns, the main brain reads the diff and finds step 5 wrong: it sends one `resume_codex_worker` saying what is wrong and asking for `git commit --amend` into the same commit. Same Codex thread, full context, checked again before landing. A worker that did three steps cannot be fixed this way: when step 5 is wrong, the commits for steps 6 and 7 are already on top.
126
+ "One worker per step, one commit per step, checked before the next" came from trying it the other way. When a step is wrong, one `resume_codex_worker` asks for `--amend` into the same commit, the main brain checks again, then lands. A worker that did three steps cannot be fixed this way: when step 5 is wrong, steps 6 and 7 are already on top.
138
127
 
139
128
  ## What the board shows
140
129
 
141
130
  | Where | What |
142
131
  |---|---|
143
- | 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 |
144
- | 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 |
145
- | 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 |
146
- | Worker drawer | Status, title, goal, the running command and one line of numbers (duration / files / commands / tokens / exit code) at the top; seven tabs below: overview (start and end, model, sandbox, thread, branch, base commit, worktree, owned paths), report (rendered markdown), changes, commands, events (virtualized), task text, ask. The divider between the main column and the drawer drags; double-click resets it |
147
- | Ask | A side question about this worker, the way Codex's own `/btw` works: its Codex thread is forked into a read-only side session that answers. The fork can read the worktree and any file on disk, changes nothing, and never touches the worker's own thread, running or not. The first question forks, later ones `resume` the same side session, so it is multi-turn; reasoning, the commands it ran (with exit code and output) and the answer appear step by step as Codex finishes them. Every turn's question and output is stored in the `side_turns` table: switching tabs, closing the drawer or reloading never cuts a turn off, the page re-attaches and replays; another tab can attach too, or stop it; a turn nobody watches still runs to the end and keeps its answer; a turn that was running when the board restarted is marked interrupted. "End" runs `codex delete` on the side session and clears the history. Workers dispatched before 0.5 recorded no thread id and cannot be asked |
132
+ | Left column | One row per session: title, worker count, how many running, last activity. Version and update notice at the bottom |
133
+ | Session page | Counts (total / running / done / failed / lost); while workers run, the command each one is on |
134
+ | Worker table | One row per worker: status, title, current command or last report line, duration, files changed, commands run |
135
+ | Worker drawer | Seven tabs: overview, report, changes, commands, events, task, side chat |
136
+ | Side chat | Ask the worker a question, the way Codex's `/btw` works: its thread is forked into a read-only side session, the running work is untouched. Multi-turn, stoppable, and a page that leaves picks up where it was |
148
137
 
149
- Lists load lazily: 20 sessions per page in the rail, 40 workers per page in the ledger, the next page fetched as you scroll to the end; while something runs the loaded pages refresh every 2.5 seconds. Light and dark follow the system. System fonts only, nothing fetched from the network.
138
+ Light and dark follow the system. No external resources.
150
139
 
151
140
  ## Tools
152
141
 
@@ -154,78 +143,53 @@ Nineteen.
154
143
 
155
144
  | Tool | Arguments | What it does |
156
145
  |---|---|---|
157
- | `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 |
146
+ | `create_codex_worker` | `task`, `cwd`, **`ownedPaths`**, **`goal`**, `session_id`, `session_title`, `session_note`, `dependsOn`, `baseRef`, `sandbox`, `model`, `reasoningEffort`, `title`, `skipGitRepoCheck` | Start a worker. `baseRef` picks the commit the worktree is cut from (default `HEAD`); pass another worker's `codex/<id>` to build on it |
158
147
  | `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 |
159
148
  | `resume_codex_worker` | `task_id`, `prompt` | Continue the same Codex conversation; `thread_id` stays |
160
- | `wait_codex_workers` | `task_ids`, `mode` (any/all), `timeoutMinutes`, `timeoutMs`, `compact`, `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; `compact` returns one line per worker |
149
+ | `wait_codex_workers` | `task_ids`, `mode` (any/all), `timeoutMinutes`, `timeoutMs`, `compact`, `includeEvents`, `eventLimit`, `eventMaxChars`, `eventKinds` | Wait for terminal states. Two minutes by default, then a snapshot while the workers keep running; `compact` returns one line per worker |
161
150
  | `get_orchestration_overview` | `status`, `limit` | Every worker in one table, capped at 7000 bytes. Carries `version` and `update` |
162
- | `get_worker_result` | `task_id`, `limit`, `maxChars` | The worker's own full report plus `status` / `exit_code` / `changed_files`. The door for conclusions |
163
- | `get_worker_diff` | `task_id`, `maxChars`, `paths` | What the worker actually changed: patches from the worktree's starting commit to its working tree, committed or not, untracked files included. `maxChars` bounds the whole answer; files past it are listed without a patch |
164
- | `ask_codex_worker` | `task_id`, `question`, `timeoutMs`, `maxChars`, `end` | Ask the worker on the side: its thread is forked into a read-only side session and the question goes there, so the worker's own thread is untouched. Without `question` it reads the latest answer; `end` deletes the fork |
165
- | `land_codex_worker` | `task_id`, `onto` | Cherry-pick the worker's commits from `codex/<id>` onto the current branch of the directory it was dispatched from. The target must be clean, `onto` is a check and never a switch, and a conflict rolls back and lists the files |
151
+ | `get_worker_result` | `task_id`, `limit`, `maxChars` | The worker's own full report plus `status` / `exit_code` / `changed_files` |
152
+ | `get_worker_diff` | `task_id`, `maxChars`, `paths` | What the worker actually changed: patches from the worktree's start to its working tree, committed or not. `maxChars` bounds the answer; files past it are listed without a patch |
153
+ | `ask_codex_worker` | `task_id`, `question`, `timeoutMs`, `maxChars`, `fresh`, `end` | Ask the worker on the side. Its thread is forked into a read-only session with no network and no MCP tools; the worker itself is untouched. A resumed worker gets a new fork by itself, `fresh` forces one, `end` deletes it |
154
+ | `land_codex_worker` | `task_id`, `onto`, `commitMessage` | Cherry-pick the worker's `codex/<id>` commits onto the current branch of the directory it was dispatched from. Clean target only, a conflict rolls back. `commitMessage` first commits the worker's uncommitted edits as one commit |
166
155
  | `get_worker_summary` | `task_id` | One paragraph: goal, status, changes, last command and message |
167
- | `get_codex_worker_status` | `task_id`, `includePrompt`, `promptMaxChars` | One worker in detail; the prompt is clipped to 300 characters unless asked for |
156
+ | `get_codex_worker_status` | `task_id`, `includePrompt`, `promptMaxChars` | One worker in detail |
168
157
  | `get_codex_worker_events` | `task_id`, `limit`, `maxChars`, `kinds` | The raw event stream |
169
158
  | `get_worker_goal` | `task_id` | The goal recorded at dispatch plus the native Codex goal (tokens, time) |
170
159
  | `list_codex_workers` | `status`, `includeHistory`, `includeDetails` | List workers, active ones by default |
171
- | `get_session_works` | `session_id` | Every worker of one session, with its title and note. The way back after a main-thread restart |
172
- | `describe_session` | `session_id`, `title`, `note` | Record a title and note; fields left out keep their value |
160
+ | `get_session_works` | `session_id` | Every worker of one session. The way back after a main-thread restart |
161
+ | `describe_session` | `session_id`, `title`, `note` | Record a title and note for a session |
173
162
  | `search_works` | `query`, `limit` | Substring search over title / goal / prompt / last_message, newest first |
174
- | `check_for_update` | `force` | Ask the registry for a newer version and whether the installed files match the published tarball |
175
- | `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 |
176
-
177
- ### The three things to always pass
178
-
179
- - `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.
180
- - `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.
181
- - `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.
182
-
183
- ### Reading results without filling the context
184
-
185
- | Want | Use | Cost |
186
- |---|---|---|
187
- | Status of every worker | `get_orchestration_overview` | 7000 bytes, hard cap |
188
- | One worker's conclusion | `get_worker_result` | The full report, tens of thousands of characters for a big job |
189
- | Alive or finished | `get_worker_summary` | A paragraph |
190
- | What it did | `get_codex_worker_events` | Filter with `kinds`, bound with `limit`, clip with `maxChars` |
191
- | What it actually changed | `get_worker_diff` | Capped by `maxChars`; the file list is always complete |
192
- | Why it did that | `ask_codex_worker` | One answer; the fork carries the worker's whole context |
163
+ | `check_for_update` | `force` | Ask the registry for a newer version |
164
+ | `cancel_codex_worker` | `task_id` | Stop a worker. Falls back to the pid across processes, after confirming that pid runs codex |
193
165
 
194
- 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.
166
+ Two are required: `ownedPaths` (checked against every running worker before dispatch, overlap refuses the call, dispatch-time only) and `goal.objective` (the worker turns it into a native Codex goal). Without `session_id` nothing groups the batch; use one value for the whole batch.
195
167
 
196
168
  ## How this differs from Claude Code subagents
197
169
 
198
- File isolation is not the difference: subagents can open their own worktree (`isolation: worktree`). The difference is the model and the process.
170
+ File isolation is not the difference: a subagent can open a worktree too. The difference is the model and the process.
199
171
 
200
172
  | | Claude Code subagent | codex-supervisor worker |
201
173
  |---|---|---|
202
- | Models | Claude only | `model` goes to the Codex CLI; DeepSeek works |
174
+ | Model | Claude only | `model` passed to the Codex CLI; DeepSeek works |
203
175
  | Who does the work | Claude Code itself | A separate `codex exec` process |
204
- | Two workers, one file | Separate worktrees, no path declaration | `ownedPaths` intersection before dispatch; overlap is refused |
205
- | Main thread dies | Workers die with it | `thread_id` is in SQLite; `resume_codex_worker` picks the conversation back up |
176
+ | Two writers on one file | Worktrees keep them apart, no path declaration | `ownedPaths` overlap is refused before dispatch |
177
+ | Main-thread process dies | Workers die with it | `thread_id` is in sqlite; `resume_codex_worker` picks the same conversation up |
206
178
  | Who can drive it | Claude Code only | Any MCP client |
207
- | Watching the work | Only the returned conclusion | Raw JSONL and the web board |
179
+ | Seeing the process | Only the returned conclusion | Raw JSONL and the web board |
208
180
 
209
181
  ## The state machine
210
182
 
211
- `status` is the lifecycle, one value per work:
212
-
213
- | Value | Meaning |
183
+ | `status` | Meaning |
214
184
  |---|---|
215
185
  | `queued` | Dispatched, not started |
216
- | `running` | Running |
217
- | `completed` | Finished with exit code 0 |
218
- | `failed` | Non-zero exit, `turn.failed`, or spawn failure |
186
+ | `running` | Running. `phase`: `starting → thinking → command → editing → reporting` |
187
+ | `completed` | Done |
188
+ | `failed` | Non-zero exit, `turn.failed`, spawn failure |
219
189
  | `cancelled` | Stopped by `cancel_codex_worker` |
220
- | `lost` | Killed by an outside signal, the MCP process vanished, or the row was written and no process ever started |
221
-
222
- `phase` has a value only while `running`: `starting → thinking → command → editing → reporting`.
223
-
224
- `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.
225
-
226
- 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.
190
+ | `lost` | Killed by an outside signal, MCP process gone, or a row whose process never started. `resume_codex_worker` picks it up |
227
191
 
228
- 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`.
192
+ A terminal state lands in two steps: `turn.completed` sets `completed`, the process exit writes `exit_code`; `wait_codex_workers` returns only after the exit code is in. Windows has no signals, so an outside kill reports as `failed` with an exit code. Native Codex goals: `paused` / `blocked` count as `running` and go to `needs_attention`, `usageLimited` / `budgetLimited` as `failed`.
229
193
 
230
194
  ## Where state lives
231
195
 
@@ -233,42 +197,31 @@ Native Codex goal states map like this: `active` / `paused` / `blocked` are `run
233
197
 
234
198
  | File | Content |
235
199
  |---|---|
236
- | `data/supervisor.sqlite` | `tasks` (one row per work), `task_events` (structured events), `sessions` (titles and notes) |
237
- | `data/runs/<taskId>.jsonl` | The raw `codex --json` output |
238
- | `data/update-check.json` | Cache for the update check |
239
- | `worktrees/<taskId>/` | That worker's Git worktree |
240
-
241
- `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.
242
-
243
- A 0.1.x database migrates itself the first time it is opened, without losing a row.
244
-
245
- ## Update check
246
-
247
- 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:
248
-
249
- - 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.
250
- - 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.
200
+ | `data/supervisor.sqlite` | `tasks` (one row per work), `task_events`, `sessions`, `side_sessions` / `side_turns` (side chat) |
201
+ | `data/runs/<taskId>.jsonl` | Raw `codex --json` output |
202
+ | `data/update-check.json`, `auto-update.json` | Update check and background update records |
203
+ | `worktrees/<taskId>/` | The worker's Git worktree |
251
204
 
252
- 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.
205
+ `changed_files` is the worktree's real diff (`git status` plus `git diff <base_commit> HEAD`), so edits made through the shell and commits the worker made itself are both visible. Git reads run with `core.quotePath=false`, so non-ASCII file names come back as written. Databases from older versions migrate on first open.
253
206
 
254
207
  ## Environment variables
255
208
 
256
209
  | Variable | Default | Effect |
257
210
  |---|---|---|
258
- | `SUPERVISOR_HOME` | `~/.codex-supervisor` | State root. The MCP and the board must use the same one |
259
- | `CODEX_HOME` | `~/.codex` | Read-only, for Codex's native `goals_1.sqlite` |
260
- | `CODEX_BIN` | `codex` | Path to the Codex CLI. The Windows `.cmd` shim is bypassed; a `.js` target is started with `node` |
211
+ | `SUPERVISOR_HOME` | `~/.codex-supervisor` | State root. The MCP and the board must point at the same one |
212
+ | `CODEX_HOME` | `~/.codex` | Read-only: the native `goals_1.sqlite` and the MCP config |
213
+ | `CODEX_BIN` | `codex` | Path to the Codex CLI. The Windows `.cmd` shim is bypassed |
261
214
  | `GIT_BIN` | `git` | Path to git |
262
- | `SUPERVISOR_WEB_PORT` / `SUPERVISOR_WEB_HOST` | `7877` / `127.0.0.1` | Where the board listens |
215
+ | `SUPERVISOR_WEB_PORT` / `SUPERVISOR_WEB_HOST` | `7877` / `127.0.0.1` | Board address |
263
216
  | `CODEX_SUPERVISOR_NO_UPDATE_CHECK` | unset | `1` disables the update check |
264
- | `CODEX_SUPERVISOR_REGISTRY` | `https://registry.npmjs.org` | Registry for the update check |
217
+ | `CODEX_SUPERVISOR_REGISTRY` | `https://registry.npmjs.org` | Registry for the update check and the auto-update |
265
218
  | `CODEX_SUPERVISOR_UPDATE_TIMEOUT_MS` | `4000` | How long to wait for the registry |
266
- | `CODEX_SUPERVISOR_SKIP_SETUP` | unset | `1` skips the `postinstall` setup |
267
219
  | `CODEX_SUPERVISOR_NO_AUTO_UPDATE` | unset | `1` turns the background auto-update off (notify only) |
268
220
  | `CODEX_SUPERVISOR_SKIP_SKILL_SYNC` | unset | `1` turns the skill sync at server start off |
269
- | `CODEX_SUPERVISOR_NPM` | unset | npm for the auto-update (path to `npm-cli.js` or an executable); default is the one shipped with the running node |
221
+ | `CODEX_SUPERVISOR_SKIP_SETUP` | unset | `1` skips the `postinstall` setup |
222
+ | `CODEX_SUPERVISOR_NPM` | unset | npm for the auto-update; default is the one shipped with the running node |
270
223
 
271
- A process started by a GUI client often has no `codex` on `PATH`; set `CODEX_BIN` in the config:
224
+ GUI clients (Claude Desktop, Cursor, Windsurf) do not run `postinstall`: add this to their MCP config file, and since their `PATH` often lacks `codex`, give `CODEX_BIN` explicitly:
272
225
 
273
226
  ```json
274
227
  {
@@ -282,123 +235,74 @@ A process started by a GUI client often has no `codex` on `PATH`; set `CODEX_BIN
282
235
  }
283
236
  ```
284
237
 
285
- ## Install details
286
-
287
- ### GUI clients
288
-
289
- GUI clients do not run `postinstall`; add the JSON above to the config file:
290
-
291
- | Client | macOS | Windows | Linux |
292
- |---|---|---|---|
293
- | Claude Desktop | `~/Library/Application Support/Claude/claude_desktop_config.json` | `%APPDATA%\Claude\claude_desktop_config.json` | `~/.config/Claude/claude_desktop_config.json` |
294
- | Cursor | `~/.cursor/mcp.json` | `%APPDATA%\Cursor\mcp.json` | `~/.config/cursor/mcp.json` |
295
- | Windsurf | `~/.codeium/windsurf/mcp_config.json` | `%APPDATA%\Codeium\windsurf\mcp_config.json` | `~/.config/.codeium/windsurf/mcp_config.json` |
296
-
297
- ### Running the setup again
298
-
299
- ```bash
300
- codex-supervisor-setup # detect clients, install the skill, register the MCP
301
- codex-supervisor-setup --target claude,codex
302
- codex-supervisor-setup --skill-only
303
- codex-supervisor-setup --mcp-only
304
- codex-supervisor-setup --dry-run # print the plan only
305
- ```
306
-
307
- An existing skill with different content is backed up to `SKILL.md.bak-<timestamp>` before it is overwritten.
238
+ ## Updating
308
239
 
309
- ### Upgrading
240
+ Nothing to do by hand. The server asks the registry in the background at start (then every six hours); when a newer version is published it starts a detached process that runs `npm i -g` into the same global path. The running session is untouched; the next session starts on the new version. Progress lands in `data/auto-update.json` and in `update.auto_update` on tool results. Only a copy that `npm i -g` installed is touched; a git checkout, an `npm link` or an `npx` copy is left alone, and each version is attempted once.
310
241
 
311
- Nothing to do by hand. Every server start asks the registry in the background (then every six hours); when a newer version is published it starts a detached process that runs `npm i -g codex-supervisor-mcp@<that version>` into the same global path. **The running session is untouched; the next session starts on the new version.** Progress lands in `~/.codex-supervisor/data/auto-update.json` and `auto-update.log`, and tool results carry it as `update.auto_update` (`started / running / done / failed`).
242
+ The skill takes care of itself too: every server start copies the bundled skill into whichever skill directories exist, backing up a differing file as `SKILL.md.bak-<timestamp>`. A session that already loaded the skill sees the new text after loading it again.
312
243
 
313
- Only a copy that `npm i -g` installed is touched, and the updater checks the path against `npm root -g` first. A git checkout, an `npm link`, a project-local dependency and an `npx`-started copy are left alone. Each published version is attempted once, and several sessions starting together share one updater. `CODEX_SUPERVISOR_NO_AUTO_UPDATE=1` turns it off; CI is skipped automatically.
244
+ Where the global directory needs sudo the install fails, the `update` field says why, and `npm install -g codex-supervisor-mcp@latest` by hand still works. Versions up to 0.6.1 only notify; upgrade by hand once and it is automatic from then on. Switching Node versions breaks the registered absolute path: `claude mcp remove -s user codex-supervisor` and `codex mcp remove codex-supervisor` first, then install. To run the setup again: `codex-supervisor-setup` (`--skill-only` / `--mcp-only` / `--dry-run`).
314
245
 
315
- On a machine where the global directory needs sudo the install fails, the `update` field says why, and the manual way still works:
316
-
317
- ```bash
318
- npm install -g codex-supervisor-mcp@latest
319
- ```
320
-
321
- Versions up to 0.6.1 only notify and never install. Coming from one of those, upgrade by hand once; after that it is automatic. No re-registration needed.
322
-
323
- Manual-update pitfalls:
324
-
325
- - The registry takes a few minutes to move `latest` after a publish. If the version did not change, wait, or pin the version.
326
- - 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.
327
- - The skill takes care of itself: every server start copies the bundled skill into whichever of `~/.claude/skills/`, `~/.agents/skills/` and `~/.codex/skills/` already exist, backing up a differing file as `SKILL.md.bak-<timestamp>`. A session that already loaded the skill sees the new text only after loading it again. `CODEX_SUPERVISOR_SKIP_SKILL_SYNC=1` turns the sync off.
328
-
329
- ### Uninstall
246
+ Uninstall:
330
247
 
331
248
  ```bash
332
249
  npm uninstall -g codex-supervisor-mcp
333
250
  claude mcp remove -s user codex-supervisor
334
251
  codex mcp remove codex-supervisor
335
- rm -rf ~/.claude/skills/codex-supervisor ~/.agents/skills/codex-supervisor ~/.codex/skills/codex-supervisor
336
- rm -rf ~/.codex-supervisor
252
+ rm -rf ~/.claude/skills/codex-supervisor ~/.agents/skills/codex-supervisor ~/.codex/skills/codex-supervisor ~/.codex-supervisor
337
253
  ```
338
254
 
339
- ### Windows
255
+ ## Windows
340
256
 
341
- - 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`.
342
- - Cross-process cancel runs `taskkill /PID <pid> /T /F` on the whole tree, after `Get-CimInstance Win32_Process` confirms the pid runs codex.
343
- - Beyond `PATH` it probes `%APPDATA%\npm`, `%LOCALAPPDATA%\pnpm`, `%LOCALAPPDATA%\Volta\bin` and `%ProgramFiles%\nodejs`.
257
+ - The npm-installed CLI is `codex.cmd`, which Node refuses to spawn directly. The runner steps over it to `node_modules/@openai/codex/bin/codex.js` and runs that with `node`; no `shell: true`, which would leave only the shell killable on cancel.
258
+ - Cross-process cancel uses `taskkill /PID <pid> /T /F` for the whole tree, after confirming that pid runs codex.
259
+ - Besides `PATH`, `%APPDATA%\npm`, `%LOCALAPPDATA%\pnpm`, `%LOCALAPPDATA%\Volta\bin` and `%ProgramFiles%\nodejs` are probed.
344
260
 
345
- ### Troubleshooting
261
+ ## Troubleshooting
346
262
 
347
263
  | Symptom | Cause | Fix |
348
264
  |---|---|---|
349
265
  | Not in `claude mcp list` | The install method skipped `postinstall` | `codex-supervisor-setup`, or `claude mcp add` by hand |
350
266
  | 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` |
351
- | Worker is `failed` at once with `spawn codex ENOENT` | No `codex` on the process's `PATH` | Set `CODEX_BIN` in the config |
267
+ | Worker `failed` at once with `spawn codex ENOENT` | No codex on the process `PATH` | Set `CODEX_BIN` in the config |
352
268
  | `Cannot find module 'node:sqlite'` | Node older than 22.13.0 | Upgrade Node |
353
- | Worker stuck in `lost` | The MCP process was killed and the worker orphaned | `resume_codex_worker`, or dispatch again |
269
+ | Worker `lost` | The MCP process was killed and took the worker with it | `resume_codex_worker` |
270
+ | Worker reports `git add` failing with `index.lock: Operation not permitted` | The default sandbox keeps `.git` read-only | `land_codex_worker` with `commitMessage`, or dispatch with `danger-full-access` |
354
271
  | `ownedPaths overlap with active worker(s)` | Two workers claimed the same paths | Split differently, or cancel the one holding them |
355
- | The board is empty | The board and the MCP use different `SUPERVISOR_HOME`s | Start it inside a project with a `.mcp.json`, or pass the same `SUPERVISOR_HOME`; the second startup line names the store in use |
356
- | `port 7877 ... is already in use` | A board is already running | Open `http://127.0.0.1:7877`, or start a second one with `SUPERVISOR_WEB_PORT=8080` |
272
+ | The board is empty | The board and the MCP use different `SUPERVISOR_HOME`s | Start it inside the project with the `.mcp.json`, or pass the same `SUPERVISOR_HOME` |
273
+ | `port 7877 ... is already in use` | A board is already running | Open it, or start another with `SUPERVISOR_WEB_PORT=8080` |
357
274
 
358
275
  ## Known limitations
359
276
 
360
- - 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.
361
- - 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.
362
- - 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.
363
- - `ownedPaths` is checked at dispatch only; it does not stop a worker from creating a file it never listed. Review the diff.
364
- - It reports "finished", not "correct". `exit_code: 0` means it did not crash; acceptance is the main thread's job.
365
- - 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.
366
- - 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.
367
- - `search_works` is substring matching. Fine at hundreds of rows; revisit at tens of thousands.
277
+ - A worker is a child of the MCP process. Kill the MCP and the worker goes with it, settled as `lost`; its worktree and `thread_id` survive and `resume_codex_worker` picks it up. Keeping it alive across that takes a resident daemon; see the Roadmap.
278
+ - In the default `workspace-write` sandbox a worker cannot commit (Codex keeps `.git` read-only). Either `land_codex_worker` with `commitMessage` commits for it, or dispatch with `danger-full-access`.
279
+ - The worktree is cut from a commit; uncommitted work in your checkout is not in it.
280
+ - Only the working directory is isolated. Temp directories, databases and ports are shared.
281
+ - `ownedPaths` is checked at dispatch only; it does not stop a worker from creating files outside its list. Read the diff.
282
+ - It knows "finished", not "correct". Acceptance is the main thread's job.
283
+ - One `wait_codex_workers` cannot wait to the end; the client's MCP tool timeout is a hard wall. Call it again.
284
+ - `search_works` is substring matching, fine for hundreds of works.
368
285
 
369
286
  ## Roadmap
370
287
 
371
- 1. ~~`CODEX_BIN` / `SUPERVISOR_HOME` / `GIT_BIN`~~ ✅
372
- 2. ~~`status` and `phase` split, `lost` added~~ ✅
373
- 3. ~~`ownedPaths` / `goal` / `dependsOn`, event gates~~ ✅
374
- 4. ~~`thread_id` on disk + `resume_codex_worker`~~ ✅
375
- 5. ~~Concurrency: crash points, ownership conflicts, multi-process writes~~ ✅
376
- 6. ~~`session_id` + `get_session_works`~~ ✅
377
- 7. ~~`search_works`~~ ✅
378
- 8. ~~Native worker goals~~ ✅
379
- 9. ~~Windows~~ ✅
380
- 10. ~~Web board~~ ✅
381
- 11. ~~Session titles, update check, `baseRef`, committed changes visible~~ ✅
382
- 12. ~~Collecting work: `get_worker_diff` / `ask_codex_worker` / `land_codex_worker`; background auto-update~~ ✅
383
- 13. Resident daemon: move dispatch and process lifetime out of the MCP process
384
-
385
- 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).
288
+ Done: `CODEX_BIN` / `SUPERVISOR_HOME` / `GIT_BIN`; `status` and `phase` split; `ownedPaths` / `goal` / `dependsOn`; `thread_id` on disk + `resume_codex_worker`; concurrency and multi-process writes; `session_id`, `search_works`, native goals; Windows; the web board; `baseRef`; collecting work with `get_worker_diff` / `ask_codex_worker` / `land_codex_worker`; background auto-update.
289
+
290
+ Next: a resident daemon, moving dispatch and process lifetime out of the MCP process.
291
+
292
+ 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).
386
293
 
387
294
  ## Development
388
295
 
389
296
  ```bash
390
297
  npm install
391
- npm test # truncation, state machine, migration, setup, Windows routing, 23 regression cases, 40 edge cases
392
- npm run test:edge # test/edge only: update check against a fake registry, session titles, baseRef, non-ASCII paths, ghost rows, board API
393
- npm run test:real # end to end with the real codex CLI
394
- npm run smoke:mcp # MCP protocol smoke test
395
- npm run monitor # Ink terminal board
396
- npm run web:install # board dependencies
397
- npm run web:dev # board with hot reload, /api proxied to 7877
398
- npm run web:build # bundle into web/dist; runs before publish
298
+ npm test # fake-codex replay, fast and deterministic
299
+ npm run test:edge # test/edge only
300
+ npm run test:real # end to end against the real codex CLI
301
+ npm run web:dev # board development, /api proxied to 7877
302
+ npm run web:build # bundle to web/dist, runs before npm publish
399
303
  ```
400
304
 
401
- `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.
305
+ CI runs Ubuntu / macOS / Windows, plus a Node 22.13.0 job that pins the `engines` floor.
402
306
 
403
307
  ## License
404
308