fix: 复用 agent

This commit is contained in:
2026-07-15 01:29:56 +08:00
parent b3765ecad6
commit 8b82539f6f
5 changed files with 52 additions and 23 deletions
+7 -5
View File
@@ -29,7 +29,7 @@
Coordinator 发现或读取 open 任务
-> prepare:写/补全 tasks.yaml 验收信号
-> 决定 worktree:当前 worktree 起子 agent,还是新建隔离 worktree(见下节「子任务放哪」)
-> worker:先按项目覆盖层校验命令,再按档位和执行模式建 worker 终端(见 model-routing.md
-> 解析 worker:先复用同 worktree、同角色的空闲 worker;没有可复用项时才校验命令并新建(见 orca-adapter.md
-> dispatch 给 Developer--to <worker handle>
-> waitDeveloper 的 worker_done / escalation
-> writeback fixed_by_dev
@@ -43,7 +43,7 @@ Coordinator 发现或读取 open 任务
```
一次派发只修一个明确问题(细则见 `optimization-method.md` §「每轮派发只修一个明确问题」)。
「决定 worktree」「 worker」两步的决策见下节与 `model-routing.md` / `orca-adapter.md`
「决定 worktree」「解析 worker」两步的决策见下节与 `model-routing.md` / `orca-adapter.md`
---
@@ -51,10 +51,11 @@ Coordinator 发现或读取 open 任务
Coordinator 派发前先决定 Developer/Test 在哪工作。两种方式:
**方式 1:当前 worktree 起子 agent(终端)**
**方式 1:当前 worktree 复用或起子 agent(终端)**
```bash
orca terminal create --worktree active --command "cursor-agent --yolo --model auto" --json
# 先按 orca-adapter.md 的 worker 复用流程查找空闲终端;没有时才创建
orca terminal create --worktree active --command "cursor-agent --yolo --model auto" --title "ACK-DEV-CURSOR-AUTO-1" --json
```
- 适合:串行闭环、一次一个 Developer 任务、小改动、Test 要复测的正是 Developer 改的那棵树。
@@ -65,7 +66,8 @@ orca terminal create --worktree active --command "cursor-agent --yolo --model au
```bash
orca worktree create --name <feature> --base-branch <base> --json
# 然后在新 worktree 内 orca terminal create --worktree path:<new> --command "cursor-agent --yolo --model auto"
# 然后先查该 worktree 的同角色空闲终端;没有时才创建
orca terminal create --worktree path:<new> --command "cursor-agent --yolo --model auto" --title "ACK-DEV-CURSOR-AUTO-1"
```
- 适合:并行多个互不依赖的子任务、大/高风险/实验性改动、要保持基线分支干净(如 prod 不动、feature 走独立分支)、要独立 build 或跑独立服务实例、best-of-N 尝试。