Skip to content

feat: add parallel multi-agent skill#1352

Closed
nideweilaiya wants to merge 2 commits into
esengine:mainfrom
nideweilaiya:feat/parallel-only
Closed

feat: add parallel multi-agent skill#1352
nideweilaiya wants to merge 2 commits into
esengine:mainfrom
nideweilaiya:feat/parallel-only

Conversation

@nideweilaiya

@nideweilaiya nideweilaiya commented May 19, 2026

Copy link
Copy Markdown

Closes #1353

What

新增 /parallel 内置 Skill + parallel-mcp Server,让 Reasonix 支持多 Agent 并行执行。

包含 8 个文件:

  • parallel-mcp/ — MCP Server(parallel_schedule + parallel_status),pip install 即可用
  • skills/parallel-scheduler.py — Python 调度脚本,design + code 双模式
  • src/cli/ui/slash/handlers/parallel.ts/parallel 斜杠处理器
  • src/cli/ui/slash/commands.ts — 注册 /parallel 命令(extend 组)
  • src/cli/ui/slash/dispatch.ts — 注册 handler
  • src/skills.ts — 内置 parallel skill body

Why

让 Reasonix 支持将可拆解任务并行分发给多个独立 Agent 同时执行,替代 subagent 串行。固定 system prompt
确保高缓存命中率。

Architecture

/parallel <任务>
→ 读取 parallel skill body
→ LLM 调用 parallel_schedule MCP 工具
→ 3 个独立 reasonix run Worker 并行执行(固定 system prompt)
→ 合并结果返回

MCP Server 安装

cd parallel-mcp && pip install -e . && parallel-mcp --stdio

缓存

轮次 命中率
首轮 0%
第2轮 ~85%
第3轮+ ~95%

Verify

  • npm run verify 通过(build + lint + typecheck + 3115 tests passed)
  • 无 Co-Authored-By: Claude trailer
  • 未修改 CHANGELOG.md

Adds /parallel slash command with built-in parallel skill. The parallel
MCP server (parallel_schedule + parallel_status) is distributed separately.

- skills/parallel-scheduler.py — Python scheduler, design + code modes
- src/cli/ui/slash/handlers/parallel.ts — slash handler (resubmit skill body)
- src/cli/ui/slash/commands.ts — register /parallel in extend group
- src/cli/ui/slash/dispatch.ts — register parallel handler
- src/skills.ts — built-in parallel skill body

Architecture: fixed system prompts per Worker role → ~85% cache hit rate
after first call, ~95% by third.
Standalone MCP server: pip install parallel-mcp
Two tools: parallel_schedule + parallel_status

- parallel-mcp/parallel_server.py — server implementation (256 lines)
- parallel-mcp/pyproject.toml — pip package config
- parallel-mcp/README.md — install and usage guide
@nideweilaiya nideweilaiya marked this pull request as draft May 19, 2026 17:17
@nideweilaiya nideweilaiya reopened this May 19, 2026
@nideweilaiya nideweilaiya marked this pull request as ready for review May 19, 2026 17:24
@esengine

Copy link
Copy Markdown
Owner

Thanks @nideweilaiya for the substantial effort. I have to decline this one, and I want to be direct about why so you don't put more work into a revision that I'd still turn down.

Direction is off for this project. Reasonix's positioning rests on being the cheap option — cache-first, flash-first, single conversation per task. Spawning three independent reasonix run subprocesses for each /parallel invocation is exactly the multi-shot / parallel-sampling shape we've publicly committed not to take. Even at 85% cache hit on later rounds, that's still 3× the rate-limit and API-call cost per prompt against a workflow a single subagent dispatch already covers. The cache benefit you cite is per-worker over multiple rounds, not 3× per round — the three workers don't share a prompt, so they don't share a cache.

Setting direction aside, the PR has concrete blockers that would have to be resolved before any version of this could land:

  1. parallel_server.py:40-43 hard-codes D:/Reasonix/dist/cli/index.js — your local checkout path. Reasonix has no D:/Reasonix; this wouldn't work for any user but you. The glob fallback is fine but the hard-coded constant has to go.

  2. src/cli/ui/slash/handlers/parallel.ts:18 points the built-in slash command at a personal third-party repo (nideweilaiya/Collusion). Built-in commands must reference project-owned docs only.

  3. Blackboard paths are hard-coded /tmp/parallel_*; Windows has no /tmp. Use os.tmpdir() or equivalent.

  4. Workers are launched with --no-config, which would also drop the DEEPSEEK_API_KEY for users who put it in ~/.reasonix/config.json via the setup wizard. Those users' workers would fail to authenticate.

  5. Five Chinese-only worker system prompts hard-coded in two places; the rest of the project's system prompts are English (see the recent refactor(prompt): compress codeSystemPrompt (-51%, ~3.1k tokens/request) #1323 compression). This locks the orchestrator to a single language.

  6. Bundling a separate PyPI package (parallel-mcp/) inside an npm TypeScript repo splits the dist/install/maintenance story across two language ecosystems. If we did want a parallel MCP server, it would live in its own repo, not here.

  7. CI hasn't run on this PR (statusCheckRollup: [], mergeStateStatus: UNSTABLE). 672 new lines, zero tests added.

If you want a parallel-execution feature in the agent ecosystem, publishing parallel-mcp as a standalone PyPI package that any MCP-aware client can wire up — Reasonix included via .mcp.json — is the right shape. That keeps Reasonix's own surface lean and gives users who want the trade-off an opt-in path without us committing the project to it. Happy to discuss other smaller contributions.

Closing.

@esengine esengine closed this May 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

多Agent并行执行 Skill — /parallel 命令 + parallel MCP 工具

3 participants