Skip to content
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

Python: resolving #10642 - public events fail to propagate #10643

Merged

Conversation

drdrew42
Copy link
Contributor

@drdrew42 drdrew42 commented Feb 22, 2025

Motivation and Context

Resolves #10642 -- failure of KernelProcessEventVisibility.Public events to propagate.

Description

First, KernelProcessEvent was configured to use enum values -- though throughout the code, KernelProcessEvent.visibility is compared as an enum.

Second, when handling events emitted by a KernelProcessStep, any Public visibility events are/were passed through LocalStep.scoped_event (which modifies the event's namespace) before queueing up any matching edges on the source step. This change to the event namespace effectively prevents the event from propagating (since I don't know how we'd 'listen' for events on the local process handle from within the function that builds that very process...)

Allowing visibility on KernelProcessEvent to be an enum, combined with an exchange in the order of processing event messages (matching event to edge before re-emitting any events marked as 'Public') causes public events to propagate as expected.

Contribution Checklist

@drdrew42 drdrew42 requested a review from a team as a code owner February 22, 2025 20:28

Choose a reason for hiding this comment

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

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (2)

python/semantic_kernel/processes/local_runtime/local_process.py:137

  • The parameter was misspelled as 'factorie'; it has been corrected to 'factories' for consistency.
factorie=self.factories,

python/semantic_kernel/processes/local_runtime/local_process.py:233

  • [nitpick] The duplicate loop for enqueuing messages from a step event was removed, ensuring that each event is enqueued only once. Verify that this change preserves the intended order of processing before the event's namespace is modified.
for edge in step.get_edge_for_event(step_event.id):
@alliscode alliscode added this pull request to the merge queue Feb 25, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 25, 2025
@alliscode alliscode added this pull request to the merge queue Feb 25, 2025
Merged via the queue into microsoft:main with commit d91c96d Feb 25, 2025
28 checks passed
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.

Python: Bug: Multiple KernelProcessEventVisibility related issues
3 participants