Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR simplifies the agent system by removing the name parameter from the @serve decorator and refactoring the AgentRegistry from a class-based to an instance-based approach with module-level convenience functions.
- Removed
nameparameter from@servedecorator, now using class name directly - Refactored
AgentRegistryfrom static class methods to instance methods with a global default instance - Added comprehensive unit tests for the new registry system
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| python/valuecell/examples/core_e2e_demo.py | Removed name parameters from @Serve decorators and reduced sleep time |
| python/valuecell/core/agent/tests/test_registry.py | Added comprehensive test suite for the new AgentRegistry system |
| python/valuecell/core/agent/registry.py | Refactored from class methods to instance methods with convenience functions |
| python/valuecell/core/agent/decorator.py | Updated to use register_agent function and removed name parameter handling |
| python/valuecell/core/agent/connect.py | Updated imports to use new registry convenience functions |
| python/valuecell/core/agent/README.md | Updated documentation to remove name parameter examples |
| .github/workflows/python.yml | Added unit test job to CI workflow |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| assert len(unregistered) == 2 | ||
| assert "Test_1" in unregistered | ||
| assert "Test_2" in unregistered | ||
| # Note: Since TestAgent1 was unregistered by "Test_1", "Other" is also removed |
There was a problem hiding this comment.
This comment and the changed expectation suggest a potential misunderstanding of the unregister behavior. The comment should clearly explain why 'Other' is removed when unregistering by pattern 'Test', as this might not be intuitive to readers.
Suggested change
| # Note: Since TestAgent1 was unregistered by "Test_1", "Other" is also removed | |
| # Note: In this registry implementation, unregistering any key for a class removes all keys for that class. | |
| # Therefore, since "Test_1" (registered to TestAgent1) is unregistered, all keys for TestAgent1, including "Other", are also removed. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.
No description provided.