Abandon the server-side thread when a new chat starts - #4650
Open
nelsonkopliku wants to merge 3 commits into
Open
Abandon the server-side thread when a new chat starts#4650nelsonkopliku wants to merge 3 commits into
nelsonkopliku wants to merge 3 commits into
Conversation
This was referenced Aug 19, 2026
nelsonkopliku
force-pushed
the
abandon-thread-on-new-chat
branch
from
August 19, 2026 12:18
0367c85 to
279c65a
Compare
nelsonkopliku
force-pushed
the
abandon-thread-on-new-chat
branch
from
August 20, 2026 12:44
279c65a to
9790d42
Compare
nelsonkopliku
force-pushed
the
abandon-thread-on-new-chat
branch
from
August 20, 2026 14:03
9790d42 to
dea0ab3
Compare
nelsonkopliku
force-pushed
the
abandon-thread-on-new-chat
branch
from
August 20, 2026 14:11
dea0ab3 to
2906839
Compare
nelsonkopliku
force-pushed
the
abandon-thread-on-new-chat
branch
from
August 24, 2026 08:06
2906839 to
34fa21d
Compare
nelsonkopliku
force-pushed
the
abandon-thread-on-new-chat
branch
2 times, most recently
from
August 24, 2026 14:29
713925c to
8271bc3
Compare
nelsonkopliku
requested review from
gagandeepb
and
a balanced review from Copilot
August 24, 2026 14:33
nelsonkopliku
marked this pull request as ready for review
August 24, 2026 14:33
Contributor
There was a problem hiding this comment.
Pull request overview
Adds client-side thread abandonment when starting a new chat, allowing the server to stop the previous Agent.
Changes:
- Adds
abandonThread()transport support. - Filters stale run lifecycle events.
- Wires abandonment into thread changes with expanded tests.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
assets/js/lib/ai/WebSocketAIAgent.js |
Adds abandonment and stale-event filtering. |
assets/js/lib/ai/WebSocketAIAgent.test.js |
Tests abandonment and stale events. |
assets/js/common/AIAssistant/AssistantChatProvider.jsx |
Abandons the previous thread on reset. |
assets/js/common/AIAssistant/AssistantChatProvider.test.jsx |
Verifies provider behavior. |
assets/js/common/AIAssistant/AIAssistant.test.jsx |
Verifies fresh conversations after reopening. |
assets/js/common/AIAssistant/AgUiEventFlow.test.jsx |
Verifies old messages are cleared. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
nelsonkopliku
force-pushed
the
abandon-thread-on-new-chat
branch
from
August 24, 2026 15:07
8271bc3 to
e678ec3
Compare
nelsonkopliku
force-pushed
the
abandon-thread-on-new-chat
branch
from
August 25, 2026 06:51
e678ec3 to
a1f1484
Compare
nelsonkopliku
force-pushed
the
abandon-thread-on-new-chat
branch
from
August 25, 2026 08:40
a1f1484 to
400f0f0
Compare
… when threadId changes the thread is abandoned
nelsonkopliku
force-pushed
the
abandon-thread-on-new-chat
branch
from
August 25, 2026 09:00
400f0f0 to
ad8913a
Compare
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 introduces the ability to issue an
abandon_threadmessage from the client so that the server can clean up the related running Agent.The action is wired on "New Chat" button in chat header, that means that when a user starts a new chat, not only the client will be reset to a fresh state, but contextually the server will be told to stop any previous running Agent.
How was this tested?
Automated and IRL.