Skip to content

fix(coderd/x/chatd): archive chat hard-interrupts active stream#23758

Merged
ethanndickson merged 2 commits intomainfrom
archive-interrupts-stream
Mar 31, 2026
Merged

fix(coderd/x/chatd): archive chat hard-interrupts active stream#23758
ethanndickson merged 2 commits intomainfrom
archive-interrupts-stream

Conversation

@ethanndickson
Copy link
Copy Markdown
Member

@ethanndickson ethanndickson commented Mar 30, 2026

Archiving a chat now transitions pending or running chats to waiting before setting the archived flag. This publishes a status notification on ChatStreamNotifyChannel so subscribeChatControl cancels the active processChat context via ErrInterrupted — the same codepath used by the stop button.

The processChat cleanup also skips queued-message auto-promotion when the chat is archived, so archiving behaves like a hard stop rather than interrupt-and-continue.

Relates to #23666

@ethanndickson ethanndickson changed the title fix(coderd/chatd): archive chat hard-interrupts active stream fix(coderd/x/chatd): archive chat hard-interrupts active stream Mar 30, 2026
@ethanndickson ethanndickson changed the title fix(coderd/x/chatd): archive chat hard-interrupts active stream fix(coderd): archive chat hard-interrupts active stream Mar 30, 2026
Archiving a chat now transitions pending or running chats to waiting
before setting the archived flag. This publishes a status notification
on ChatStreamNotifyChannel so subscribeChatControl cancels the active
processChat context via ErrInterrupted — the same codepath used by the
stop button.

The processChat cleanup also skips queued-message auto-promotion when
the chat is archived, so archiving behaves like a hard stop rather
than interrupt-and-continue.
isPendingOrRunningChatStatus was removed on main. Inline the
equivalent check directly in ArchiveChat.
@ethanndickson ethanndickson force-pushed the archive-interrupts-stream branch from ae01fdb to 9c5f120 Compare March 30, 2026 02:19
@ethanndickson ethanndickson changed the title fix(coderd): archive chat hard-interrupts active stream fix(coderd/x/chatd): archive chat hard-interrupts active stream Mar 30, 2026
@ethanndickson ethanndickson marked this pull request as ready for review March 30, 2026 02:19
@ibetitsmike
Copy link
Copy Markdown
Collaborator

Archiving an active stream should imho display a confirmation dialog in the UI.

@ethanndickson
Copy link
Copy Markdown
Member Author

Archiving an active stream should imho display a confirmation dialog in the UI.

Will do in a separate PR

@ethanndickson ethanndickson merged commit bbf3fbc into main Mar 31, 2026
32 of 35 checks passed
@ethanndickson ethanndickson deleted the archive-interrupts-stream branch March 31, 2026 13:23
@github-actions github-actions bot locked and limited conversation to collaborators Mar 31, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants