Skip to content

Add ability to register Agent instances #6131

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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

peterychang
Copy link
Collaborator

@peterychang peterychang commented Mar 27, 2025

Why are these changes needed?

Nice to have functionality

Related issue number

Closes #6060

Checks

Copy link

codecov bot commented Mar 27, 2025

Codecov Report

Attention: Patch coverage is 79.12088% with 19 lines in your changes missing coverage. Please review.

Project coverage is 77.32%. Comparing base (20753ad) to head (edf4414).
Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
...kages/autogen-core/src/autogen_core/_base_agent.py 69.44% 11 Missing ⚠️
...t/src/autogen_ext/runtimes/grpc/_worker_runtime.py 84.61% 4 Missing ⚠️
...src/autogen_core/_single_threaded_agent_runtime.py 90.00% 2 Missing ⚠️
...n/packages/autogen-core/src/autogen_core/_agent.py 50.00% 1 Missing ⚠️
...es/autogen-core/src/autogen_core/_agent_runtime.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6131      +/-   ##
==========================================
+ Coverage   77.08%   77.32%   +0.23%     
==========================================
  Files         197      197              
  Lines       13637    13863     +226     
==========================================
+ Hits        10512    10719     +207     
- Misses       3125     3144      +19     
Flag Coverage Δ
unittests 77.32% <79.12%> (+0.23%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can add a few tests for the case of successful registration of instances and then

  1. send_message to the registered agent, successfully respond with a reply.
  2. publish_message to a topic subscribed by the agent, successfully observed a state change in the agent itself.

@@ -17,6 +17,10 @@ def id(self) -> AgentId:
"""ID of the agent."""
...

async def init(self, **kwargs: Any) -> None:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
async def init(self, **kwargs: Any) -> None:
async def bind_id_and_runtime(self, id: AgentId, runtime: AgentRuntime) -> None:

I think we shoud make this a concrete call otherwise it is unclear how or why it would be used

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow registration of instances instead of factories
3 participants