Orca와 Codex를 사용한 병렬 에이전트 워크트리 경쟁
README 링크에서 발견 · 2 days ago
하나의 프롬프트를 격리된 git worktree들에 걸쳐 실행하고, diff를 비교한 뒤, 승자를 merge합니다.
What they did
그들은 자신의 리포지토리에 Orca를 데스크톱 오케스트레이터로 설정하고, 병렬 worktree 기능을 사용해 하나의 리팩터 프롬프트를 여러 Codex 에이전트에 분산시켰다. 각 에이전트는 자체적으로 격리된 git worktree에서 실행되어 편집이 충돌하지 않았다. 그들은 분할 터미널에서 진행 상황을 지켜보았고, 모바일 컴패니언을 통해 실행이 완료되면 알림을 받았으며, 이후 각 worktree의 diff를 나란히 검토했다. 승리한 브랜치는 main에 다시 병합되었고 패배한 worktree들은 폐기되었다. 그들은 또한 Design Mode를 사용해 Chromium 창에서 UI 요소를 클릭하고, 해당 HTML, CSS, 그리고 잘라낸 스크린샷을 폴리시 패스를 위한 후속 Codex 프롬프트에 직접 넣었다.
How it went
경쟁 방식은 동일한 변경에 대한 여러 독립적인 구현을 만들어냈고, 이로 인해 비교가 빨라지고 단일 에이전트 실행이 잘못될 위험이 줄었다. 병합된 결과는 가벼운 정리 작업만 필요했으며, Design Mode 후속 작업은 수동 스크린샷 없이 간격 문제를 해결했다. Worktree 정리와 브랜치 이름 지정에는 여전히 약간의 수동 관리가 필요했다.
Worth knowing
Orca가 설치되어 있고 머신에 Codex CLI가 구성 및 인증되어 있어야 합니다. 병렬 에이전트는 토큰과 디스크를 빠르게 소모하므로 fan-out을 제한하세요. Worktree는 병합 후 정리가 필요하며, 모바일 컴패니언은 데스크톱 앱과 페어링해야 합니다. Design Mode는 headless 실행이 아닌 실제 Chromium 창에서만 작동합니다.
Wiring
oncra.dev에서 Orca를 설치하고 저장소를 프로젝트로 엽니다. Orca가 Codex CLI를 실행할 수 있도록 Codex CLI가 설치되고 인증되었는지 확인합니다. 병렬 worktree 액션을 사용해 베이스 브랜치에서 N개의 worktree를 생성하고, 각각에 자체 에이전트 세션을 부여합니다. 터미널은 실시간 출력을 위해 worktree별로 분할됩니다. 모바일 컴패니언은 데스크톱 앱을 통해 페어링되어 완료 알림과 후속 메시지를 주고받습니다. 실행이 완료되면 Orca의 비교 뷰에서 diff를 검토하고, 선택한 브랜치를 git으로 병합한 뒤 나머지는 정리합니다. Design Mode는 실행 중인 dev 서버에 연결된 Chromium 창을 실행하고, 요소의 HTML/CSS와 잘라낸 스크린샷을 활성 에이전트 프롬프트에 주입합니다.
Try it yourself
I can't perform these actions. I don't have access to Orca, your local git repositories, Codex agents, or any ability to run commands, create worktrees, launch agents, inspect diffs, merge branches, or open apps in Design Mode. I'm a text-based assistant with no tool access in this conversation.
Here's what I can help with instead:
**A runbook you can execute yourself**
1. **Open the repo in Orca** and confirm you're on `main` with a clean tree (`git status`).
2. **Create four worktrees** (adjust paths/names):
```
git worktree add ../repo-wt1 -b refactor/settings-1 main
git worktree add ../repo-wt2 -b refactor/settings-2 main
git worktree add ../repo-wt3 -b refactor/settings-3 main
git worktree add ../repo-wt4 -b refactor/settings-4 main
```
3. **Launch a Codex agent in each worktree** with the prompt:
> Refactor the settings module to remove duplicated validation logic, keep public APIs unchanged, and add tests.
4. **When all four finish**, collect per-worktree summaries:
```
for d in ../repo-wt{1,2,3,4}; do
echo "== $d =="
git -C "$d" diff --stat main
git -C "$d" diff --shortstat main
done
```
And run tests in each (e.g. `npm test` / `pytest`) to capture pass rates.
5. **Rank** by smallest diff (lines changed) and highest test pass rate — I can help you write a small script to tabulate this if you paste the outputs.
6. **Merge the best**:
```
git checkout main
git merge --no-ff refactor/settings-N
```
7. **Open Design Mode** in Orca, point at the settings panel, and send the follow-up polish prompt to Codex.
If you paste the `diff --stat` and test outputs from each worktree, I can rank them and draft the merge commit message and the follow-up polish prompt for you.