Disable New Chat during a run - #4581
Merged
Merged
Conversation
nelsonkopliku
force-pushed
the
disable-new-chat-while-streaming
branch
from
August 5, 2026 15:29
54cc464 to
1b2c18c
Compare
nelsonkopliku
requested review from
antgamdia,
arbulu89 and
gagandeepb
and
a lite review from Copilot
August 5, 2026 15:29
Contributor
There was a problem hiding this comment.
Pull request overview
This PR prevents starting a new conversation while an assistant run is still in flight by disabling the “New chat” button during active runs. It aligns the header behavior with the existing “run in progress” UX (e.g., spinner/progress and composer locking), avoiding the confusing “Thinking…” state on an empty/new thread while the prior run is still settling.
Changes:
- Add an
isRunningprop toChatHeaderand disable “New chat” whenisRunningis true. - Plumb
isRunningfromAssistantThreadintoChatHeader. - Add/extend unit and integration coverage (ChatHeader, AssistantThread, AG-UI event flow) plus Storybook controls/examples.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| assets/js/common/AIAssistant/ChatHeader/ChatHeader.jsx | Disable “New chat” when a run is active via new isRunning prop. |
| assets/js/common/AIAssistant/AssistantThread.jsx | Pass isRunning through to the header. |
| assets/js/common/AIAssistant/ChatHeader/ChatHeader.test.jsx | Add unit test ensuring “New chat” is disabled during a run. |
| assets/js/common/AIAssistant/AssistantThread.test.jsx | Add test that “New chat” is locked while answering. |
| assets/js/common/AIAssistant/AgUiEventFlow.test.jsx | Add integration test verifying “New chat” stays locked for the run duration. |
| assets/js/common/AIAssistant/ChatHeader/ChatHeader.stories.jsx | Add Storybook control and a “Running” story for the new state. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
antgamdia
approved these changes
Aug 5, 2026
antgamdia
left a comment
Contributor
There was a problem hiding this comment.
Thanks! This will prevent impatient users from clicking it and losing the chat context 😅
nelsonkopliku
added a commit
that referenced
this pull request
Aug 7, 2026
Stop in the composer becomes the only way to end a run; "New chat" is reachable only when the thread is idle. This restores #4581, which this branch had reverted. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
nelsonkopliku
added a commit
that referenced
this pull request
Aug 7, 2026
Stop in the composer becomes the only way to end a run; "New chat" is reachable only when the thread is idle. This restores #4581, which this branch had reverted. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
nelsonkopliku
added a commit
that referenced
this pull request
Aug 10, 2026
Stop in the composer becomes the only way to end a run; "New chat" is reachable only when the thread is idle. This restores #4581, which this branch had reverted. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR makes sure that during a run the "New Chat" button is disabled in chat header.
This prevents seeing a "Thinking" spinner on a new chat until the previous run actually finishes.
I am opening this because the more complete cancellation feature at #4563 requires some more love and it is currently lower prio.
Current solution prevents weird situations at least.
How was this tested?
Automated and IRL