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

Use External termination condition to stop execution in AGS #4376

Open
Tracked by #4006
victordibia opened this issue Nov 26, 2024 · 0 comments
Open
Tracked by #4006

Use External termination condition to stop execution in AGS #4376

victordibia opened this issue Nov 26, 2024 · 0 comments
Assignees
Labels
proj-studio Related to AutoGen Studio.
Milestone

Comments

@victordibia
Copy link
Collaborator

victordibia commented Nov 26, 2024

What

Currently AGS uses a cancellation token to stop execution. This cancellation_token is not necessarily honored down the stack (I have seen scenarious where speaker selection logic continues even after cancellation token is cancelled).
The right way to stop execution would be to use an external termination condition.

How

  • Component factory .. can take an external_termination ExternalTermination arg (similar to input_func)
  • This external_termination if exisists is added to the termination condition as an or + . termination_condition = termination_condition | external_termination
  • AGS app (team_manager) and websocket connection provide this external_termination and then call external_termination.set() when a stop message is received, instead of invalidating a cancellation token.

This setup could also provide some infrascture to "pause" a run, where a pause is a stop with some timeout ...

  • stop message sent from UI
  • external termination condition is set ... a timeout starts on backend and front end
  • if a new message or resume message is sent within that timeout, team.run() is called again .. and things resume ...

cc: @ekzhu , @husseinmozannar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proj-studio Related to AutoGen Studio.
Projects
None yet
Development

No branches or pull requests

1 participant