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