Skip to content

refactor(backend): one conductor — single Orchestrator class, rename 6 misnamed '*Orchestrator' classes #5040

Closed

Description

@mrveiss

The Rule

In an orchestra, there is only one conductor.

Today the codebase has 8 classes named `*Orchestrator`. Only one of them is actually THE orchestrator (the multi-agent conductor). The rest are specialized coordinators/dispatchers/runners that misappropriate the name, which (a) dilutes the concept and (b) makes it ambiguous which one callers should reach for.

Inventory

# Class File Actual role Action
1 `ConsolidatedOrchestrator` `autobot-backend/orchestrator.py` THE multi-agent conductor Rename → `Orchestrator`, absorb #2
2 `EnhancedMultiAgentOrchestrator` `autobot-backend/enhanced_orchestration/init.py` Duplicate multi-agent planner/executor Merge into #1, delete class
3 `SLMDeploymentOrchestrator` `services/slm/deployment_orchestrator.py` SLM deployment API bridge Rename → `SLMDeploymentBridge`
4 `DeploymentOrchestrator` same file Multi-node rollout tracker Rename → `DeploymentCoordinator`
5 `SubagentOrchestrator` `services/orchestration/subagent_orchestrator.py` Parallel subagent dispatcher Rename → `SubagentDispatcher`
6 `AutonomousLoopOrchestrator` `services/knowledge/autonomous_loop.py` Knowledge loop runner Rename → `AutonomousLoopRunner`
7 `AdvancedWorkflowOrchestrator` `services/advanced_workflow/orchestrator.py` Workflow intelligence coordinator Rename → `WorkflowCoordinator`
8 `AgentOrchestrator` `agents/agent_orchestration/coordinator.py` Distributed agent lifecycle Rename → `DistributedAgentCoordinator`

Also rename files that contain them (e.g., `services/slm/deployment_orchestrator.py` → `services/slm/deployment.py`; `services/advanced_workflow/orchestrator.py` → `services/advanced_workflow/coordinator.py`).

Non-negotiable requirements

  1. Zero functionality loss. Every public method on Docs improvements #1 and Docs improvements #2 must survive the merge. No behavior changes.
  2. Function uniqueness. When two classes have the same method (e.g., both Docs improvements #1 and Docs improvements #2 define `_update_agent_performance`), diff them, pick the canonical implementation, and deduplicate. Extract to a shared helper if both versions have value.
  3. Function reusability. Logic shared across multiple classes (agent-performance tracking, parallel execution patterns) should live in one place and be imported — not copy-pasted.

Method-overlap audit (confirmed duplicates between #1 and #2)

  • `_update_agent_performance` — defined in both
  • Agent coordination / workflow planning / performance tracking — overlapping conceptual surface

Out of scope (for now)

Acceptance criteria

  • Exactly one class named `Orchestrator` in `autobot-backend/` (grep check)
  • All other classes renamed per table above
  • All file renames applied
  • All 34+ importers updated
  • `pytest autobot-backend/tests/orchestration/` passes (34 tests)
  • `python -m py_compile` passes on every modified file
  • Zero `TODO`/commented-out code in the refactor

Subsumes

Related

Activity

  1. mrveiss commented on Apr 17, 2026

    @mrveiss
    OwnerAuthor

    ✅ Closed by PR #5053 (merged in 7b74d42).

    Acceptance criteria met:

    • ✅ Exactly ONE class named Orchestrator in autobot-backend/ — verified via grep '^class.*Orchestrator\b' returns only orchestrator.py:215:class Orchestrator:
    • ✅ All 6 specialized classes renamed (SLMDeploymentBridge, DeploymentCoordinator, SubagentDispatcher, AutonomousLoopRunner, WorkflowCoordinator, DistributedAgentCoordinator)
    • ✅ All 3 shim files deleted; all 10 as OldName alias imports removed
    • ✅ 34/34 orchestration tests pass
    • ✅ 22 unique methods from EnhancedMultiAgentOrchestrator ported — zero functionality loss
    • ✅ 35 call-sites updated

    Post-merge discoveries (filed as follow-ups, not closure blockers):

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions