-
Notifications
You must be signed in to change notification settings - Fork 1.6k
refactor: remove serve decorator name field for simplicity and AgentRegistry #15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: remove serve decorator name field for simplicity and AgentRegistry #15
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
Copilot
AI
Sep 11, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
| # 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>
No description provided.