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: Bug: Process Framework KernelProcessStep.on_activate is never called #9829

Closed
Druid-of-Luhn opened this issue Nov 26, 2024 · 3 comments · Fixed by #9839
Closed

Python: Bug: Process Framework KernelProcessStep.on_activate is never called #9829

Druid-of-Luhn opened this issue Nov 26, 2024 · 3 comments · Fixed by #9839
Assignees
Labels
bug Something isn't working processes python Pull requests for the Python Semantic Kernel

Comments

@Druid-of-Luhn
Copy link

Describe the bug

The abstract class KernelProcessStep has an on_activate method, which one would assume is called when the step is activated, but the method is never called.

To Reproduce

Steps to reproduce the behavior:

  1. Create a KernelProcessStep subclass that overrides the on_activate method,
  2. Put the step into a process,
  3. Run the process: the on_activate method is never called.

Expected behavior

The KernelProcessStep.on_activate method would be called when a step is activated, in both the local and Dapr runtimes. This would act as a form of zero-argument init method for when a step is activated.

Screenshots

Result of the code search showing that on_activate is never called.

Image

Platform

  • OS: Windows
  • IDE: gVim + PowerShell
  • Language: Python
  • Source: pip package version 1.16.0

Additional context

n/a

@Druid-of-Luhn Druid-of-Luhn added the bug Something isn't working label Nov 26, 2024
@markwallace-microsoft markwallace-microsoft added python Pull requests for the Python Semantic Kernel triage labels Nov 26, 2024
@github-actions github-actions bot changed the title Bug: Process Framework KernelProcessStep.on_activate is never called Python: Bug: Process Framework KernelProcessStep.on_activate is never called Nov 26, 2024
@evchaki
Copy link
Contributor

evchaki commented Nov 26, 2024

@eavanvalkenburg - can you take a look?

@evchaki
Copy link
Contributor

evchaki commented Nov 26, 2024

@Druid-of-Luhn - thanks for reporting this!

@eavanvalkenburg
Copy link
Member

@Druid-of-Luhn thanks for calling this out, turns out that was a leftover from a previous iteration, it was surpassed by the activate function that also sets up state, I have created a PR that removes it from both the KernelProcessStep and the sample.

@eavanvalkenburg eavanvalkenburg self-assigned this Nov 28, 2024
github-merge-queue bot pushed a commit that referenced this issue Nov 29, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
### Motivation and Context

<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
  1. Why is this change required?
  2. What problem does it solve?
  3. What scenario does it contribute to?
  4. If it fixes an open issue, please link to the issue here.
-->
Removes an outdated function `on_activate` from the KernelProcessStep
class and the one place it was overridden.

Fixes #9829 

### Description

<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->

### Contribution Checklist

<!-- Before submitting this PR, please make sure: -->

- [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 😄

Co-authored-by: Evan Mattson <[email protected]>
@eavanvalkenburg eavanvalkenburg moved this from Bug to Sprint: Done in Semantic Kernel Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working processes python Pull requests for the Python Semantic Kernel
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

6 participants