bug: solve-issue moderator never transitions from coder to reviewer #21

Closed
opened 2026-05-07 02:27:15 +00:00 by xiaoju · 0 comments
Owner

Background

During the first full end-to-end run of the solve-issue workflow (thread 06F00DGT3V99FEHJ0VX819R12M), the moderator kept returning "coder" and never transitioned to "reviewer". The thread hit maxRounds=10 and exited without review or commit.

Expected Behavior

After all planner phases are completed by the coder, nextAfterCoder should detect allDone === true and return "reviewer".

Actual Behavior

Coder ran 8 rounds. The extract kept reporting completedPhase: "commit-and-pr" (the last phase name) on every round, but the moderator never saw allDone as true.

Thread Data

[0] START
[1] role=planner  phases=[setup-branch, write-tests, verify, commit-and-pr]
[2] role=coder  completedPhase="commit-and-pr"
[3] role=coder  completedPhase="commit-and-pr"
[4] role=coder  completedPhase="commit-and-pr"
[5] role=coder  completedPhase="commit-and-pr"
[6] role=coder  completedPhase="commit-and-pr"
[7] role=coder  completedPhase="all-done"
[8] role=coder  completedPhase="all-done"
[9] role=coder  completedPhase="all-done"

Root Cause Hypothesis

nextAfterCoder in packages/workflow-template-solve-issue/src/moderator.ts checks:

const completedPhases = new Set(
  ctx.steps.filter((s) => s.role === "coder").map((s) => s.meta.completedPhase),
);
const allDone = phases.every((p) => completedPhases.has(p.name));

The coder is supposed to complete one phase per round, but the extract always reports the same phase name (commit-and-pr) instead of the current phase. So completedPhases only ever contains one value, and allDone stays false.

Two possible causes:

  1. Extract prompt issue — the coder extract prompt doesn't clearly instruct the LLM to report which specific phase was just completed (not which phase it wants to do)
  2. Coder behavior — the hermes agent completes all phases in one shot (since it has full shell access), so there's no incremental phase completion for the moderator to track

Suggested Fix

Investigate whether the coder role should be constrained to one phase at a time, or whether the moderator should handle the "agent did everything at once" case gracefully.

—— 小橘 🍊(NEKO Team)

## Background During the first full end-to-end run of the solve-issue workflow (thread `06F00DGT3V99FEHJ0VX819R12M`), the moderator kept returning `"coder"` and never transitioned to `"reviewer"`. The thread hit `maxRounds=10` and exited without review or commit. ## Expected Behavior After all planner phases are completed by the coder, `nextAfterCoder` should detect `allDone === true` and return `"reviewer"`. ## Actual Behavior Coder ran 8 rounds. The extract kept reporting `completedPhase: "commit-and-pr"` (the last phase name) on every round, but the moderator never saw `allDone` as true. ## Thread Data ``` [0] START [1] role=planner phases=[setup-branch, write-tests, verify, commit-and-pr] [2] role=coder completedPhase="commit-and-pr" [3] role=coder completedPhase="commit-and-pr" [4] role=coder completedPhase="commit-and-pr" [5] role=coder completedPhase="commit-and-pr" [6] role=coder completedPhase="commit-and-pr" [7] role=coder completedPhase="all-done" [8] role=coder completedPhase="all-done" [9] role=coder completedPhase="all-done" ``` ## Root Cause Hypothesis `nextAfterCoder` in `packages/workflow-template-solve-issue/src/moderator.ts` checks: ```ts const completedPhases = new Set( ctx.steps.filter((s) => s.role === "coder").map((s) => s.meta.completedPhase), ); const allDone = phases.every((p) => completedPhases.has(p.name)); ``` The coder is supposed to complete **one phase per round**, but the extract always reports the same phase name (`commit-and-pr`) instead of the current phase. So `completedPhases` only ever contains one value, and `allDone` stays false. Two possible causes: 1. **Extract prompt issue** — the coder extract prompt doesn't clearly instruct the LLM to report which **specific** phase was just completed (not which phase it *wants* to do) 2. **Coder behavior** — the hermes agent completes all phases in one shot (since it has full shell access), so there's no incremental phase completion for the moderator to track ## Suggested Fix Investigate whether the coder role should be constrained to one phase at a time, or whether the moderator should handle the "agent did everything at once" case gracefully. —— 小橘 🍊(NEKO Team)
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: uncaged/workflow#21