Files
semantic-kernel/python/semantic_kernel/processes
K. Andrew Parker d91c96d4e1 Python: resolving #10642 - public events fail to propagate (#10643)
### 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

- [X] The code builds clean without any errors or warnings
- [X] The PR follows the [SK Contribution
Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [X] All unit tests pass, and I have added new tests where possible
- [X] I didn't break anyone 😄
2025-02-25 21:17:58 +00:00
..