OpenAI Codex 原生的多智能体蜂群编排,用于并行编码。在使用多个 Codex CLI 智能体并行工作(配合 git worktrees 等)时使用。
Parallel Codex agents: plan → endorse → spawn → monitor → review → integrate → ship.
bash
# 1. Write task prompts
cat > /tmp/prompt-task1.md << 'EOF'
Implement feature X...
EOF
# 2. Create tasks JSON
cat > /tmp/tasks.json << 'EOF'
[
{"id": "feat-x", "description": "/tmp/prompt-task1.md", "role": "builder"},
{"id": "feat-y", "description": "/tmp/prompt-task2.md", "role": "builder"}
]
EOF
# 3. Spawn batch
bash scripts/spawn-batch.sh "/path/to/project" "batch-1" "Description" /tmp/tasks.json
RoleModelReasoningUsearchitecto3highDesign, planning, complex decisionsbuildercodex-minimediumFeature implementation (parallel)reviewero3mediumAuto-review via codex exec reviewintegratoro3highCross-branch merge + conflict resolution
codex exec --full-auto — non-interactive sandboxed executioncodex exec review — native code review (replaces custom reviewer)-c model=o3 — deep reasoning model for complex tasks-c model_reasoning_effort=high — maximum reasoning depthScriptPurposespawn-batch.shSpawn N parallel agents + integration watcherspawn-agent.shSpawn single agent (manual worktree + tmux + codex exec)endorse-task.shEndorse task before spawncheck-agents.shShow running agent statuscleanup.shRemove worktrees, branches, sessionsnotify.shWebhook/Telegram notificationnotify-on-complete.shAuto-watcher with native codex exec review``integration-watcher.shAuto-merge when batch completes
scripts/ and config/ to your workspaceconfig/swarm.conf (copy from .example)bash 4+, tmux, git, gh, jq, codex (Codex CLI)