codex-supervisor-mcp 0.7.1 → 0.7.3
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 +106 -203
- package/README.md +80 -177
- package/package.json +3 -2
- package/skills/codex-supervisor/SKILL.md +53 -131
- package/src/landing.js +33 -1
package/README.md
CHANGED
|
@@ -8,15 +8,17 @@
|
|
|
8
8
|
[](https://github.com/zriyox/codex-supervisor-mcp/actions/workflows/ci.yml)
|
|
9
9
|
[](package.json)
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
官网 [codex-supervisor.zriyo.com](https://codex-supervisor.zriyo.com) · 给模型读的 [llms.txt](https://codex-supervisor.zriyo.com/llms.txt)
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
让几个 agent 同时改一个仓库,结果是互相覆盖、没人说得清谁改了什么,主线程的上下文还被 worker 的输出塞满。
|
|
14
|
+
|
|
15
|
+
**codex-supervisor-mcp** 是一个 Codex MCP server,把「派单」和「记账」从模型上下文里拿出来放到磁盘上:一个主线程(Claude Code、Codex 或任何 MCP 客户端)同时指挥多个 Codex CLI worker,一个 worker 一个 Git worktree,状态落盘到 SQLite,附一个网页看板。
|
|
14
16
|
|
|
15
|
-
|
|
17
|
+

|
|
16
18
|
|
|
17
|
-
|
|
19
|
+
*30 秒真跑:`create_codex_worker` ×3,三个 worker 各自 worktree 并行,主线程收 3 份 diff 合成一次 commit。*
|
|
18
20
|
|
|
19
|
-
|
|
21
|
+
## 解决什么
|
|
20
22
|
|
|
21
23
|
| 问题 | 做法 |
|
|
22
24
|
|---|---|
|
|
@@ -28,7 +30,7 @@
|
|
|
28
30
|
| 分不清「跑失败」和「进程没了」 | 状态机把 `failed` 和 `lost` 分开 |
|
|
29
31
|
| 看不见一批活现在到哪了 | `codex-supervisor-web` 开一个看板,按 session 看每路 worker 在干什么 |
|
|
30
32
|
|
|
31
|
-
worker 跑的是 `codex exec`,`model`
|
|
33
|
+
worker 跑的是 `codex exec`,`model` 透传:主线程留在 Claude,worker 可以挂 DeepSeek 或任何 Codex 配了 provider 的模型,账单分开算。
|
|
32
34
|
|
|
33
35
|
## 五分钟跑起来
|
|
34
36
|
|
|
@@ -40,21 +42,14 @@ worker 跑的是 `codex exec`,`model` 参数原样透传。主线程留在 Cla
|
|
|
40
42
|
npm install -g codex-supervisor-mcp
|
|
41
43
|
```
|
|
42
44
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
```bash
|
|
46
|
-
claude mcp list | grep codex-supervisor
|
|
47
|
-
codex mcp list | grep codex-supervisor
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
没看到就手动补(`npx`、`--ignore-scripts`、pnpm 这些装法不跑 `postinstall`):
|
|
45
|
+
`postinstall` 装 skill、注册 MCP。`claude mcp list` 里没看到(`npx`、pnpm、`--ignore-scripts` 不跑 `postinstall`)就手动补:
|
|
51
46
|
|
|
52
47
|
```bash
|
|
53
48
|
claude mcp add -s user codex-supervisor -- npx -y codex-supervisor-mcp
|
|
54
49
|
codex mcp add codex-supervisor -- npx -y codex-supervisor-mcp
|
|
55
50
|
```
|
|
56
51
|
|
|
57
|
-
重启 Claude Code / Codex
|
|
52
|
+
重启 Claude Code / Codex。以后不用再手动更,见「更新」。只要 skill 不要 MCP:`npx skills add zriyox/codex-supervisor-mcp`。
|
|
58
53
|
|
|
59
54
|
### 2. 派第一批活
|
|
60
55
|
|
|
@@ -62,7 +57,7 @@ codex mcp add codex-supervisor -- npx -y codex-supervisor-mcp
|
|
|
62
57
|
|
|
63
58
|
> 把这三个模块的单测补齐,用 codex-supervisor 分三路并行跑,session 叫「补单测」。
|
|
64
59
|
|
|
65
|
-
|
|
60
|
+
主线程背后做的事(你也可以自己调工具):
|
|
66
61
|
|
|
67
62
|
```
|
|
68
63
|
create_codex_worker ×3 每路带 session_id、session_title、ownedPaths、goal
|
|
@@ -80,17 +75,11 @@ codex-supervisor-web
|
|
|
80
75
|
npx -p codex-supervisor-mcp codex-supervisor-web
|
|
81
76
|
```
|
|
82
77
|
|
|
83
|
-
打开 `http://127.0.0.1:7877
|
|
84
|
-
|
|
85
|
-
它读哪个状态目录:环境里有 `SUPERVISOR_HOME` 就用它;没有就从当前目录往上找 `.mcp.json`,里面 `codex-supervisor` 配了 `SUPERVISOR_HOME` 就用那个;都没有才用默认的 `~/.codex-supervisor`。启动时会打印用的是哪个、从哪来的。在项目目录里敲一下就对上了,不用再传路径。
|
|
86
|
-
|
|
87
|
-
端口用 `SUPERVISOR_WEB_PORT` 改。端口被占(多半是已经有一个看板在跑)会直接说明并退出。看板不派单也不取消;「旁问」会起一个只读的 Codex 旁路会话,见下面。
|
|
78
|
+
打开 `http://127.0.0.1:7877`。状态目录按 `SUPERVISOR_HOME`、最近的 `.mcp.json`、`~/.codex-supervisor` 的顺序找;端口用 `SUPERVISOR_WEB_PORT` 改。看板只看,不派单不取消。
|
|
88
79
|
|
|
89
80
|
## 我自己怎么用
|
|
90
81
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
我开两个 Claude Code 会话。一个只管文档,一个只管派活。一个会话又写详设又盯 worker,上下文两小时就满,写代码的判断和派活的判断也混在一起。
|
|
82
|
+
能连 MCP 的都能当主线程,这里只是我的用法。我开两个 Claude Code 会话,一个只管文档,一个只管派活:一个会话又写详设又盯 worker,上下文两小时就满。
|
|
94
83
|
|
|
95
84
|
| 谁 | 开在哪 | 管什么 |
|
|
96
85
|
|---|---|---|
|
|
@@ -99,7 +88,7 @@ npx -p codex-supervisor-mcp codex-supervisor-web
|
|
|
99
88
|
| 主脑会话 | 代码仓的一个 worktree | 读任务书,派 Codex worker,核每路的 diff,把结果填回任务书,向我汇报。不写业务代码 |
|
|
100
89
|
| Codex worker | 各自的 worktree | 一个 worker 做一步,一个提交,在远端机器上编译和验证。不 push,不合并 |
|
|
101
90
|
|
|
102
|
-
|
|
91
|
+
两个会话之间只传一段文字,粘进主脑会话用 `/goal` 接上。结构固定:
|
|
103
92
|
|
|
104
93
|
```text
|
|
105
94
|
【角色】 你是主脑:读文档和代码,派 worker,核结果,更新文档,向我汇报。不写业务代码。
|
|
@@ -119,7 +108,7 @@ npx -p codex-supervisor-mcp codex-supervisor-web
|
|
|
119
108
|
【汇报】 中文,表格优先,报哪几项,然后停下来等我
|
|
120
109
|
```
|
|
121
110
|
|
|
122
|
-
|
|
111
|
+
主脑一轮下来调的工具:
|
|
123
112
|
|
|
124
113
|
```
|
|
125
114
|
search_works 查这批活派过没有
|
|
@@ -132,21 +121,19 @@ resume_codex_worker 要改就追一条,让它 amend 进原来那个提交
|
|
|
132
121
|
land_codex_worker 核过了,落进集成分支
|
|
133
122
|
```
|
|
134
123
|
|
|
135
|
-
上一块活 25
|
|
136
|
-
|
|
137
|
-
「一个 worker 一步、一步一个提交、核过才进下一步」这条是试出来的。worker 交回来,主脑看 diff 发现某一步不对,就 `resume_codex_worker` 追一条:问题在哪,改完 `git commit --amend` 并进原来那个提交。worker 还是同一个 Codex 会话,上下文都在,改完主脑再核一次,过了才落。一个 worker 做三步就没法这么修:第 5 步错了,第 6、7 步的提交已经叠在上面。
|
|
124
|
+
上一块活 25 步,主脑会话从头跑到尾,上下文里只有任务书和每路的汇报。一个 worker 只做一步是试出来的:某一步不对,`resume_codex_worker` 追一条让它 `--amend` 进原来那个提交,再核一次才落;一个 worker 做三步,第 5 步错了,第 6、7 步已经叠在上面,没法这么修。
|
|
138
125
|
|
|
139
126
|
## 看板里有什么
|
|
140
127
|
|
|
141
128
|
| 位置 | 内容 |
|
|
142
129
|
|---|---|
|
|
143
|
-
| 左栏 | 每个 session
|
|
144
|
-
| session 页 |
|
|
145
|
-
| worker 台账 |
|
|
146
|
-
| worker 抽屉 |
|
|
147
|
-
| 旁问 | 对这路 worker 提问,就是 Codex
|
|
130
|
+
| 左栏 | 每个 session 一行:标题、worker 数、几路在跑、最近活动。左下角是版本和更新提示 |
|
|
131
|
+
| session 页 | 统计(总数 / 运行中 / 完成 / 失败 / 丢失),有 worker 在跑时列每路正在执行的命令 |
|
|
132
|
+
| worker 台账 | 一行一路:状态、标题、正在跑的命令或最后一句汇报、耗时、改了几个文件、跑了几条命令 |
|
|
133
|
+
| worker 抽屉 | 七个 tab:概览、汇报、改动、命令、事件、任务书、旁问 |
|
|
134
|
+
| 旁问 | 对这路 worker 提问,就是 Codex 的 `/btw`:从它的线程 fork 出只读旁路会话来答,不碰它正在跑的活。多轮、可中断、换标签页回来自动接上 |
|
|
148
135
|
|
|
149
|
-
|
|
136
|
+
浅色深色跟系统走,没有外网资源。
|
|
150
137
|
|
|
151
138
|
## 工具
|
|
152
139
|
|
|
@@ -154,48 +141,31 @@ land_codex_worker 核过了,落进集成分支
|
|
|
154
141
|
|
|
155
142
|
| 工具 | 入参 | 作用 |
|
|
156
143
|
|---|---|---|
|
|
157
|
-
| `create_codex_worker` | `task`, `cwd`, **`ownedPaths`**, **`goal`**, `session_id`, `session_title`, `session_note`, `dependsOn`, `baseRef`, `sandbox`, `model`, `reasoningEffort`, `title`, `skipGitRepoCheck` | 起一个 worker。`
|
|
144
|
+
| `create_codex_worker` | `task`, `cwd`, **`ownedPaths`**, **`goal`**, `session_id`, `session_title`, `session_note`, `dependsOn`, `baseRef`, `sandbox`, `model`, `reasoningEffort`, `title`, `skipGitRepoCheck` | 起一个 worker。`baseRef` 指定 worktree 从哪个提交切,默认 `HEAD`,接着另一路干就填它的 `codex/<id>` |
|
|
158
145
|
| `create_codex_followup_worker` | `task_id`, `followup_prompt`, `session_id`, 其余同上 | 开一个新会话,把老 worker 的 prompt、状态、近期事件拼进去 |
|
|
159
146
|
| `resume_codex_worker` | `task_id`, `prompt` | 接同一个 Codex 会话继续跑,`thread_id` 不变 |
|
|
160
|
-
| `wait_codex_workers` | `task_ids`, `mode`(any/all), `timeoutMinutes`, `timeoutMs`, `compact`, `includeEvents`, `eventLimit`, `eventMaxChars`, `eventKinds` | 等终态。默认 2 分钟,到点带快照返回,worker 照跑;`
|
|
147
|
+
| `wait_codex_workers` | `task_ids`, `mode`(any/all), `timeoutMinutes`, `timeoutMs`, `compact`, `includeEvents`, `eventLimit`, `eventMaxChars`, `eventKinds` | 等终态。默认 2 分钟,到点带快照返回,worker 照跑;`compact` 每路只回一行 |
|
|
161
148
|
| `get_orchestration_overview` | `status`, `limit` | 全部 worker 的状态表,封顶 7000 字节。带 `version` 和 `update` |
|
|
162
|
-
| `get_worker_result` | `task_id`, `limit`, `maxChars` | worker 自己的完整汇报,外加 `status` / `exit_code` / `changed_files
|
|
163
|
-
| `get_worker_diff` | `task_id`, `maxChars`, `paths` | worker 实际改了什么:从 worktree 起点到工作区的 patch
|
|
149
|
+
| `get_worker_result` | `task_id`, `limit`, `maxChars` | worker 自己的完整汇报,外加 `status` / `exit_code` / `changed_files` |
|
|
150
|
+
| `get_worker_diff` | `task_id`, `maxChars`, `paths` | worker 实际改了什么:从 worktree 起点到工作区的 patch,提交没提交都算。`maxChars` 管总量,超了的文件只列名 |
|
|
164
151
|
| `ask_codex_worker` | `task_id`, `question`, `timeoutMs`, `maxChars`, `fresh`, `end` | 旁路问 worker 一句。线程 fork 成只读侧会话,没网络、没 MCP 工具,worker 本身不动。worker 被 resume 过会自动换新 fork,`fresh` 强制换,`end` 删 |
|
|
165
|
-
| `land_codex_worker` | `task_id`, `onto`, `commitMessage` | 把 worker 在 `codex/<id>` 上的提交 cherry-pick
|
|
152
|
+
| `land_codex_worker` | `task_id`, `onto`, `commitMessage` | 把 worker 在 `codex/<id>` 上的提交 cherry-pick 到派单目录的当前分支。目标必须干净,冲突就回滚。`commitMessage` 先替它把未提交的改动提交成一笔 |
|
|
166
153
|
| `get_worker_summary` | `task_id` | 一段话:goal、状态、改动、最后一条命令和消息 |
|
|
167
|
-
| `get_codex_worker_status` | `task_id`, `includePrompt`, `promptMaxChars` | 单个 worker
|
|
154
|
+
| `get_codex_worker_status` | `task_id`, `includePrompt`, `promptMaxChars` | 单个 worker 的状态细节 |
|
|
168
155
|
| `get_codex_worker_events` | `task_id`, `limit`, `maxChars`, `kinds` | 原始事件流 |
|
|
169
156
|
| `get_worker_goal` | `task_id` | 派单时记的 goal + Codex 原生 goal(token、用时) |
|
|
170
157
|
| `list_codex_workers` | `status`, `includeHistory`, `includeDetails` | 列 worker,默认只看在跑的 |
|
|
171
|
-
| `get_session_works` | `session_id` | 一个 session 的全部 worker
|
|
172
|
-
| `describe_session` | `session_id`, `title`, `note` | 给 session
|
|
158
|
+
| `get_session_works` | `session_id` | 一个 session 的全部 worker。主线程重启后靠它找回那批活 |
|
|
159
|
+
| `describe_session` | `session_id`, `title`, `note` | 给 session 记标题和说明 |
|
|
173
160
|
| `search_works` | `query`, `limit` | 在 title / goal / prompt / last_message 里找子串,从新到旧 |
|
|
174
|
-
| `check_for_update` | `force` | 问 registry
|
|
175
|
-
| `cancel_codex_worker` | `task_id` | 终止 worker
|
|
176
|
-
|
|
177
|
-
### 三个必填项
|
|
161
|
+
| `check_for_update` | `force` | 问 registry 有没有新版本 |
|
|
162
|
+
| `cancel_codex_worker` | `task_id` | 终止 worker。跨进程按 pid 兜底,先确认那个 pid 跑的是 codex |
|
|
178
163
|
|
|
179
|
-
|
|
180
|
-
- `goal.objective`:一句话说这路活的目标。worker 起手会用它建 Codex 原生 goal,干完标 complete。
|
|
181
|
-
- `session_id`:严格说不是必填,但不传就归不了组,看板和 `get_session_works` 都找不回来。一批活传同一个值,第一路顺手带上 `session_title`。
|
|
182
|
-
|
|
183
|
-
### 读结果别撑爆上下文
|
|
184
|
-
|
|
185
|
-
| 想干什么 | 用哪个 | 代价 |
|
|
186
|
-
|---|---|---|
|
|
187
|
-
| 看全部 worker 状态 | `get_orchestration_overview` | 7000 字节封顶 |
|
|
188
|
-
| 收一路的结论 | `get_worker_result` | 汇报全文,大活上万字 |
|
|
189
|
-
| 只看活着还是完了 | `get_worker_summary` | 一段话 |
|
|
190
|
-
| 看过程 | `get_codex_worker_events` | 用 `kinds` 先滤、`limit` 限条数、`maxChars` 截长串 |
|
|
191
|
-
| 看它实际改了什么 | `get_worker_diff` | `maxChars` 封顶,文件清单永远全 |
|
|
192
|
-
| 问它为什么 | `ask_codex_worker` | 一段回答,fork 带着它的全部上下文 |
|
|
193
|
-
|
|
194
|
-
派单回执是精简的,不回传任务原文。`wait_codex_workers` 的 `last_message` 截到 400 字,`current_action` 截到 300 字,要全文走 `get_worker_result` 和 `get_codex_worker_events`。这些裁剪是为了一次 wait 五路从几十 KB 降到几 KB;客户端把超时的调用挪到后台再把结果当通知回灌时,这个差别很大。
|
|
164
|
+
必填的两个:`ownedPaths`(派单前和在跑的 worker 求交集,重叠就拒,只在派单时查)和 `goal.objective`(worker 会建成 Codex 原生 goal)。`session_id` 不传就归不了组,一批活传同一个值。
|
|
195
165
|
|
|
196
166
|
## 和 Claude Code 的 subagent 有什么区别
|
|
197
167
|
|
|
198
|
-
文件隔离不是差别:subagent 自己也能开 worktree
|
|
168
|
+
文件隔离不是差别:subagent 自己也能开 worktree。差别在模型和进程。
|
|
199
169
|
|
|
200
170
|
| | Claude Code subagent | codex-supervisor worker |
|
|
201
171
|
|---|---|---|
|
|
@@ -208,24 +178,16 @@ land_codex_worker 核过了,落进集成分支
|
|
|
208
178
|
|
|
209
179
|
## 状态机
|
|
210
180
|
|
|
211
|
-
`status`
|
|
212
|
-
|
|
213
|
-
| 值 | 含义 |
|
|
181
|
+
| `status` | 含义 |
|
|
214
182
|
|---|---|
|
|
215
183
|
| `queued` | 已派单,未启动 |
|
|
216
|
-
| `running` |
|
|
184
|
+
| `running` | 运行中。`phase`:`starting → thinking → command → editing → reporting` |
|
|
217
185
|
| `completed` | 成功 |
|
|
218
186
|
| `failed` | 非零退出码、`turn.failed`、spawn 失败 |
|
|
219
187
|
| `cancelled` | 被 `cancel_codex_worker` 中断 |
|
|
220
|
-
| `lost` | 被外部信号杀掉、MCP
|
|
221
|
-
|
|
222
|
-
`phase` 只在 `running` 时有值:`starting → thinking → command → editing → reporting`。
|
|
188
|
+
| `lost` | 被外部信号杀掉、MCP 进程消失、或者行写了但进程从没起来。`resume_codex_worker` 接回 |
|
|
223
189
|
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
Windows 没有信号,外部 kill 和进程自己 `exit(1)` 在父进程看来一样,所以那里只报 `failed` 加退出码。
|
|
227
|
-
|
|
228
|
-
Codex 原生 goal 的六个状态映射:`active` / `paused` / `blocked` 都算 `running`(后两个进 `needs_attention`),`usageLimited` / `budgetLimited` 算 `failed`,`complete` 算 `completed`。
|
|
190
|
+
终态分两步落盘:`turn.completed` 先把 status 置成 completed,进程退出后才写 `exit_code`;`wait_codex_workers` 等到 `exit_code` 落了才返回。Windows 没有信号,外部 kill 只报 `failed` 加退出码。Codex 原生 goal 的 `paused` / `blocked` 算 `running` 并进 `needs_attention`,`usageLimited` / `budgetLimited` 算 `failed`。
|
|
229
191
|
|
|
230
192
|
## 状态存储
|
|
231
193
|
|
|
@@ -233,42 +195,31 @@ Codex 原生 goal 的六个状态映射:`active` / `paused` / `blocked` 都算
|
|
|
233
195
|
|
|
234
196
|
| 文件 | 内容 |
|
|
235
197
|
|---|---|
|
|
236
|
-
| `data/supervisor.sqlite` | `tasks`(一行一个 work)、`task_events
|
|
198
|
+
| `data/supervisor.sqlite` | `tasks`(一行一个 work)、`task_events`、`sessions`、`side_sessions` / `side_turns`(旁问) |
|
|
237
199
|
| `data/runs/<taskId>.jsonl` | Codex `--json` 的原始输出 |
|
|
238
|
-
| `data/update-check.json` |
|
|
200
|
+
| `data/update-check.json`、`auto-update.json` | 更新检查和后台更新的记录 |
|
|
239
201
|
| `worktrees/<taskId>/` | 该 worker 的 Git worktree |
|
|
240
202
|
|
|
241
|
-
`changed_files`
|
|
242
|
-
|
|
243
|
-
老版本(0.1.x)的库第一次打开时自动迁移,一行不丢。
|
|
244
|
-
|
|
245
|
-
## 更新检查
|
|
246
|
-
|
|
247
|
-
MCP 启动时问一次 npm registry:`latest` 是哪个版本,tarball integrity 是多少。和本机比两样:
|
|
248
|
-
|
|
249
|
-
- 版本号。比 `latest` 低,`get_orchestration_overview`、派单回执、`wait_codex_workers` 的返回里多一个 `update` 字段,带 `latest_version` 和 `npm i -g codex-supervisor-mcp@latest`。skill 让主线程看到就转告你。
|
|
250
|
-
- 文件。全局安装时 npm 把解出来的 integrity 记在 `node_modules/.package-lock.json`,和 registry 上这个版本的不一样就说明本机文件不是发布的那份,同样提示重装。git checkout 没这个值,只记 commit。
|
|
251
|
-
|
|
252
|
-
缓存一小时,跑着的时候每六小时再查。registry 连不上不报错,结果标 `source: "offline"`。看板左下角显示同一个结果。`CODEX_SUPERVISOR_NO_UPDATE_CHECK=1` 关掉,`CODEX_SUPERVISOR_REGISTRY` 指到私有源。
|
|
203
|
+
`changed_files` 按 worktree 的真实 diff 算,worker 用 shell 改的、自己 commit 过的都能看到。中文文件名原样返回。老版本的库第一次打开自动迁移。
|
|
253
204
|
|
|
254
205
|
## 环境变量
|
|
255
206
|
|
|
256
207
|
| 变量 | 默认 | 作用 |
|
|
257
208
|
|---|---|---|
|
|
258
209
|
| `SUPERVISOR_HOME` | `~/.codex-supervisor` | 状态根目录。MCP 和看板要指同一个 |
|
|
259
|
-
| `CODEX_HOME` | `~/.codex` | 只读,读 Codex 原生的 `goals_1.sqlite` |
|
|
260
|
-
| `CODEX_BIN` | `codex` | Codex CLI 路径。Windows 上 `.cmd` shim
|
|
210
|
+
| `CODEX_HOME` | `~/.codex` | 只读,读 Codex 原生的 `goals_1.sqlite` 和 MCP 配置 |
|
|
211
|
+
| `CODEX_BIN` | `codex` | Codex CLI 路径。Windows 上 `.cmd` shim 自动绕开 |
|
|
261
212
|
| `GIT_BIN` | `git` | Git 路径 |
|
|
262
213
|
| `SUPERVISOR_WEB_PORT` / `SUPERVISOR_WEB_HOST` | `7877` / `127.0.0.1` | 看板监听地址 |
|
|
263
214
|
| `CODEX_SUPERVISOR_NO_UPDATE_CHECK` | 未设 | `1` 关闭更新检查 |
|
|
264
|
-
| `CODEX_SUPERVISOR_REGISTRY` | `https://registry.npmjs.org` |
|
|
215
|
+
| `CODEX_SUPERVISOR_REGISTRY` | `https://registry.npmjs.org` | 更新检查和自动更新用的 registry |
|
|
265
216
|
| `CODEX_SUPERVISOR_UPDATE_TIMEOUT_MS` | `4000` | 等 registry 的上限 |
|
|
266
|
-
| `CODEX_SUPERVISOR_SKIP_SETUP` | 未设 | `1` 跳过 `postinstall` 的自动安装 |
|
|
267
217
|
| `CODEX_SUPERVISOR_NO_AUTO_UPDATE` | 未设 | `1` 关闭后台自动更新(只提醒) |
|
|
268
218
|
| `CODEX_SUPERVISOR_SKIP_SKILL_SYNC` | 未设 | `1` 关闭 server 启动时的 skill 同步 |
|
|
269
|
-
| `
|
|
219
|
+
| `CODEX_SUPERVISOR_SKIP_SETUP` | 未设 | `1` 跳过 `postinstall` 的自动安装 |
|
|
220
|
+
| `CODEX_SUPERVISOR_NPM` | 未设 | 自动更新用的 npm,默认用当前 node 自带的 |
|
|
270
221
|
|
|
271
|
-
GUI
|
|
222
|
+
GUI 客户端(Claude Desktop、Cursor、Windsurf)不跑 `postinstall`,自己把这段加进它的 MCP 配置文件,`PATH` 里常常没有 `codex`,显式给 `CODEX_BIN`:
|
|
272
223
|
|
|
273
224
|
```json
|
|
274
225
|
{
|
|
@@ -282,67 +233,28 @@ GUI 客户端起的进程 `PATH` 里常常没有 `codex`,在配置里显式给
|
|
|
282
233
|
}
|
|
283
234
|
```
|
|
284
235
|
|
|
285
|
-
##
|
|
286
|
-
|
|
287
|
-
### GUI 客户端
|
|
288
|
-
|
|
289
|
-
GUI 不跑 `postinstall`,自己把上面那段 JSON 加进配置文件:
|
|
290
|
-
|
|
291
|
-
| 客户端 | 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
|
-
### 重跑安装
|
|
298
|
-
|
|
299
|
-
```bash
|
|
300
|
-
codex-supervisor-setup # 自动检测客户端,补 skill + 注册 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 # 只打印计划
|
|
305
|
-
```
|
|
306
|
-
|
|
307
|
-
skill 已存在且内容不同时先备份成 `SKILL.md.bak-<时间戳>` 再覆盖。
|
|
308
|
-
|
|
309
|
-
### 更新
|
|
236
|
+
## 更新
|
|
310
237
|
|
|
311
|
-
不用手动更。server
|
|
238
|
+
不用手动更。server 启动时后台查一次 registry,有新版就起独立进程 `npm i -g` 到同一个全局路径;正在跑的会话不受影响,下一个新会话就是新版。只对 `npm i -g` 装的那份生效,git 源码和 `npx` 起的不碰。skill 也一样,每次启动刷到已有的 skill 目录,改过的先备份成 `SKILL.md.bak-<时间戳>`。
|
|
312
239
|
|
|
313
|
-
|
|
240
|
+
装失败(全局目录要 sudo)时 `update` 字段带原因,手动 `npm install -g codex-supervisor-mcp@latest`。0.6.1 及以前只提醒不自动装,手动升一次就进自动了。换了 Node 版本注册的路径会失效,`claude mcp remove -s user codex-supervisor`、`codex mcp remove codex-supervisor` 后重装。重跑安装:`codex-supervisor-setup`(`--skill-only` / `--mcp-only` / `--dry-run`)。
|
|
314
241
|
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
```bash
|
|
318
|
-
npm install -g codex-supervisor-mcp@latest
|
|
319
|
-
```
|
|
320
|
-
|
|
321
|
-
0.6.1 及以前的版本只提醒、不自己装。从那些版本上来,手动升一次,之后就自动了。注册不用重做。
|
|
322
|
-
|
|
323
|
-
手动更的坑:
|
|
324
|
-
|
|
325
|
-
- 刚发布的版本 registry 要几分钟才切 `latest`,装完版本没变就等一会,或者写死版本号。
|
|
326
|
-
- 换了 Node 版本,注册的绝对路径就失效了。先 `claude mcp remove -s user codex-supervisor` 和 `codex mcp remove codex-supervisor`,再装。
|
|
327
|
-
- skill 不用单独管:server 每次启动会把自带的 skill 刷到 `~/.claude/skills/`、`~/.agents/skills/`、`~/.codex/skills/` 里已经存在的那几个目录,内容不同先备份成 `SKILL.md.bak-<时间戳>`。已经加载了 skill 的会话要重新加载才看到新文本。`CODEX_SUPERVISOR_SKIP_SKILL_SYNC=1` 关掉。
|
|
328
|
-
|
|
329
|
-
### 卸载
|
|
242
|
+
卸载:
|
|
330
243
|
|
|
331
244
|
```bash
|
|
332
245
|
npm uninstall -g codex-supervisor-mcp
|
|
333
246
|
claude mcp remove -s user codex-supervisor
|
|
334
247
|
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
|
|
248
|
+
rm -rf ~/.claude/skills/codex-supervisor ~/.agents/skills/codex-supervisor ~/.codex/skills/codex-supervisor ~/.codex-supervisor
|
|
337
249
|
```
|
|
338
250
|
|
|
339
|
-
|
|
251
|
+
## Windows
|
|
340
252
|
|
|
341
|
-
- npm 装的 CLI 是 `codex.cmd`,Node
|
|
342
|
-
- 跨进程取消用 `taskkill /PID <pid> /T /F`
|
|
253
|
+
- npm 装的 CLI 是 `codex.cmd`,Node 拒绝直接 spawn 它。这里绕到 `node_modules/@openai/codex/bin/codex.js` 用 `node` 起,不用 `shell: true`,那样取消时只杀得掉 shell。
|
|
254
|
+
- 跨进程取消用 `taskkill /PID <pid> /T /F` 杀整棵树,先确认那个 pid 跑的是 codex。
|
|
343
255
|
- 除 `PATH` 外还探 `%APPDATA%\npm`、`%LOCALAPPDATA%\pnpm`、`%LOCALAPPDATA%\Volta\bin`、`%ProgramFiles%\nodejs`。
|
|
344
256
|
|
|
345
|
-
|
|
257
|
+
## 排查
|
|
346
258
|
|
|
347
259
|
| 症状 | 原因 | 处理 |
|
|
348
260
|
|---|---|---|
|
|
@@ -350,56 +262,47 @@ rm -rf ~/.codex-supervisor
|
|
|
350
262
|
| 派单报 `codex only resolved to a shell shim` | Windows 只找到 `.cmd`,背后的包入口没了 | 重装 `@openai/codex`,或 `CODEX_BIN` 指到 `codex.js` |
|
|
351
263
|
| worker 一起来就 `failed`,`spawn codex ENOENT` | 进程 `PATH` 里没有 codex | 配置里设 `CODEX_BIN` |
|
|
352
264
|
| `Cannot find module 'node:sqlite'` | Node 低于 22.13.0 | 升 Node |
|
|
353
|
-
| worker
|
|
265
|
+
| worker `lost` | MCP 进程被杀,worker 跟着没了 | `resume_codex_worker` 接回 |
|
|
266
|
+
| worker 说 `git add` 报 `index.lock: Operation not permitted` | 默认沙箱把 `.git` 设成只读 | 收活时 `land_codex_worker` 带 `commitMessage`,或派单用 `danger-full-access` |
|
|
354
267
|
| `ownedPaths overlap with active worker(s)` | 两路认领了同一片路径 | 改拆法,或先取消占着的那路 |
|
|
355
|
-
| 看板打开是空的 | 看板和 MCP 的 `SUPERVISOR_HOME` 不是同一个 | 在配了 `.mcp.json`
|
|
356
|
-
| `port 7877 ... is already in use` | 已经有一个看板在跑 |
|
|
268
|
+
| 看板打开是空的 | 看板和 MCP 的 `SUPERVISOR_HOME` 不是同一个 | 在配了 `.mcp.json` 的项目目录里起,或显式传同一个 `SUPERVISOR_HOME` |
|
|
269
|
+
| `port 7877 ... is already in use` | 已经有一个看板在跑 | 直接开它,或 `SUPERVISOR_WEB_PORT=8080` 再起一个 |
|
|
357
270
|
|
|
358
271
|
## 已知限制
|
|
359
272
|
|
|
360
|
-
- worker 是 MCP 进程的子进程。MCP 被 kill,worker
|
|
361
|
-
-
|
|
362
|
-
- worktree 从一个提交切,你工作区里没 commit
|
|
363
|
-
-
|
|
364
|
-
- `ownedPaths` 只在派单时查,拦不住 worker
|
|
365
|
-
-
|
|
366
|
-
- 一次 `wait_codex_workers`
|
|
367
|
-
-
|
|
368
|
-
- `search_works` 是子串匹配,几百条够用,几万条再说。
|
|
273
|
+
- worker 是 MCP 进程的子进程。MCP 被 kill,worker 跟着没了,结算成 `lost`;worktree 和 `thread_id` 都在,`resume_codex_worker` 接回。让它不跟着死要常驻 daemon,在 Roadmap 里。
|
|
274
|
+
- 默认 `workspace-write` 沙箱里 worker 提交不了(Codex 把 `.git` 设成只读)。要么收活时 `land_codex_worker` 带 `commitMessage` 替它提交,要么派单用 `danger-full-access`。
|
|
275
|
+
- worktree 从一个提交切,你工作区里没 commit 的东西不在里面。
|
|
276
|
+
- 只隔离工作目录。临时目录、数据库、端口是共用的。
|
|
277
|
+
- `ownedPaths` 只在派单时查,拦不住 worker 新建清单外的文件。收活看 diff。
|
|
278
|
+
- 只管「跑完了」不管「对不对」,验收得主线程自己做。
|
|
279
|
+
- 一次 `wait_codex_workers` 等不到底,客户端的 MCP 工具超时是硬墙,靠反复调。
|
|
280
|
+
- `search_works` 是子串匹配,几百条够用。
|
|
369
281
|
|
|
370
282
|
## Roadmap
|
|
371
283
|
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
6. ~~`session_id` + `get_session_works`~~ ✅
|
|
378
|
-
7. ~~`search_works`~~ ✅
|
|
379
|
-
8. ~~worker 原生 goal~~ ✅
|
|
380
|
-
9. ~~Windows~~ ✅
|
|
381
|
-
10. ~~网页看板~~ ✅
|
|
382
|
-
11. ~~session 标题、更新检查、`baseRef`、已 commit 的改动可见~~ ✅
|
|
383
|
-
12. ~~收活三件套:`get_worker_diff` / `ask_codex_worker` / `land_codex_worker`;后台自动更新~~ ✅
|
|
384
|
-
13. 常驻 daemon:派单和进程生命周期从 MCP 进程里拿出来
|
|
385
|
-
|
|
386
|
-
不做的:向量检索(子串匹配在这个规模更快、零维护)、`usage_count` 排序(实测 80 个 work 里只有 2 个被回头引用过)、三层记忆索引(数据量撑不起)。
|
|
284
|
+
做完的:`CODEX_BIN` / `SUPERVISOR_HOME` / `GIT_BIN`;`status` 和 `phase` 拆开;`ownedPaths` / `goal` / `dependsOn`;`thread_id` 落库 + `resume_codex_worker`;并发和多进程写库;`session_id`、`search_works`、原生 goal;Windows;网页看板;`baseRef`;收活三件套 `get_worker_diff` / `ask_codex_worker` / `land_codex_worker`;后台自动更新。
|
|
285
|
+
|
|
286
|
+
下一个:常驻 daemon,派单和进程生命周期从 MCP 进程里拿出来。
|
|
287
|
+
|
|
288
|
+
不做的:向量检索(子串匹配在这个规模更快、零维护)、`usage_count` 排序(实测 80 个 work 里只有 2 个被回头引用过)。
|
|
387
289
|
|
|
388
290
|
## 开发
|
|
389
291
|
|
|
390
292
|
```bash
|
|
391
293
|
npm install
|
|
392
|
-
npm test #
|
|
393
|
-
npm run test:edge # 只跑 test/edge
|
|
294
|
+
npm test # fake-codex 回放,快且确定
|
|
295
|
+
npm run test:edge # 只跑 test/edge
|
|
394
296
|
npm run test:real # 真 codex CLI 端到端
|
|
395
|
-
npm run smoke:mcp # MCP 协议冒烟
|
|
396
|
-
npm run monitor # Ink 终端看板
|
|
397
|
-
npm run web:install # 看板依赖
|
|
398
297
|
npm run web:dev # 看板开发,/api 代理到 7877
|
|
399
298
|
npm run web:build # 打包到 web/dist,发 npm 前自动跑
|
|
400
299
|
```
|
|
401
300
|
|
|
402
|
-
|
|
301
|
+
CI 跑 Ubuntu / macOS / Windows,另加一个 Node 22.13.0 的 job 卡 `engines` 下界。
|
|
302
|
+
|
|
303
|
+
## 参与贡献
|
|
304
|
+
|
|
305
|
+
看 [CONTRIBUTING.md](CONTRIBUTING.md)。安全问题走 [私密通道](https://github.com/zriyox/codex-supervisor-mcp/security/advisories/new),见 [SECURITY.md](SECURITY.md)。
|
|
403
306
|
|
|
404
307
|
## License
|
|
405
308
|
|
package/package.json
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codex-supervisor-mcp",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.3",
|
|
4
|
+
"mcpName": "io.github.zriyox/codex-supervisor-mcp",
|
|
4
5
|
"type": "module",
|
|
5
6
|
"description": "MCP server that dispatches and supervises parallel Codex CLI workers, one isolated Git worktree each, with a persisted work state machine.",
|
|
7
|
+
"homepage": "https://codex-supervisor.zriyo.com",
|
|
6
8
|
"license": "MIT",
|
|
7
9
|
"repository": {
|
|
8
10
|
"type": "git",
|
|
9
11
|
"url": "git+https://github.com/zriyox/codex-supervisor-mcp.git"
|
|
10
12
|
},
|
|
11
|
-
"homepage": "https://github.com/zriyox/codex-supervisor-mcp#readme",
|
|
12
13
|
"bugs": {
|
|
13
14
|
"url": "https://github.com/zriyox/codex-supervisor-mcp/issues"
|
|
14
15
|
},
|