Skip to content

Delete a chat - #36

Merged
vitramir merged 1 commit into
mainfrom
feat/delete-chat
Aug 13, 2026
Merged

vitramir merged 1 commit into
mainfrom
feat/delete-chat

Conversation

@vitramir

Copy link
Copy Markdown
Contributor

Adds DeleteChat: archives the thread through Threads, then marks the chat record deleted (that order, so a half-failure leaves a visible-but-frozen chat rather than a hidden one agents keep writing into). Idempotent.

A deleted chat drops out of GetChats; UpdateChat and GetMessages resolve it as NOT_FOUND. Authorization is delegated to Threads.ArchiveThread — any participant, or an organization owner.

Migration 0003 adds deleted_at and narrows the list index to live rows.

Spec: changes/2026-08-13-chat-deletion.md · needs agynio/api#189 (merged)

A conversation, once created, was permanent -- Resolved is a lifecycle
state, not a disposal, so every mistaken chat stayed in the list forever.

DeleteChat archives the thread through Threads, then marks the chat record
deleted. That order matters: if the second step fails the chat is still
listed but frozen and a retry closes the gap, where the reverse would leave
a chat hidden from its participants that agents keep writing into. Deleting
an already-deleted chat reports success, so a client retrying after a
timeout does not see a failure for work that landed.

A deleted chat drops out of GetChats, and UpdateChat and GetMessages resolve
it as NOT_FOUND -- the GetMessages refusal is how a client holding a stale
link learns the conversation is gone. It is not an access boundary: the
messages stay in Threads and the Console still finds the archived thread.

Authorization is delegated to Threads.ArchiveThread, which already admits
exactly the identities the product calls for -- any participant, or an
organization owner.

See agynio/architecture: changes/2026-08-13-chat-deletion.md
@vitramir
vitramir merged commit 1f213b8 into main Aug 13, 2026
1 check passed
@vitramir
vitramir deleted the feat/delete-chat branch August 13, 2026 17:38
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.

1 participant