Repository navigation
Studio: delete a chat's uploaded documents when the chat is deleted - #11233
Conversation
|
@codex review |
1 similar comment
|
@codex review |
…ts tests Delete a thread's archived turns and uploaded documents from one loop so the recreated-thread cutoff is decided once, pin multi-document, index-row and cross-chat isolation in the cleanup tests, and generalize the shared scope-deletion docstrings.
|
Thanks, the fix is right. I pushed one small follow-up commit (a58ee27) on top:
No behavior change beyond the original PR. |
|
Codex review on a staging copy of this PR (at a58ee27): Didn't find any major issues. Lyxot#58 (comment) |
Lyxot
left a comment
There was a problem hiding this comment.
LGTM. Deleting a chat, clearing all chats, or deleting a project now removes that chat's uploads (rows, index entries and the stored file), scoped to the chat and confined to the uploads root. Merges cleanly with current main and the related backend tests pass; the two CI failures are unrelated (runner missing browser libs, MoE LoRA test).
|
Confirmed that on main routes/chat_history.py only clears archived turns on delete, so a chat's uploads stay in rag.db and under the uploads root and keep listing in the Data settings; the scoping and the recreated-thread cutoff here look right, will get this reviewed. |
…nslothai#11233) * Studio: remove a chat's uploaded documents when the chat is deleted * refactor(studio): fold thread RAG cleanup into one pass and tighten its tests Delete a thread's archived turns and uploaded documents from one loop so the recreated-thread cutoff is decided once, pin multi-document, index-row and cross-chat isolation in the cleanup tests, and generalize the shared scope-deletion docstrings. --------- Co-authored-by: Lyxot <[email protected]>
Documents added with Chat with Files stayed on disk and in the database after their chat was deleted. They kept showing up under Settings > Data > Uploaded files, pointing at a chat that no longer existed. Clear all chats left them behind too.
Deleting a chat, Clear all chats and deleting a project now also remove the documents that belonged to those chats, including the stored file. Documents in other chats are not touched.
Tested in Studio with two chats that each had a document. Before, both documents stayed after deleting a chat and after Clear all chats. After, only the deleted chat's document is removed, and Clear all chats leaves nothing behind.