-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
feat!: Add message context to signature of intervention handler, add more to docs #4882
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4882 +/- ##
==========================================
- Coverage 68.21% 68.18% -0.03%
==========================================
Files 158 158
Lines 9960 9967 +7
==========================================
+ Hits 6794 6796 +2
- Misses 3166 3171 +5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
Copilot reviewed 5 out of 7 changed files in this pull request and generated no comments.
Files not reviewed (2)
- python/packages/autogen-core/docs/src/user-guide/core-user-guide/cookbook/termination-with-intervention.ipynb: Evaluated as low risk
- python/packages/autogen-core/docs/src/user-guide/core-user-guide/cookbook/tool-use-with-intervention.ipynb: Evaluated as low risk
@@ -506,7 +515,14 @@ async def _process_next(self) -> None: | |||
"intercept", handler.__class__.__name__, parent=message_envelope.metadata | |||
): | |||
try: | |||
temp_message = await handler.on_publish(message, sender=sender) | |||
message_context = MessageContext( |
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.
Looks like some missing tests to make sure the runtime actually invokes the intervention handlers?
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.
The publish_message code path is missing test.
Breaking:
on_publish
andon_send
method in theInterventionHandler
class to include amessage_context
parameter instead of anAgentId
parameter.Closes #4003
Related #4349