Skip to content

[feat][hiearchical_swarm][mid-flight replanning on judge rejection] #1553

@kyegomez

Description

@kyegomez

Problem

Today when the judge rejects a director's plan in HierarchicalSwarm, the swarm just loops the same plan. There is no way for the director to adapt — issue new subtasks, reassign failed ones to different workers, or change the decomposition.

Proposed feature

When the judge returns a rejection (or a low score), the director should be able to:

  • Issue brand-new subtasks based on the judge's feedback
  • Reassign specific failed subtasks to different workers
  • Modify the dependency order between existing subtasks

Rather than restarting the whole plan, the director does an incremental replan informed by what went wrong.

Design sketch

  • Judge verdict schema grows a feedback field (already partially present) and a failed_subtasks: List[str] list.
  • On REVISE, the director is called with the original plan, the judge feedback, and the per-subtask results; it returns a ReplanAction (ADD / REASSIGN / REORDER / DROP).
  • The swarm applies the action and re-runs only the affected subtasks.

Files

  • swarms/structs/hiearchical_swarm.py

Why

Closes the feedback loop — the judge verdict currently has no way to actually drive adaptation. This is the biggest quality lift available for hierarchical runs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions