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

fix: auto acknowledge assistant events #2330

Open
wants to merge 4 commits into
base: autoack
Choose a base branch
from

Conversation

WilliamBergamin
Copy link
Contributor

Summary

MEGRE #2329 FIRST!

Since #2283 event requests are no longer auto acknowledged in the processEvent function. This behavior was handed over to the autoAcknowledge middleware. This PR aims to add auto acknowledge behavior back into the assistant event handlers.

Requirements

@WilliamBergamin WilliamBergamin added the bug M-T: confirmed bug report. Issues are confirmed when the reproduction steps are documented label Nov 11, 2024
@WilliamBergamin WilliamBergamin self-assigned this Nov 11, 2024
Copy link

codecov bot commented Nov 11, 2024

Codecov Report

Attention: Patch coverage is 89.33333% with 8 lines in your changes missing coverage. Please review.

Project coverage is 91.04%. Comparing base (2f25b21) to head (51eaa89).
Report is 2 commits behind head on autoack.

Files with missing lines Patch % Lines
src/Assistant.ts 87.87% 8 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           autoack    #2330      +/-   ##
===========================================
- Coverage    91.08%   91.04%   -0.05%     
===========================================
  Files           22       22              
  Lines         6116     6140      +24     
  Branches       655      666      +11     
===========================================
+ Hits          5571     5590      +19     
- Misses         540      545       +5     
  Partials         5        5              

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

@misscoded
Copy link
Contributor

misscoded commented Nov 11, 2024

I'm going on record (again) to say that I really am not a fan of this approach. The function listener is the only one that requires a special case of opt-out for ack. AFAIK (and correct me if I'm wrong) this delayed ack is not applicable to the Assistant class, nor presumably other classes that follow a similar, instance-based event handling manner, and we're introducing code just to accommodate it.

If my assumption above is incorrect and the delayed ack is applicable across the board, then I stand corrected and this seems like a suitable approach.

If accurate, then it would be better IMO to introduce an option (similar to the opt-out of JIT function tokens) that is specific and limited to function listeners receiving the ability to ack manually.

@filmaj
Copy link
Contributor

filmaj commented Nov 12, 2024

If accurate, then it would be better IMO to introduce an option (similar to the opt-out of JIT function tokens) that is specific and limited to function listeners receiving the ability to ack manually.

If we were to follow the JIT token opt-out approach, this would result in auto-ack being a global option, applying to all custom functions or none. I don't like this suggestion as it would force developers who have existing custom functions that answer to function_executed events to need to change their code (add an explicit ack).

I'm not married to any particular implementation, but I do feel like the auto-ack feature should be implemented in a way so as to enable per-function granularity. If the middleware based approach is unacceptable, then let's revert it and go back to the drawing board.

@WilliamBergamin
Copy link
Contributor Author

WilliamBergamin commented Nov 13, 2024

I've introduced some changes that fix the bugs brought by #2283 to the assistant handlers. These changes were taken from the behavior of Bolt-Python and aim to align the python and js architectures

@WilliamBergamin WilliamBergamin changed the base branch from main to autoack November 13, 2024 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug M-T: confirmed bug report. Issues are confirmed when the reproduction steps are documented
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants