diff --git a/src/daemon/ticker.py b/src/daemon/ticker.py index 899598a..56dbe06 100644 --- a/src/daemon/ticker.py +++ b/src/daemon/ticker.py @@ -418,10 +418,8 @@ class Ticker: parent_id, self.MAX_ROUNDS) continue - # 递增 round_count - new_round = bb.increment_round_count(parent_id) - - # 构建庞统 review 上下文 + # 构建 prompt(用即将成为的 round_num,不提前 increment) + next_round = summary["round_count"] + 1 outputs = bb.get_aggregate_outputs(parent_id) comments = bb.get_round_comments(parent_id) parent_task = bb.get_task(parent_id) @@ -429,16 +427,18 @@ class Ticker: if not parent_task: continue - # spawn 庞统 review + # spawn 庞统 review(先 spawn,成功后再 increment round_count) review_prompt = self._build_review_prompt( - parent_task, summary, outputs, comments, new_round, + parent_task, summary, outputs, comments, next_round, project_id=project_id ) spawned = await self._spawn_pangtong_review( - parent_task, review_prompt, project_id, new_round=new_round + parent_task, review_prompt, project_id, new_round=next_round ) if spawned: + # spawn 成功 → increment round_count + 标记 reviewing + new_round = bb.increment_round_count(parent_id) reviewed.append(parent_id) logger.info( "Round %d review spawned for parent %s (subs: %s)",