Let a conversation be deleted, and its thread with it - #197
Open
CristianPeralta wants to merge 1 commit into
Open
Let a conversation be deleted, and its thread with it#197CristianPeralta wants to merge 1 commit into
CristianPeralta wants to merge 1 commit into
Conversation
Nothing removed a channel, so the roster only ever grew (CopilotKit#196). Adds DELETE /api/channels/:channelId: the channel row, its memberships, agent links, and thread mapping go through the FK cascades that already existed for them, and the deployment asks Intelligence to permanently delete the thread itself. The local delete commits first. A rejected or unreachable upstream thread delete is non-fatal and leaves the channel gone from the roster either way, with an audit row (channel.deleted) naming the thread and whether Intelligence actually forgot it - a channel gone locally with an orphaned thread is a smaller, more honest failure than one still sitting in the roster with its history silently wiped. Removal fans out over the existing channel_activity NOTIFY topic so other open tabs see it live. The sidebar row gets an options menu with a two-button confirm dialog (new alert-dialog.tsx, wrapping @base-ui/react/alert-dialog).
CristianPeralta
requested review from
MikeRyanDev,
davidmckayv,
guidovizoso and
tylerslaton
as code owners
August 23, 2026 12:40
Author
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.



Closes #196.
What this changes
Adds
DELETE /api/channels/:channelId. Deletes the channel row, which cascades its memberships, agent links, and Intelligence thread mapping (no migration needed, those FKs already cascade). Also asks Intelligence to permanently delete the thread.Local delete commits first. A failed or unreachable thread delete is non-fatal: the channel is gone from the roster either way, with an audit row naming the thread and whether Intelligence actually forgot it.
Sidebar gets an options menu on each row, with a confirm dialog (new
alert-dialog.tsx, wraps@base-ui/react/alert-dialog, already a dependency).Where it runs
pg_notifyfires inside it on commit, and every replica's own LISTEN connection fans it out to its own sockets.deleted: trueon the existingchannel_activitytopic.Boundary and audit
channel.deletedaudit row on every delete, including a failed upstream thread delete.agentIdsent to Intelligence is derived server-side (channel:<id>), never accepted from the client.Changelog
Added under Unreleased.
Proof
bun run format:check lint typecheck testall pass. Tested manually against a local stack: delete with confirm dialog, deleting the open channel redirects, two tabs stay in sync, audit row shows up.