Skip to content

rework_required has no autonomous exit: pre_check_batch passes but stage_a_passed never fires, and the only offered remedy is the human-only /swarm recover #2755

Description

@andrewjfiore

Summary

Once a task is in rework_required, there is no autonomous transition back to a state where Stage B can be re-dispatched. The tool's own remediation is a human-only command.

Version

opencode-swarm@7.179.1 on OpenCode 1.18.21, Windows 11. The relevant files are byte-identical on the 7.180.0 release branch.

Reproduction

  1. Task 1.1 reaches Stage B with correct code (reviewer APPROVED).
  2. test_engineer returns a non-PASS verdict for a tool-argument reason (see the companion issue on SKIPPED). The task moves to rework_required.
  3. Architect re-dispatches test_engineer. Refused:
TASK_WORKFLOW_STAGE_A_REQUIRED: cannot dispatch test_engineer for task 1.1 from rework_required.
Stage B (test_engineer) requires the task to be at pre_check_passed (or later) - a state written only
by the stage_a_passed transition, which is emitted when pre_check_batch completes with the task
correctly attributed. Remediation: run pre_check_batch on the task's changed files first. If
pre_check_batch passes but the task remains coder_delegated (typical after /swarm reset-session),
run /swarm recover 1.1 to repair Stage A attribution, then re-dispatch.
  1. Architect runs pre_check_batch on the task's changed files. It returns gates_passed: true, but check_gate_status still shows "workflow": { "state": "rework_required", "generation": 1 }. The stage_a_passed transition does not fire from rework_required.
  2. Re-dispatching test_engineer is refused again with the identical error.
  3. The remaining remedy in the error text is /swarm recover 1.1, which is not available to the architect.

The architect had no legal move left. In our run it stopped correctly (kept the deliverables, wrote a blocked report), but the run could not complete.

Where it happens

  • src/hooks/delegation-gate.ts (around line 4459): TASK_WORKFLOW_STAGE_A_REQUIRED for Stage B from a non-pre_check_passed state.
  • src/hooks/gate-evidence.ts (around lines 647-655): from rework_required the reducer requires a new coder mutation (TASK_WORKFLOW_CODER_MUTATION_REQUIRED), so a passing pre_check_batch alone does not advance the state.

Expected

One of:

  • a passing pre_check_batch from rework_required re-emits stage_a_passed so Stage B can be re-dispatched, or
  • an architect-facing repair tool (the analogue of approve_plan_critic / repair_gate_evidence) that performs what /swarm recover <task> does for this case, or
  • the error text stops recommending a command the architect cannot run.

Impact

A single tool-argument mistake by a subagent strands a task with correct, reviewed, passing code, and only a human can free it. For unattended runs this is a hard stop caused by state bookkeeping, not by the work.

Related: #2664 (Stage A attribution routes), #2703 (a gate with no recovery tool).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions