feat(team): implement multi-agent collaboration foundation — TeamManager, AgentMessageBus, SharedWorkspace, and WorkflowEngine coordinator#93
Open
Deepak-negi11 wants to merge 2 commits into
Conversation
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.
Summary
Closes #76
The current architecture only supports single-agent and sub-agent workflows.
This PR introduces the foundational layer for team-based multi-agent
collaboration — a
TeamManager, an isolatedAgentMessageBus, aSharedWorkspace, and aWorkflowEnginecoordinator — wired intoAgentLoopvia a newSummonTeamTool.Architecture
New Modules
core/src/team/manager.rsTeamManager— orchestrates active teams by ID and memory pathsteam.rsAgentTeam— binds specialized agent roles (DevAgent,RevAgent,ArchAgent) with shared contextbus.rsAgentMessageBus— isolated internal event bus for team communication, does not pollute primary output channelsworkspace.rsSharedWorkspace— synchronized resource for sharing artifacts, code patches, and design documents across all agents in a teamworkflow.rsWorkflowEngine— coordinator that tracks the state machine for multi-agent chains (e.g. Architect → Dev → Reviewer)core/src/skills/multi_agent.rsMultiAgentSkill— encapsulates the logic of launching a full collaborative team instead of a single sub-agent loopcore/src/tools/team_tools.rsSummonTeamTool— LLM-callable tool that taps intoMultiAgentSkillto delegate complex tasks toTeamManagerModified Files
core/src/agent/loop_.rs— Addedregister_team_tools()so themain
AgentLoopcan summon a full agent team via tool call. Wires thepath:
AgentLoop → SkillsManager → MultiAgentSkill → TeamManagercore/src/lib.rs— Exportedpub mod teamandpub mod skillsDesign Decisions
AgentMessageBus is isolated, not reusing
crate::bus::MessageBusThe team bus is a private channel exclusively for intra-team events
(
CodeReviewed,CodePushed,ArchitectureVoted). Reusing the globalMessageBuswould leak team-internal events into user-facing outputchannels.
Specialized agents use varied system prompts and tools, not distinct types
DevAgent,RevAgent, andArchAgentare role configurations over astandard
AgentLooprather than separate types. This keeps the agentsurface area small and avoids duplicating loop logic across three parallel
type hierarchies.
Incremental delivery — foundation only
This PR delivers the architectural skeleton. Full end-to-end task
delegation across a live team is a follow-up. The foundation is wired
correctly so subsequent PRs can add behavior without restructuring.
Testing
test_team_manager_builds_teamTeamManagercorrectly constructs a team with all three rolestest_agent_message_bus_dispatchtest_workflow_engine_transitionsWorkflowEnginetransitions through standard multi-agent statesManual verification path:
Answers to Open Questions from #76
WorkflowEnginenatively or use mofa-sdk StateGraph?workflow.rs— keeps team orchestration self-contained and avoids coupling to SDK internalsAgentLoop— avoids type duplicationAgentMessageBusreuse global bus or isolated?Related
(MessageGraph contract first, execution second)
WorkflowEngineinworkflow.rsis intentionally compatible with theexisting
StateGraphexecution model for future unification