fix(chat): allow administrator to delete channel-only sessions

Align administrator session deletion with the administrator chat view so
sessions surfaced through channel_session_v2 can be removed without a
ui_session_owner row.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
oliver 2026-07-21 16:55:51 +08:00
parent 4f36f4a36f
commit e3828418d4
5 changed files with 93 additions and 4 deletions

View file

@ -1666,6 +1666,15 @@ class SqliteStore(ScheduledJobStoreMixin):
session_id=session_id, username=username, tenant_id=tenant_id
)
def delete_session_for_administrator_chat_view(
self, *, session_id: str, username: str, tenant_id: str
) -> bool:
return self._chat_sessions_repo().try_delete_chat_session_for_administrator_chat_view(
session_id=session_id,
username=username,
tenant_id=tenant_id,
)
def get_session_for_administrator_username(
self, *, session_id: str, username: str
) -> Optional[ChatSession]: