feat(chats): add archive and delete actions#3032
Open
LittleChenLiya wants to merge 13 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds end-to-end thread deletion support from the chats list, and extends backend thread deletion to clean up associated persisted data (runs, events, feedback) with stronger failure signaling when thread metadata deletion fails.
Changes:
- Frontend: add a delete action to the chats list UI and update E2E mocks/tests to support deleting threads.
- Frontend hook: adjust
useDeleteThreadto conditionally call the LangGraph delete endpoint based on env. - Backend: on thread delete, also delete run events / feedback / runs by thread, and add repositories/store APIs + tests for
delete_by_thread.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/tests/e2e/utils/mock-api.ts | Adds mock route for backend thread deletion and makes mock threads mutable. |
| frontend/tests/e2e/thread-history.spec.ts | Adds E2E coverage for deleting a thread from the chats list page. |
| frontend/src/core/threads/hooks.ts | Updates delete mutation to optionally call LangGraph delete depending on env. |
| frontend/src/app/workspace/chats/page.tsx | Adds “More” menu + Delete action per thread row (non-static mode). |
| backend/tests/test_threads_router.py | Adds tests asserting run/feedback/run_store cleanup and 500 on meta-delete failure. |
| backend/tests/test_run_repository.py | Adds delete_by_thread tests for SQL run repository. |
| backend/tests/test_persistence_scaffold.py | Adds scaffold tests for delete_by_thread across stores. |
| backend/tests/test_feedback.py | Adds delete_by_thread tests for SQL feedback repository. |
| backend/tests/_router_auth_helpers.py | Extends auth test helper to include thread_store.delete AsyncMock. |
| backend/packages/harness/deerflow/runtime/runs/store/memory.py | Implements in-memory delete_by_thread for runs. |
| backend/packages/harness/deerflow/runtime/runs/store/base.py | Adds abstract delete_by_thread contract for runs store. |
| backend/packages/harness/deerflow/runtime/events/store/memory.py | Extends event store delete APIs to accept user_id kwarg. |
| backend/packages/harness/deerflow/runtime/events/store/jsonl.py | Extends JSONL event store delete APIs to accept user_id kwarg. |
| backend/packages/harness/deerflow/runtime/events/store/base.py | Updates abstract method signatures to include optional user_id. |
| backend/packages/harness/deerflow/persistence/run/sql.py | Implements SQL delete_by_thread for runs with optional owner filter. |
| backend/packages/harness/deerflow/persistence/feedback/sql.py | Implements SQL delete_by_thread for feedback with optional owner filter. |
| backend/app/gateway/routers/threads.py | Deletes events/feedback/runs by thread; makes thread metadata delete a hard failure (500). |
e3d9410 to
346fbdb
Compare
…-chat-threads # Conflicts: # backend/packages/harness/deerflow/runtime/events/store/jsonl.py
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.
问题原因
Issue #3027 需要对历史对话提供清理能力;但直接删除会让对话彻底消失,不适合只想隐藏但保留记录的用户。
修改内容
Closes #3027
Problem Cause
Issue #3027 asks for a way to clean up chat history. Direct deletion permanently removes a chat, which does not fit users who only want to hide a chat while keeping it available later.
Changes