Commit Graph

1 Commits

Author SHA1 Message Date
Chiguyong 81a35dac27 feat(experts): U4 TeamOrchestrator parallel independent subtasks (R1-R5)
Add explicit support for parallel execution of dependency-free subtasks:
- TeamPlan.get_independent_subtasks(): returns phases with depends_on==[]
  (introspection entry — topological_sort already groups them in layer 0)
- TeamOrchestrator.MAX_INDEPENDENT_SUBTASKS=10: aligns with router.MAX_EXPERTS
- _rebalance_independent_subtasks(): when Lead over-decomposes (>10
  independent subtasks), re-decompose once with merge hint. Fallbacks:
  no gateway → keep original; LLM error → keep original; single-phase
  fallback → keep original (don't collapse 11→1); still over → return
  new (MAX_PHASES truncation handles it)

Tests: 15 new tests covering get_independent_subtasks, topological_sort
layer contract, SharedWorkspace path uniqueness, rebalance (5 paths),
and full execute() integration. Existing TeamOrchestrator tests pass.
2026-07-06 13:43:31 +08:00