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: ensure that runs are stopped when switch threads #407

Merged
merged 1 commit into from
Sep 4, 2024

Conversation

thedadams
Copy link
Contributor

This change will ensure that currently running gptscript runs are stopped when switching threads. Additionally, this change removes the redundant selectedThreadId state because it is the same as thread.

Finally, we stop displaying the "run aborted" errors to the user because it isn't really an error: the user has chosen to abort the run.

Copy link
Contributor

@StrongMonkey StrongMonkey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

@@ -296,8 +294,8 @@ const ChatContextProvider: React.FC<ChatContextProps> = ({
debounce(async () => {
// Here we specifically update Thread with selectedThreadId so that when it restarts it restarts with the specific thread.
// We don't set thread directly after creating because it will re-render the page once thread is created on the fly
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can probably remove this comment too

Copy link
Contributor Author

@thedadams thedadams Sep 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. Done.

This change will ensure that currently running gptscript runs are
stopped when switching threads. Additionally, this change removes the
redundant selectedThreadId state because it is the same as thread.

Finally, we stop displaying the "run aborted" errors to the user because
it isn't really an error: the user has chosen to abort the run.

Signed-off-by: Donnie Adams <[email protected]>
@thedadams thedadams force-pushed the stop-run-on-thread-change branch from 5d4401b to ace0718 Compare September 4, 2024 12:10
@thedadams thedadams merged commit c108356 into gptscript-ai:main Sep 4, 2024
1 check passed
@thedadams thedadams deleted the stop-run-on-thread-change branch September 4, 2024 12:14
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.

3 participants