Repository navigation
Delete chat attachments no chat references any more - #736
Open
devin-ai-integration[bot] wants to merge 10 commits into
Open
devin-ai-integration[bot] wants to merge 10 commits into
devin-ai-integration[bot] wants to merge 10 commits into
Conversation
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Contributor
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
… removal Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Contributor
[Medium impact] The PR appears safe to merge; no new actionable issues were found. SummaryThis PR removes attachment files after chat or project deletion when no remaining chat references them.
The previous-review commit and current head have different merge bases with the target commit, so this review used the full PR diff.
|
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Contributor
Author
|
@greptileai review |
…a-dir moves Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Contributor
Author
|
@greptileai review |
…achments-are-never-deleted Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> # Conflicts: # src/commands/up.rs
Contributor
Author
|
@greptileai review |
This branch has not been deployed
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.
Fixes OR-574. No linked contributor PR existed, so this starts from
main.Summary
data_dir/chat-attachments/att-<uuid>__<name>folder, and neitherChatHost::delete_sessionnor thedelete_projectroute touched it.Store::chat_attachment_ids(session_id)collects theatt-<uuid>ids (followed by__) thatchat_messages,chat_turns.prepared_inputandchat_queued_messagesmention, for one chat or for all.remove_unreferenced_attachments(store, dir, deleted)removes files no remaining row mentions:orx upbackground task (at startup, then hourly, off the async workers and skipped during a data-dir move): every unreferenced file older than one hour, which reclaims existing orphans. The hour spares a send in flight, which saves its file before recording the message.att-<uuid>__namefile name keeps that file alive (errs toward keeping data).Bug reproduction on
mainAttach an image in a real Codex chat, get a reply, delete the chat: the file stays in
chat-attachments.Post-fix check (Linux, real Codex, rebuilt at 003a2d3)
Two image chats → deleting the first removes only its file; deleting the project removes the second; another project's attachment is untouched. Project delete used the new dialog from #690 with artifact removal left unchecked (the default).
Test plan
cargo fmt --check,cargo clippy --locked --all-targets -- -D warnings,cargo build --lockedcargo test --locked: newdeleting_a_chat_removes_only_its_unreferenced_attachmentscovers message/turn/queue references, shared-file preservation, deleted-chat removal and the age-gated sweep. The 3local::projects::testsgit-identity tests fail identically on unmodifiedmainon this VM (global git identity) and pass in CI.003a2d31, after mergingmain(recording above).Automation improvements
scripts/dev-slot.mjsrequires exactly onemainworktree even with--worktree; the blueprint should create one (e.g.git worktree add ../OpenResearch-main main) so testing on a PR branch doesn't stall.Link to Devin session: https://app.devin.ai/sessions/30dc8b28ff4448968d819277bde14641
Open in Devin Desktop: https://app.devin.ai/desktop/session/30dc8b28ff4448968d819277bde14641?variant=devin