agent-supervisor-mcp 2.0.2 → 2.0.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.md +121 -120
- package/README.ru.md +209 -0
- package/README.zh-CN.md +208 -0
- package/package.json +1 -1
- package/src/app/acceptance.js +2 -2
- package/src/app/start-run.js +89 -2
- package/src/domain/worker-preflight.js +11 -0
- package/src/infra/bin-resolver.js +5 -0
- package/src/infra/process.js +7 -2
- package/src/interface/bin/setup.js +4 -1
- package/src/run-host/entry.js +35 -3
- package/src/run-host/track.js +4 -4
- package/src/runners/codex/adapter.js +16 -2
- package/README.en.md +0 -209
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# agent-supervisor-mcp
|
|
2
2
|
|
|
3
|
-
[
|
|
3
|
+
English | [Русский](README.ru.md) | [中文](README.zh-CN.md)
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/agent-supervisor-mcp)
|
|
6
6
|
[](https://www.npmjs.com/package/agent-supervisor-mcp)
|
|
@@ -9,155 +9,156 @@
|
|
|
9
9
|
[](package.json)
|
|
10
10
|
[](https://glama.ai/mcp/servers/zriyox/agent-supervisor-mcp)
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
Website [agent-supervisor.zriyo.com](https://agent-supervisor.zriyo.com) · for models [llms.txt](https://agent-supervisor.zriyo.com/llms.txt) · [reference](docs/reference.en.md)
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
Point several agents at one repository and they overwrite each other, nobody can say who changed what, and the main thread's context fills up with worker output.
|
|
15
15
|
|
|
16
|
-
agent-supervisor-mcp
|
|
16
|
+
agent-supervisor-mcp is an MCP server. A main thread (Claude Code, Codex, or any MCP client) uses it to run several Codex CLI workers at once: one Git worktree per worker, state in SQLite, and a web board to watch them. Dispatch and bookkeeping live on disk, not in the model's context.
|
|
17
17
|
|
|
18
|
-

|
|
19
19
|
|
|
20
|
-
*30
|
|
20
|
+
*30 seconds, recorded live: three workers in their own worktrees in parallel, then the main thread collects three diffs and makes one commit.*
|
|
21
21
|
|
|
22
|
-
>
|
|
22
|
+
> **This package used to be codex-supervisor-mcp.** It was renamed because a worker is no longer only Codex. A machine with the old package is brought over by its last release: this package is installed, the MCP registration and the skill become `agent-supervisor`, and the state directory stays where it is. The command line tools change prefix from `codex-supervisor-` to `agent-supervisor-`.
|
|
23
23
|
>
|
|
24
|
-
>
|
|
24
|
+
> **Upgrading from 0.x to 1.x**: 39 tools became 14, with new names and arguments and no aliases for the old ones. Finish the workers in flight first, then reopen the session after upgrading so the new skill loads. The tool table is in the [reference](docs/reference.en.md); what changed is in the [1.0.0 release](https://github.com/zriyox/agent-supervisor-mcp/releases/tag/v1.0.0).
|
|
25
25
|
|
|
26
|
-
##
|
|
26
|
+
## What it solves
|
|
27
27
|
|
|
28
|
-
|
|
|
28
|
+
| Problem | What it does |
|
|
29
29
|
|---|---|
|
|
30
|
-
|
|
|
31
|
-
|
|
|
32
|
-
|
|
|
33
|
-
|
|
|
34
|
-
| worker
|
|
35
|
-
|
|
|
36
|
-
|
|
|
30
|
+
| Workers step on each other's files | One worktree per worker; `owned_paths` is checked for conflicts before dispatch |
|
|
31
|
+
| Worker output floods the main thread | Events go to JSONL; the main thread reads a compressed overview (every worker in under 7000 bytes) |
|
|
32
|
+
| A restart or a new session loses the workers | One SQLite row per work, with its `thread_id`; `resume_worker` rejoins the same Codex session |
|
|
33
|
+
| A failed run looks the same as a dead process | The state machine keeps `failed` and `lost` apart, and a failure carries its source and code |
|
|
34
|
+
| A worker says it is done and is not | Dispatch with `acceptance` commands; the supervisor runs them itself after the worker exits and refuses to land on failure |
|
|
35
|
+
| Changes sit on a local branch | `land_worker` merges into the integration branch; `verify_push` proves the commit is on the remote |
|
|
36
|
+
| Worktrees pile up | Landed or unchanged ones are removed during polling. Unlanded work is kept for 7 days, and its uncommitted edits are committed to its branch before the worktree goes. Branches and evidence stay |
|
|
37
37
|
|
|
38
|
-
worker
|
|
38
|
+
A worker is a `codex exec` process by default and `model` is passed straight through. Keep the main thread on Claude, put the workers on DeepSeek or another provider, and the bills stay separate.
|
|
39
39
|
|
|
40
|
-
worker
|
|
40
|
+
A worker can also be Claude Code: pass `runner: "claude"` to `create_worker`. It has no OS sandbox, so it runs only in a git worktree or read-only, and it has no side chat (`ask_worker`); dispatch, acceptance, resume, landing and cleanup are the same. To add another CLI, see [docs/runner.md](docs/runner.md).
|
|
41
41
|
|
|
42
|
-
##
|
|
42
|
+
## Five minutes to a running batch
|
|
43
43
|
|
|
44
|
-
|
|
44
|
+
You need Node.js 22.13.0 or newer and the `codex` CLI on `PATH`. macOS, Linux and Windows all work.
|
|
45
45
|
|
|
46
46
|
```bash
|
|
47
47
|
npm install -g agent-supervisor-mcp
|
|
48
48
|
```
|
|
49
49
|
|
|
50
|
-
|
|
50
|
+
The install script puts the skill into every Claude Code and Codex it finds and registers the MCP server. Restart them afterwards. If nothing got registered (`--ignore-scripts`, for instance), run `agent-supervisor-setup`, or add it by hand:
|
|
51
51
|
|
|
52
52
|
```bash
|
|
53
53
|
claude mcp add -s user agent-supervisor -- npx -y agent-supervisor-mcp
|
|
54
54
|
codex mcp add agent-supervisor -- npx -y agent-supervisor-mcp
|
|
55
55
|
```
|
|
56
56
|
|
|
57
|
-
Claude Desktop
|
|
57
|
+
GUI clients such as Claude Desktop, Cursor and Windsurf need their MCP config edited by hand; the snippet is in the [reference](docs/reference.en.md#environment-variables). For the skill without the server: `npx skills add zriyox/agent-supervisor-mcp`.
|
|
58
58
|
|
|
59
|
-
|
|
59
|
+
Then say it in plain words in Claude Code:
|
|
60
60
|
|
|
61
|
-
>
|
|
61
|
+
> Fill in the unit tests for these three modules. Use agent-supervisor, three workers in parallel, call the session "unit tests".
|
|
62
62
|
|
|
63
|
-
skill
|
|
63
|
+
The skill walks the main thread through this:
|
|
64
64
|
|
|
65
65
|
```
|
|
66
|
-
preflight_worker
|
|
67
|
-
create_worker ×3
|
|
68
|
-
wait_workers
|
|
69
|
-
get_worker ×3
|
|
70
|
-
get_worker_diff ×3
|
|
71
|
-
land_worker ×3
|
|
66
|
+
preflight_worker run a probe in the same environment first
|
|
67
|
+
create_worker ×3 each with session, owned_paths, goal
|
|
68
|
+
wait_workers 60 seconds at most per call; call again until done
|
|
69
|
+
get_worker ×3 each worker's report, with the commands it ran and their exit codes
|
|
70
|
+
get_worker_diff ×3 what it actually changed
|
|
71
|
+
land_worker ×3 reviewed; commit on its behalf and land
|
|
72
72
|
```
|
|
73
73
|
|
|
74
|
-
|
|
74
|
+
Workers never commit. Their changes stay on `worker/<taskId>` until the main thread has read the diff.
|
|
75
75
|
|
|
76
|
-
|
|
76
|
+
To watch them work, open the board:
|
|
77
77
|
|
|
78
78
|
```bash
|
|
79
|
-
agent-supervisor-web #
|
|
79
|
+
agent-supervisor-web # or: npx -p agent-supervisor-mcp agent-supervisor-web
|
|
80
80
|
```
|
|
81
81
|
|
|
82
|
-
|
|
82
|
+
Open `http://127.0.0.1:7877`. It shows each session's workers: status, the command running right now, changes and events. You can also ask a worker a question on the side; the answer comes from a read-only fork of its thread, so the work in progress is not interrupted. The board is read-only. It does not dispatch or cancel.
|
|
83
83
|
|
|
84
|
-
##
|
|
84
|
+
## How I use it
|
|
85
85
|
|
|
86
|
-
|
|
86
|
+
Anything that speaks MCP can be the main thread; this is just my way. I run two Claude Code sessions, one for documents and one for dispatch. A single session that writes the design and also watches the workers fills its context in two hours.
|
|
87
87
|
|
|
88
|
-
|
|
|
88
|
+
| Who | Where | Does what |
|
|
89
89
|
|---|---|---|
|
|
90
|
-
|
|
|
91
|
-
|
|
|
92
|
-
|
|
|
93
|
-
| Codex
|
|
90
|
+
| Me | | Decide what to build, make the calls, read the reports |
|
|
91
|
+
| Planning session | The requirements and docs repository | Talk through the requirement, write the design, write one brief per block of work |
|
|
92
|
+
| Main-brain session | A worktree of the code repository | Read the brief, dispatch workers, check diffs, report to me. Writes no business code |
|
|
93
|
+
| Codex workers | Their own worktrees | One worker per independently verifiable feature package. No commit, no push |
|
|
94
94
|
|
|
95
|
-
|
|
95
|
+
One block of text passes between the two sessions, pasted into the main-brain session and handed over with `/goal`:
|
|
96
96
|
|
|
97
97
|
```text
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
98
|
+
[Role] You are the main brain: dispatch workers, check results, update docs, report to me.
|
|
99
|
+
You write no business code. Load the agent-supervisor skill first.
|
|
100
|
+
[Background] Why this block exists, what the previous one left behind
|
|
101
|
+
[Read first] Which sections of which documents, and which one wins when they disagree
|
|
102
|
+
[Do] Follow the table in section N of the brief. Nothing outside the table
|
|
103
|
+
[Dispatch] find_works first so nothing is dispatched twice; one session.id for the batch;
|
|
104
|
+
parallel only when write sets are disjoint; the verify command goes in acceptance too;
|
|
105
|
+
a worker's word is not enough, the diff you read is
|
|
106
|
+
[Red lines] What not to change, push or read
|
|
107
|
+
[Report] Tables first, then stop and wait for me
|
|
107
108
|
```
|
|
108
109
|
|
|
109
|
-
##
|
|
110
|
+
## Tools
|
|
110
111
|
|
|
111
|
-
|
|
112
|
+
Fourteen by default. Arguments and edge cases are in the [reference](docs/reference.en.md#tools).
|
|
112
113
|
|
|
113
|
-
|
|
|
114
|
+
| Stage | Tool | What it does |
|
|
114
115
|
|---|---|---|
|
|
115
|
-
|
|
|
116
|
-
|
|
|
117
|
-
| | `resume_worker` |
|
|
118
|
-
| | `cancel_worker` |
|
|
119
|
-
|
|
|
120
|
-
| | `wait_workers` |
|
|
121
|
-
|
|
|
122
|
-
| | `get_worker_diff` |
|
|
123
|
-
| | `ask_worker` |
|
|
124
|
-
|
|
|
125
|
-
| | `verify_push` |
|
|
126
|
-
| | `cleanup` |
|
|
127
|
-
|
|
|
128
|
-
| | `describe_session` |
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
##
|
|
133
|
-
|
|
134
|
-
subagent
|
|
116
|
+
| Before dispatch | `preflight_worker` | Starts a short probe in the target worker's environment, or runs the acceptance commands for real first |
|
|
117
|
+
| Dispatch | `create_worker` | Dispatches one worker. With `followup_of` it builds on another worker's work |
|
|
118
|
+
| | `resume_worker` | Continues the same session, optionally rebased onto the new head first |
|
|
119
|
+
| | `cancel_worker` | Stops a worker |
|
|
120
|
+
| Tracking | `poll_workers` | Without a cursor, the whole table; with one, only what changed since, and it recovers a dead first run and removes worktrees that are safe to remove |
|
|
121
|
+
| | `wait_workers` | Waits for a result, 60 seconds at most per call |
|
|
122
|
+
| Collecting | `get_worker` | Reads one worker: summary, report, status, events, goal, whichever parts you ask for |
|
|
123
|
+
| | `get_worker_diff` | The actual changes, paged by file and hunk |
|
|
124
|
+
| | `ask_worker` | Asks the worker a side question. Read-only; its thread is untouched |
|
|
125
|
+
| Delivery | `land_worker` | Commits on the worker's behalf and cherry-picks onto the integration branch; refuses if acceptance failed |
|
|
126
|
+
| | `verify_push` | Proves the landed commit is on the remote. It verifies; it never pushes for you |
|
|
127
|
+
| | `cleanup` | Shows why a worktree is still there, or removes it now. Normally cleanup is automatic |
|
|
128
|
+
| Batches | `find_works` | Finds a batch again, or searches history by substring |
|
|
129
|
+
| | `describe_session` | Records a batch's title, objective, default acceptance and approval state |
|
|
130
|
+
|
|
131
|
+
Three more are registered only with `AGENT_SUPERVISOR_TOOLS=all`: `facts` (the ledger of verified facts), `review` (an independent read-only verifier) and `get_artifact` (stored evidence). A normal batch never needs them, and leaving them out saves context in every session.
|
|
132
|
+
|
|
133
|
+
## How this differs from Claude Code subagents
|
|
134
|
+
|
|
135
|
+
A subagent can open its own worktree too, so file isolation is not the difference. The model and the process are.
|
|
135
136
|
|
|
136
137
|
| | Claude Code subagent | agent-supervisor worker |
|
|
137
138
|
|---|---|---|
|
|
138
|
-
|
|
|
139
|
-
|
|
|
140
|
-
|
|
|
141
|
-
|
|
|
142
|
-
|
|
|
143
|
-
|
|
|
139
|
+
| Which models | Claude only | Anything the Codex CLI has a provider for |
|
|
140
|
+
| Who does the work | Claude Code itself | A separate `codex exec` process |
|
|
141
|
+
| Two workers writing one file | No path declaration | `owned_paths` overlap is checked before dispatch and rejected |
|
|
142
|
+
| The main thread dies | The work cannot be collected | Workers and acceptance run to the end; a new window finds them again with `find_works` |
|
|
143
|
+
| Who can drive it | Claude Code only | Any MCP client |
|
|
144
|
+
| Seeing the process | Only the conclusion it returns | Raw JSONL and the web board |
|
|
144
145
|
|
|
145
|
-
##
|
|
146
|
+
## Configuration and state
|
|
146
147
|
|
|
147
|
-
|
|
148
|
+
Everything lives under `~/.agent-supervisor` (a machine upgraded from codex-supervisor-mcp that already has `~/.codex-supervisor` keeps using it): `data/supervisor.sqlite` is the ledger, `data/runs/<taskId>.jsonl` is Codex's raw output, and `worktrees/<taskId>/` holds each worker's checkout.
|
|
148
149
|
|
|
149
|
-
|
|
|
150
|
+
| Variable | Default | What it does |
|
|
150
151
|
|---|---|---|
|
|
151
|
-
| `SUPERVISOR_HOME` | `~/.agent-supervisor` |
|
|
152
|
-
| `CODEX_BIN` | `codex` | Codex CLI
|
|
153
|
-
| `SUPERVISOR_WEB_PORT` | `7877` |
|
|
154
|
-
| `AGENT_SUPERVISOR_NO_AUTO_UPDATE` |
|
|
152
|
+
| `SUPERVISOR_HOME` | `~/.agent-supervisor` | State root. The MCP server and the board must point at the same one |
|
|
153
|
+
| `CODEX_BIN` | `codex` | Path to the Codex CLI. GUI clients often lack it on `PATH` |
|
|
154
|
+
| `SUPERVISOR_WEB_PORT` | `7877` | Board port |
|
|
155
|
+
| `AGENT_SUPERVISOR_NO_AUTO_UPDATE` | unset | `1` turns off background updates and only notifies |
|
|
155
156
|
|
|
156
|
-
|
|
157
|
+
The remaining variables, the seven worker states and the cache directories the sandbox opens by default are in the [reference](docs/reference.en.md).
|
|
157
158
|
|
|
158
|
-
|
|
159
|
+
Updates take care of themselves. At start the server asks the registry in the background and, if there is a newer version, a detached process runs `npm i -g`. The running session is untouched and the next one starts on the new version. This only applies to a global install.
|
|
159
160
|
|
|
160
|
-
|
|
161
|
+
Uninstall:
|
|
161
162
|
|
|
162
163
|
```bash
|
|
163
164
|
npm uninstall -g agent-supervisor-mcp
|
|
@@ -166,42 +167,42 @@ codex mcp remove agent-supervisor
|
|
|
166
167
|
rm -rf ~/.claude/skills/agent-supervisor ~/.agents/skills/agent-supervisor ~/.codex/skills/agent-supervisor ~/.agent-supervisor
|
|
167
168
|
```
|
|
168
169
|
|
|
169
|
-
##
|
|
170
|
+
## Troubleshooting
|
|
170
171
|
|
|
171
|
-
|
|
|
172
|
+
| Symptom | Cause | Fix |
|
|
172
173
|
|---|---|---|
|
|
173
|
-
| `claude mcp list`
|
|
174
|
-
|
|
|
175
|
-
| `codex only resolved to a shell shim` | Windows
|
|
176
|
-
| `Cannot find module 'node:sqlite'` | Node
|
|
177
|
-
|
|
|
178
|
-
|
|
|
179
|
-
| `git add`
|
|
180
|
-
| `owned_paths overlap with active worker(s)` |
|
|
181
|
-
|
|
|
182
|
-
| `port 7877 ... is already in use` |
|
|
183
|
-
|
|
184
|
-
##
|
|
185
|
-
|
|
186
|
-
- worktree
|
|
187
|
-
-
|
|
188
|
-
-
|
|
189
|
-
- `acceptance`
|
|
190
|
-
-
|
|
191
|
-
- `find_works`
|
|
192
|
-
|
|
193
|
-
##
|
|
174
|
+
| Missing from `claude mcp list` | The install did not run `postinstall` | `agent-supervisor-setup` |
|
|
175
|
+
| Worker `failed` at once, `spawn codex ENOENT` | No codex on the process `PATH` | Set `CODEX_BIN` |
|
|
176
|
+
| `codex only resolved to a shell shim` | Windows found only the `.cmd`; the package entry is gone | Reinstall `@openai/codex`, or point `CODEX_BIN` at `codex.js` |
|
|
177
|
+
| `Cannot find module 'node:sqlite'` | Node older than 22.13.0 | Upgrade Node |
|
|
178
|
+
| Worker is `lost` | The worker or its run process was killed | Read the events, then `resume_worker` |
|
|
179
|
+
| Worker is `timed_out` | Its time budget ran out and it was stopped | Read what it left; `resume_worker` after a per-run limit, `followup_of` with new `limits` after the total one |
|
|
180
|
+
| `git add` fails with `index.lock: Operation not permitted` | The sandbox makes `.git` read-only. That is the intended boundary | Let `land_worker` commit with `commit_message` |
|
|
181
|
+
| `owned_paths overlap with active worker(s)` | Two workers claimed the same paths | Split the work differently, or cancel the one holding them |
|
|
182
|
+
| The board is empty | The board and the MCP server use different `SUPERVISOR_HOME` | Point both at the same directory |
|
|
183
|
+
| `port 7877 ... is already in use` | A board is already running | Open that one, or change `SUPERVISOR_WEB_PORT` |
|
|
184
|
+
|
|
185
|
+
## Known limitations
|
|
186
|
+
|
|
187
|
+
- A worktree is cut from a commit. Uncommitted changes in your checkout are not in it.
|
|
188
|
+
- Only the working directory is isolated. Temp directories, databases and ports are shared.
|
|
189
|
+
- The guard blocks direct file writes, but it is not a filesystem sandbox. A script you allowed can have side effects outside its declared paths; the diff check before landing is what catches them.
|
|
190
|
+
- Acceptance checks what you wrote in `acceptance` and nothing else. The rest is the main thread reading the diff.
|
|
191
|
+
- The client's MCP tool timeout is a hard wall, so one `wait_workers` call cannot wait to the end. Call it again.
|
|
192
|
+
- `find_works` is substring matching, which is enough for a few hundred works. Vector search is not planned.
|
|
193
|
+
|
|
194
|
+
## Development
|
|
194
195
|
|
|
195
196
|
```bash
|
|
196
197
|
npm install
|
|
197
|
-
npm test # fake-codex
|
|
198
|
-
npm run test:real #
|
|
199
|
-
npm run web:dev #
|
|
198
|
+
npm test # fake-codex replay, under a minute
|
|
199
|
+
npm run test:real # real codex CLI end to end; needs a logged-in codex
|
|
200
|
+
npm run web:dev # board development, /api proxied to 7877
|
|
200
201
|
```
|
|
201
202
|
|
|
202
|
-
CI
|
|
203
|
+
CI runs on Ubuntu, macOS and Windows, plus a Node 22.13.0 job that pins the lower bound of `engines`.
|
|
203
204
|
|
|
204
|
-
|
|
205
|
+
To contribute, read [CONTRIBUTING.en.md](CONTRIBUTING.en.md). Security reports go through the [private channel](https://github.com/zriyox/agent-supervisor-mcp/security/advisories/new); see [SECURITY.md](SECURITY.md).
|
|
205
206
|
|
|
206
207
|
## License
|
|
207
208
|
|
package/README.ru.md
ADDED
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
# agent-supervisor-mcp
|
|
2
|
+
|
|
3
|
+
[English](README.md) | Русский | [中文](README.zh-CN.md)
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/agent-supervisor-mcp)
|
|
6
|
+
[](https://www.npmjs.com/package/agent-supervisor-mcp)
|
|
7
|
+
[](LICENSE)
|
|
8
|
+
[](https://github.com/zriyox/agent-supervisor-mcp/actions/workflows/ci.yml)
|
|
9
|
+
[](package.json)
|
|
10
|
+
[](https://glama.ai/mcp/servers/zriyox/agent-supervisor-mcp)
|
|
11
|
+
|
|
12
|
+
Сайт [agent-supervisor.zriyo.com](https://agent-supervisor.zriyo.com) · для моделей [llms.txt](https://agent-supervisor.zriyo.com/llms.txt) · [справочник](docs/reference.en.md) (на английском)
|
|
13
|
+
|
|
14
|
+
Если натравить несколько агентов на один репозиторий, они затирают работу друг друга, никто не может сказать, кто что поменял, а контекст основного потока забивается выводом воркеров.
|
|
15
|
+
|
|
16
|
+
agent-supervisor-mcp — это MCP-сервер. Основной поток (Claude Code, Codex или любой MCP-клиент) запускает через него несколько воркеров Codex CLI одновременно: у каждого воркера свой Git worktree, состояние хранится в SQLite, а следить за ними можно на веб-доске. Раздача задач и учёт живут на диске, а не в контексте модели.
|
|
17
|
+
|
|
18
|
+

|
|
19
|
+
|
|
20
|
+
*30 секунд, записано вживую: три воркера параллельно в своих worktree, затем основной поток собирает три diff и делает один коммит.*
|
|
21
|
+
|
|
22
|
+
> **Раньше пакет назывался codex-supervisor-mcp.** Его переименовали, потому что воркер теперь не только Codex. Машину со старым пакетом переводит его последний релиз: ставится этот пакет, регистрация MCP и skill становятся `agent-supervisor`, а каталог состояния остаётся на месте. Префикс утилит командной строки меняется с `codex-supervisor-` на `agent-supervisor-`.
|
|
23
|
+
>
|
|
24
|
+
> **Переход с 0.x на 1.x**: 39 инструментов превратились в 14, с новыми именами и аргументами, старые имена не сохранены. Сначала доведите до конца запущенных воркеров, а после обновления откройте сессию заново, чтобы подгрузился новый skill. Таблица инструментов в [справочнике](docs/reference.en.md), что изменилось — в [релизе 1.0.0](https://github.com/zriyox/agent-supervisor-mcp/releases/tag/v1.0.0).
|
|
25
|
+
|
|
26
|
+
## Что он решает
|
|
27
|
+
|
|
28
|
+
| Проблема | Что он делает |
|
|
29
|
+
|---|---|
|
|
30
|
+
| Воркеры наступают друг другу на файлы | У каждого воркера свой worktree; пересечение `owned_paths` проверяется до запуска |
|
|
31
|
+
| Вывод воркеров заливает основной поток | События пишутся в JSONL; основной поток читает сжатую сводку (все воркеры меньше чем в 7000 байт) |
|
|
32
|
+
| После перезапуска или в новой сессии воркеры теряются | Одна строка SQLite на задачу, с её `thread_id`; `resume_worker` возвращается в ту же сессию Codex |
|
|
33
|
+
| Упавший запуск не отличить от умершего процесса | Машина состояний разделяет `failed` и `lost`, а у сбоя есть источник и код |
|
|
34
|
+
| Воркер говорит, что всё готово, а это не так | Задача уходит с командами `acceptance`; супервизор сам запускает их после выхода воркера и не даёт влить результат, если они упали |
|
|
35
|
+
| Изменения так и остаются в локальной ветке | `land_worker` вливает их в интеграционную ветку; `verify_push` подтверждает, что коммит есть на remote |
|
|
36
|
+
| Worktree копятся | Влитые и пустые удаляются при опросе. Невлитая работа хранится 7 дней, и перед удалением worktree её незакоммиченные правки коммитятся в её ветку. Ветки и доказательства остаются |
|
|
37
|
+
|
|
38
|
+
По умолчанию воркер — это процесс `codex exec`, а `model` передаётся как есть. Основной поток остаётся на Claude, воркеры работают на DeepSeek или другом провайдере, и счета не смешиваются.
|
|
39
|
+
|
|
40
|
+
Воркером может быть и Claude Code: передайте `runner: "claude"` в `create_worker`. У него нет песочницы ОС, поэтому он работает только в git worktree или в режиме только для чтения, и у него нет побочного чата (`ask_worker`); запуск, приёмка, продолжение, вливание и очистка такие же. Как подключить другой CLI, описано в [docs/runner.md](docs/runner.md).
|
|
41
|
+
|
|
42
|
+
## Пять минут до первой партии
|
|
43
|
+
|
|
44
|
+
Нужны Node.js 22.13.0 или новее и `codex` CLI в `PATH`. Работает на macOS, Linux и Windows.
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
npm install -g agent-supervisor-mcp
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Скрипт установки кладёт skill во все найденные Claude Code и Codex и регистрирует MCP-сервер. После этого перезапустите их. Если ничего не зарегистрировалось (например, с `--ignore-scripts`), запустите `agent-supervisor-setup` или добавьте вручную:
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
claude mcp add -s user agent-supervisor -- npx -y agent-supervisor-mcp
|
|
54
|
+
codex mcp add agent-supervisor -- npx -y agent-supervisor-mcp
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
GUI-клиентам вроде Claude Desktop, Cursor и Windsurf конфигурацию MCP нужно поправить руками; фрагмент есть в [справочнике](docs/reference.en.md#environment-variables). Только skill, без сервера: `npx skills add zriyox/agent-supervisor-mcp`.
|
|
58
|
+
|
|
59
|
+
Дальше скажите в Claude Code обычными словами:
|
|
60
|
+
|
|
61
|
+
> Допиши юнит-тесты для этих трёх модулей. Используй agent-supervisor, три воркера параллельно, назови сессию «юнит-тесты».
|
|
62
|
+
|
|
63
|
+
Skill проведёт основной поток по таким шагам:
|
|
64
|
+
|
|
65
|
+
```
|
|
66
|
+
preflight_worker сначала пробный запуск в том же окружении
|
|
67
|
+
create_worker ×3 каждому session, owned_paths, goal
|
|
68
|
+
wait_workers не больше 60 секунд за вызов; вызывать снова, пока не закончится
|
|
69
|
+
get_worker ×3 отчёт каждого воркера, с командами, которые он запускал, и их кодами выхода
|
|
70
|
+
get_worker_diff ×3 что он на самом деле поменял
|
|
71
|
+
land_worker ×3 проверено; закоммитить за него и влить
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Воркеры никогда не коммитят сами. Их изменения лежат в `worker/<taskId>`, пока основной поток не прочитает diff.
|
|
75
|
+
|
|
76
|
+
Чтобы смотреть, как они работают, откройте доску:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
agent-supervisor-web # или: npx -p agent-supervisor-mcp agent-supervisor-web
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Откройте `http://127.0.0.1:7877`. Там видны воркеры каждой сессии: статус, команда, которая выполняется прямо сейчас, изменения и события. Воркеру можно задать вопрос сбоку: ответ приходит из копии его треда только для чтения, так что текущая работа не прерывается. Доска только показывает. Запускать и отменять воркеров с неё нельзя.
|
|
83
|
+
|
|
84
|
+
## Как я им пользуюсь
|
|
85
|
+
|
|
86
|
+
Основным потоком может быть всё, что говорит на MCP; это просто мой способ. Я держу две сессии Claude Code: одну для документов, другую для раздачи задач. Одна сессия, которая и пишет проект, и следит за воркерами, забивает контекст за два часа.
|
|
87
|
+
|
|
88
|
+
| Кто | Где | Что делает |
|
|
89
|
+
|---|---|---|
|
|
90
|
+
| Я | | Решаю, что строить, принимаю решения, читаю отчёты |
|
|
91
|
+
| Сессия планирования | Репозиторий требований и документации | Обсуждает требование, пишет проект, пишет по одному брифу на блок работы |
|
|
92
|
+
| Сессия «главного мозга» | Worktree репозитория с кодом | Читает бриф, раздаёт задачи воркерам, проверяет diff, отчитывается мне. Сама бизнес-код не пишет |
|
|
93
|
+
| Воркеры Codex | Свои worktree | Один воркер на функциональный пакет, который можно проверить отдельно. Без коммитов и push |
|
|
94
|
+
|
|
95
|
+
Между двумя сессиями передаётся один блок текста: его вставляют в сессию главного мозга и отдают через `/goal`:
|
|
96
|
+
|
|
97
|
+
```text
|
|
98
|
+
[Роль] Ты главный мозг: раздаёшь задачи воркерам, проверяешь результат, обновляешь доки, отчитываешься мне.
|
|
99
|
+
Бизнес-код ты не пишешь. Сначала загрузи skill agent-supervisor.
|
|
100
|
+
[Контекст] Зачем нужен этот блок, что осталось от предыдущего
|
|
101
|
+
[Сначала прочти] Какие разделы каких документов и какой главнее, если они расходятся
|
|
102
|
+
[Сделать] Следуй таблице из раздела N брифа. Ничего сверх таблицы
|
|
103
|
+
[Раздача] Сначала find_works, чтобы ничего не запустить дважды; один session.id на партию;
|
|
104
|
+
параллельно только при непересекающихся наборах файлов; команда проверки идёт и в acceptance;
|
|
105
|
+
словам воркера не верить, верить diff, который ты прочитал
|
|
106
|
+
[Красные линии] Что не менять, не пушить и не читать
|
|
107
|
+
[Отчёт] Сначала таблицы, потом остановись и жди меня
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
## Инструменты
|
|
111
|
+
|
|
112
|
+
По умолчанию их четырнадцать. Аргументы и пограничные случаи — в [справочнике](docs/reference.en.md#tools).
|
|
113
|
+
|
|
114
|
+
| Этап | Инструмент | Что делает |
|
|
115
|
+
|---|---|---|
|
|
116
|
+
| До запуска | `preflight_worker` | Запускает короткую пробу в окружении будущего воркера или сначала по-настоящему прогоняет команды приёмки |
|
|
117
|
+
| Запуск | `create_worker` | Запускает одного воркера. С `followup_of` продолжает работу другого воркера |
|
|
118
|
+
| | `resume_worker` | Продолжает ту же сессию, при желании сначала перебазировав её на новую голову |
|
|
119
|
+
| | `cancel_worker` | Останавливает воркера |
|
|
120
|
+
| Наблюдение | `poll_workers` | Без курсора — вся таблица; с курсором — только то, что изменилось, плюс восстановление умершего первого запуска и удаление worktree, которые можно удалить безопасно |
|
|
121
|
+
| | `wait_workers` | Ждёт результата, не больше 60 секунд за вызов |
|
|
122
|
+
| Сбор результата | `get_worker` | Читает одного воркера: сводку, отчёт, статус, события, цель — какие части попросите |
|
|
123
|
+
| | `get_worker_diff` | Реальные изменения, постранично по файлам и hunk |
|
|
124
|
+
| | `ask_worker` | Задаёт воркеру вопрос сбоку. Только чтение; его тред не трогается |
|
|
125
|
+
| Сдача | `land_worker` | Коммитит за воркера и делает cherry-pick в интеграционную ветку; отказывает, если приёмка упала |
|
|
126
|
+
| | `verify_push` | Подтверждает, что влитый коммит есть на remote. Только проверяет, сам за вас не пушит |
|
|
127
|
+
| | `cleanup` | Показывает, почему worktree ещё на месте, или удаляет его сразу. Обычно очистка идёт сама |
|
|
128
|
+
| Партии | `find_works` | Снова находит партию или ищет по истории подстрокой |
|
|
129
|
+
| | `describe_session` | Записывает название партии, цель, приёмку по умолчанию и статус согласования |
|
|
130
|
+
|
|
131
|
+
Ещё три регистрируются только с `AGENT_SUPERVISOR_TOOLS=all`: `facts` (реестр проверенных фактов), `review` (независимый проверяющий только для чтения) и `get_artifact` (сохранённые доказательства). Обычной партии они не нужны, а без них в каждой сессии экономится контекст.
|
|
132
|
+
|
|
133
|
+
## Чем это отличается от subagent в Claude Code
|
|
134
|
+
|
|
135
|
+
Subagent тоже может открыть свой worktree, так что разница не в изоляции файлов. Разница в модели и процессе.
|
|
136
|
+
|
|
137
|
+
| | Subagent Claude Code | Воркер agent-supervisor |
|
|
138
|
+
|---|---|---|
|
|
139
|
+
| Какие модели | Только Claude | Любые, для которых у Codex CLI есть провайдер |
|
|
140
|
+
| Кто выполняет работу | Сам Claude Code | Отдельный процесс `codex exec` |
|
|
141
|
+
| Два воркера пишут один файл | Пути не объявляются | Пересечение `owned_paths` проверяется до запуска, и запуск отклоняется |
|
|
142
|
+
| Основной поток умер | Результат не забрать | Воркеры и приёмка доходят до конца; новое окно снова находит их через `find_works` |
|
|
143
|
+
| Кто может управлять | Только Claude Code | Любой MCP-клиент |
|
|
144
|
+
| Видно ли процесс | Только итоговый вывод | Сырой JSONL и веб-доска |
|
|
145
|
+
|
|
146
|
+
## Настройка и состояние
|
|
147
|
+
|
|
148
|
+
Всё лежит в `~/.agent-supervisor` (машина, обновлённая с codex-supervisor-mcp, у которой уже есть `~/.codex-supervisor`, продолжает пользоваться им): `data/supervisor.sqlite` — это реестр, `data/runs/<taskId>.jsonl` — сырой вывод Codex, а в `worktrees/<taskId>/` лежит рабочая копия каждого воркера.
|
|
149
|
+
|
|
150
|
+
| Переменная | По умолчанию | Что делает |
|
|
151
|
+
|---|---|---|
|
|
152
|
+
| `SUPERVISOR_HOME` | `~/.agent-supervisor` | Корень состояния. MCP-сервер и доска должны смотреть в один и тот же |
|
|
153
|
+
| `CODEX_BIN` | `codex` | Путь к Codex CLI. У GUI-клиентов его часто нет в `PATH` |
|
|
154
|
+
| `SUPERVISOR_WEB_PORT` | `7877` | Порт доски |
|
|
155
|
+
| `AGENT_SUPERVISOR_NO_AUTO_UPDATE` | не задана | `1` выключает фоновые обновления, остаются только уведомления |
|
|
156
|
+
|
|
157
|
+
Остальные переменные, семь состояний воркера и каталоги кэша, которые песочница открывает по умолчанию, — в [справочнике](docs/reference.en.md).
|
|
158
|
+
|
|
159
|
+
Обновления происходят сами. При старте сервер в фоне спрашивает реестр npm и, если есть версия новее, отдельный процесс запускает `npm i -g`. Текущая сессия не затрагивается, следующая стартует уже на новой версии. Это работает только для глобальной установки.
|
|
160
|
+
|
|
161
|
+
Удаление:
|
|
162
|
+
|
|
163
|
+
```bash
|
|
164
|
+
npm uninstall -g agent-supervisor-mcp
|
|
165
|
+
claude mcp remove -s user agent-supervisor
|
|
166
|
+
codex mcp remove agent-supervisor
|
|
167
|
+
rm -rf ~/.claude/skills/agent-supervisor ~/.agents/skills/agent-supervisor ~/.codex/skills/agent-supervisor ~/.agent-supervisor
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
## Если что-то не так
|
|
171
|
+
|
|
172
|
+
| Симптом | Причина | Что сделать |
|
|
173
|
+
|---|---|---|
|
|
174
|
+
| Нет в `claude mcp list` | Установка не запустила `postinstall` | `agent-supervisor-setup` |
|
|
175
|
+
| Воркер сразу `failed`, `spawn codex ENOENT` | В `PATH` процесса нет codex | Задайте `CODEX_BIN` |
|
|
176
|
+
| `codex only resolved to a shell shim` | Windows нашла только `.cmd`, точки входа пакета нет | Переустановите `@openai/codex` или направьте `CODEX_BIN` на `codex.js` |
|
|
177
|
+
| `Cannot find module 'node:sqlite'` | Node старше 22.13.0 | Обновите Node |
|
|
178
|
+
| Воркер в состоянии `lost` | Воркер или его процесс запуска убили | Прочитайте события, затем `resume_worker` |
|
|
179
|
+
| Воркер в состоянии `timed_out` | Кончился бюджет времени, и его остановили | Посмотрите, что он оставил; после лимита на один запуск — `resume_worker`, после общего лимита — `followup_of` с новыми `limits` |
|
|
180
|
+
| `git add` падает с `index.lock: Operation not permitted` | Песочница делает `.git` доступным только для чтения. Так и задумано | Пусть коммитит `land_worker` с `commit_message` |
|
|
181
|
+
| `owned_paths overlap with active worker(s)` | Два воркера заняли одни и те же пути | Разделите работу иначе или отмените того, кто их держит |
|
|
182
|
+
| Доска пустая | У доски и MCP-сервера разные `SUPERVISOR_HOME` | Направьте оба в один каталог |
|
|
183
|
+
| `port 7877 ... is already in use` | Доска уже запущена | Откройте её или поменяйте `SUPERVISOR_WEB_PORT` |
|
|
184
|
+
|
|
185
|
+
## Известные ограничения
|
|
186
|
+
|
|
187
|
+
- Worktree нарезается из коммита. Незакоммиченных изменений из вашей рабочей копии в нём нет.
|
|
188
|
+
- Изолирован только рабочий каталог. Временные каталоги, базы данных и порты общие.
|
|
189
|
+
- Защита блокирует прямую запись файлов, но это не файловая песочница. Разрешённый вами скрипт может что-то сделать за пределами объявленных путей; это ловит проверка diff перед вливанием.
|
|
190
|
+
- Приёмка проверяет то, что вы написали в `acceptance`, и больше ничего. Остальное — это основной поток, читающий diff.
|
|
191
|
+
- Таймаут MCP-инструмента у клиента — жёсткая стена, поэтому один вызов `wait_workers` не может ждать до конца. Вызовите его снова.
|
|
192
|
+
- `find_works` ищет по подстроке, этого хватает на несколько сотен задач. Векторный поиск не планируется.
|
|
193
|
+
|
|
194
|
+
## Разработка
|
|
195
|
+
|
|
196
|
+
```bash
|
|
197
|
+
npm install
|
|
198
|
+
npm test # прогон на fake-codex, меньше минуты
|
|
199
|
+
npm run test:real # настоящий codex CLI от начала до конца; нужен залогиненный codex
|
|
200
|
+
npm run web:dev # разработка доски, /api проксируется на 7877
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
CI работает на Ubuntu, macOS и Windows, плюс отдельная задача на Node 22.13.0, которая фиксирует нижнюю границу `engines`.
|
|
204
|
+
|
|
205
|
+
Чтобы внести вклад, прочитайте [CONTRIBUTING.en.md](CONTRIBUTING.en.md). Сообщения о проблемах безопасности — через [закрытый канал](https://github.com/zriyox/agent-supervisor-mcp/security/advisories/new); подробнее в [SECURITY.md](SECURITY.md).
|
|
206
|
+
|
|
207
|
+
## Лицензия
|
|
208
|
+
|
|
209
|
+
MIT
|