Merged
Conversation
This class was actually used as an abstract factory for BuilderContext, the old name was misleading
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the factory and builder architecture to support multi-agent workflows with conditional entry points. The main changes replace the abstract BaseAgentFactory with a more flexible, composition-based ContextFactory that accepts pluggable factory functions for all components.
Key changes:
- Replaced
BaseAgentFactorywithContextFactorythat uses composition over inheritance for pluggable components - Added
MultiAgentContextandMultiAgentDirectorto enable conditional entry point routing based on anactive_agentstate field - Updated the datetime builder prompt to include an internal-use notice
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| assistant_core/factories.py | Replaced abstract BaseAgentFactory with composition-based ContextFactory and added deprecation wrapper |
| assistant_core/builder/context.py | Added create() and clone() methods to BuilderContext, introduced MultiAgentContext for multi-agent workflows |
| assistant_core/builder/agent.py | Added MultiAgentDirector to manage multi-agent workflows with conditional entry points |
| assistant_core/builder/init.py | Exported new MultiAgent and MultiAgentContext classes |
| assistant_core/state.py | Added MultiAgentState with active_agent field for agent selection |
| assistant_core/builder/datetime.py | Updated date prompt with "CONTEXT:" prefix and internal-use notice |
| tests/conftest.py | Updated fixtures to use ContextFactory instead of BaseAgentFactory |
| tests/unit/test_builder_context.py | Added comprehensive tests for new BuilderContext and MultiAgentContext functionality |
| tests/unit/test_builder.py | Added tests for MultiAgent director behavior and entrypoint mapping |
| tests/unit/test_datetime_builder.py | Updated tests to match new datetime prompt format |
| CHANGELOG.md | Documented the breaking changes and new features |
| .github/copilot-instructions.md | Added guidance to prefer Poetry for running tests |
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.
Description
Add MultiAgent support to existing builders
Improve BuilderContext management
Type of change
Checklist
Please run through the checklist and mark the items off before requesting review.