kyegomez/swarms

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

Closed

#1,553 创建于 2026年4月21日

在 GitHub 查看
 (2 评论) (0 反应) (0 负责人)Python (948 fork)github user discovery
FEATenhancementgood first issue

仓库指标

Star
 (6,809 star)
PR 合并指标
 (PR 指标待抓取)

描述

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.

贡献者指南