You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Deleting a thread deletes the attachments its forks still show #30017
A fork shows its source's earlier turns by reading them from the source thread. When the source is deleted, the server queues an attachment.cleanup for every attachment in the source's messages, and the files are removed. The fork's inherited turns then show broken images and files.
Steps to reproduce (main cefb544af3)
Send a prompt with an image attached (any provider that accepts images).
Fork the thread from the reply.
Delete the original thread.
Open the fork. The inherited prompt's image no longer loads, and its file is gone from userdata/attachments.
Expected
Deleting a thread leaves the fork's history intact, including its attachments. The files go when the last thread that can show them is deleted.
Where
planThreadDeletion (apps/server/src/orchestration-v2/ThreadDeletion.ts) gets its ids from getThreadAttachmentIds, which lists the deleted thread's own files without checking for live forks that read through it. Project delete (ProjectService.ts) uses the same read.
I have a fix with a failing-first test, proven on web and Android. I can open a PR if you want one.
changed the title [-]Deleting a thread deletes the attachments its forks still show[/-][+][Bug]: Deleting a thread deletes the attachments its forks still show[/+]on Nov 3, 2026
Activity
[-]Deleting a thread deletes the attachments its forks still show[/-][+][Bug]: Deleting a thread deletes the attachments its forks still show[/+]Entrpi commentedon Nov 3, 2026
The fix is on our fork as one commit on top of
main(cefb544):8ee2934(compare).It includes the failing test in
ThreadFork.execution.test.ts, which fails onmainfor this reason. Happy to open it as a PR if you want it.