Repository navigation
refactor(backend): one conductor — single Orchestrator class + 7 renames (#5040) - #5053
Merged
Merged
Conversation
…solidatedOrchestrator (#5040) MERGE PLAN SUMMARY: - EnhancedMultiAgentOrchestrator had 23 methods; 22 unique, 1 name-collision - Unique methods ported into ConsolidatedOrchestrator: create_workflow_plan, execute_workflow, _execute_single_agent_task, get_agent_recommendations, get_performance_report, _calculate_capability_coverage, _build_planning_prompt, _parse_planning_response, _evaluate_workflow_criteria, _handle_workflow_execution_success, _handle_workflow_execution_failure, _handle_task_timeout, _handle_task_exception, _coordinate_collaboration, _broadcast_to_agents, _update_workflow_performance_metrics, _publish_workflow_event, _get_agent_instance, _get_ma_strategy_handler, _ensure_ma_redis - Duplicate: _update_agent_performance — both classes had it but with different data structures (AgentProfile vs AgentPerformance). Ported version renamed to _update_task_agent_performance to preserve both behaviours unambiguously. - create_and_execute_workflow() convenience fn moved to orchestrator.py - enhanced_orchestration/__init__.py trimmed to re-exports only (<60 lines) - api/orchestration.py updated to use get_orchestrator_sync() instead of the removed enhanced_orchestrator module-level singleton - ResourceFactory.get_enhanced_orchestrator → get_orchestrator (with compat alias) cache key "enhanced_orchestrator" → "orchestrator" in get_all_cached_resources - All 34 orchestration tests pass Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…r (single conductor, #5040) - orchestrator.py: class renamed Orchestrator; ConsolidatedOrchestrator kept as backward-compat alias (= Orchestrator) so old imports still resolve - get_orchestrator_sync() return type annotation updated - __all__ updated: Orchestrator is primary export, ConsolidatedOrchestrator is compat alias - 12 test/e2e files updated: `from orchestrator import ConsolidatedOrchestrator as Orchestrator` → `from orchestrator import Orchestrator` (alias no longer needed, #5039) - dependencies.py: 4 occurrences updated - initialization/lifespan.py: docstring references updated - services/workflow_automation/manager.py: import updated - services/advanced_workflow/step_generator.py: type annotation updated - api/api_endpoint_migrations_test.py: test assertion updated for renamed class - All 34 orchestration tests pass Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…, subagent, loop, workflow, agent) (#5040) 1. SLMDeploymentOrchestrator → SLMDeploymentBridge File: deployment_orchestrator.py → deployment_bridge.py (old file is compat shim) Call-sites: api/slm/deployments.py, deployments_api_test.py updated to import from deployment_bridge; initialization/lifespan.py updated 2. DeploymentOrchestrator → DeploymentCoordinator In deployment_bridge.py; old name re-exported via compat alias in shim 3. SubagentOrchestrator → SubagentDispatcher File: subagent_orchestrator.py → subagent_dispatcher.py (old file is compat shim) get_subagent_orchestrator alias kept; test patching updated to target dispatcher 4. AutonomousLoopOrchestrator → AutonomousLoopRunner Same file; get_loop_orchestrator → get_loop_runner; callers in knowledge_rag.py and test_autonomous_loop.py updated via import alias 5. AdvancedWorkflowOrchestrator → WorkflowCoordinator File: orchestrator.py → coordinator.py (old file is compat shim) routes.py, __init__.py updated to import from coordinator directly 6. AgentOrchestrator → DistributedAgentCoordinator Same file (agents/agent_orchestration/coordinator.py); get_agent_orchestrator alias kept in __init__.py for a2a/task_executor.py and other callers All backward-compat shims ensure existing imports resolve without change. All 34 orchestration tests pass. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…trator (#5040, closes #5038, #5039) #5038: ResourceFactory.get_enhanced_orchestrator renamed to get_orchestrator - New primary method: ResourceFactory.get_orchestrator() - Backward-compat alias: get_enhanced_orchestrator() → calls get_orchestrator() - Cache key in get_all_cached_resources: "enhanced_orchestrator" → "orchestrator" - Module-level convenience get_orchestrator() updated to call get_orchestrator() These changes were applied in the Part A merge commit; this commit adds the MERGE_PLAN.md documentation artifact. #5039: Remove `from orchestrator import ConsolidatedOrchestrator as Orchestrator` aliases in 12 test files — now `from orchestrator import Orchestrator` directly. Applied in Part B rename commit. Full merge plan saved in MERGE_PLAN.md at worktree root. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…5040) - Delete 3 shim files: subagent_orchestrator.py, deployment_orchestrator.py, advanced_workflow/orchestrator.py - Remove alias imports in api/slm/deployments.py and deployments_api_test.py (DeploymentCoordinator/SLMDeploymentBridge used directly) - Rename module-level variable enhanced_orchestrator → orchestrator in api/orchestration.py (15 occurrences) - Remove ConsolidatedOrchestrator alias and __all__ entry from orchestrator.py - Remove AgentOrchestrator/get_agent_orchestrator aliases from agents/agent_orchestration/__init__.py - Remove AdvancedWorkflowOrchestrator alias from services/advanced_workflow/__init__.py - Remove get_enhanced_orchestrator BC method from utils/resource_factory.py - Update a2a/task_executor.py to import get_distributed_agent_coordinator directly - Update a2a/a2a_test.py mock stubs to use get_distributed_agent_coordinator - Rename test file to test_subagent_dispatcher_reflection.py; rename TestGetSubagentOrchestrator → TestGetSubagentDispatcher - Fix stale AgentOrchestrator docstrings in a2a/task_executor.py and a2a/tracing.py
…t_config (#5040) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced Apr 17, 2026
This was referenced Apr 17, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #5040, #5037, #5038, #5039
Subsumes PR #5027 (#4048) — close that PR in favor of this one.
The Rule
Before this PR, the codebase had 8 classes named `*Orchestrator`. After this PR, there is one `Orchestrator` class (the multi-agent conductor) plus 6 appropriately-named specialized coordinators/dispatchers/runners. Zero backward-compat aliases. Zero shim files.
Commits (reviewable independently)
Class rename table
Non-negotiables verified
✅ Zero functionality loss — all 22 unique methods from `EnhancedMultiAgentOrchestrator` ported to `Orchestrator`; all 6 specialized classes preserved behavior (rename-only).
✅ Function uniqueness — `grep -rn "ConsolidatedOrchestrator|EnhancedMultiAgentOrchestrator|SLMDeploymentOrchestrator|AutonomousLoopOrchestrator|AdvancedWorkflowOrchestrator|\bAgentOrchestrator\b|SubagentOrchestrator|\bDeploymentOrchestrator\b" autobot-backend/ --include="*.py"` returns only historical commit-message references in docstrings.
✅ Function reusability — duplicate `_update_agent_performance` resolved; shared logic lives in one place.
✅ *`grep -rn "^class.Orchestrator\b" autobot-backend/` shows exactly: `orchestrator.py:215:class Orchestrator:`
Test status
Breaking change
Any external consumer importing the old class names must update imports. No backward-compat shims provided — the conductor metaphor requires a clean surface.
🤖 Generated with Claude Code