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

Stop chat if there's a user abort #526

Merged

Conversation

rhennigan
Copy link
Member

@rhennigan rhennigan commented Jan 8, 2024

When a user triggers an abort (e.g. using alt-. or the evaluation menu), the asynchronous task would previously keep running, displaying new chat output. However, the code to finalize the chat output had been cancelled, so the cell remained in in an active state even when finished.

This update changes the behavior associated with user aborts that are issued during chat evaluation by immediately evaluating the "StopChat" action. Now a user abort is effectively equivalent to hitting the red "X" button to stop a chat in progress.

This also introduces a new handler function "ChatAbort", which will run during the stop chat cleanup step.

Before

ChatAbortBefore

After

ChatAbortAfter

@rhennigan rhennigan linked an issue Jan 8, 2024 that may be closed by this pull request
@rhennigan rhennigan merged commit 2f85da8 into main Jan 8, 2024
1 check passed
@rhennigan rhennigan deleted the 380-chat-task-should-be-cleaned-up-if-theres-a-user-abort branch January 8, 2024 19:08
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.

Chat task should be cleaned up if there's a user abort
1 participant