Skip to content

feat(chats): add archive and delete actions#3032

Open
LittleChenLiya wants to merge 13 commits into
bytedance:mainfrom
LittleChenLiya:fix/issue-3027-delete-chat-threads
Open

feat(chats): add archive and delete actions#3032
LittleChenLiya wants to merge 13 commits into
bytedance:mainfrom
LittleChenLiya:fix/issue-3027-delete-chat-threads

Conversation

@LittleChenLiya
Copy link
Copy Markdown
Collaborator

@LittleChenLiya LittleChenLiya commented May 18, 2026

问题原因

Issue #3027 需要对历史对话提供清理能力;但直接删除会让对话彻底消失,不适合只想隐藏但保留记录的用户。

修改内容

  • 新增对话归档能力,默认历史列表不显示已归档对话。
  • 左侧最近对话菜单只保留归档入口,避免在侧边栏误删。
  • 对话管理页支持归档/已归档视图、复选多选、全选、Shift 范围选择,以及批量归档/恢复/删除。
  • 批量删除前增加确认弹窗,删除后对话彻底移除。

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

  • Add chat archive support, with archived chats hidden from the default history list.
  • Keep only Archive in the left recent-chat menu to avoid accidental deletion from the sidebar.
  • Add active/archived views, checkbox multi-select, Select all, Shift range selection, and batch archive/restore/delete on the chats management page.
  • Add a confirmation dialog before batch deletion, after which selected chats are permanently removed.

@LittleChenLiya LittleChenLiya requested a review from Copilot May 26, 2026 02:52
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 useDeleteThread to 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).

Comment thread frontend/src/core/threads/hooks.ts Outdated
Comment thread backend/app/gateway/routers/threads.py
Comment thread backend/app/gateway/routers/threads.py
Comment thread backend/app/gateway/routers/threads.py Outdated
Comment thread backend/packages/harness/deerflow/runtime/runs/store/memory.py Outdated
Comment thread frontend/tests/e2e/utils/mock-api.ts Outdated
@LittleChenLiya LittleChenLiya changed the title feat(threads): allow deleting chat threads feat(chats): add archive and delete actions May 27, 2026
@LittleChenLiya LittleChenLiya requested a review from Copilot May 27, 2026 05:40
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 21 out of 21 changed files in this pull request and generated 6 comments.

Comment thread frontend/src/core/threads/hooks.ts
Comment thread frontend/src/components/workspace/recent-chat-list.tsx
Comment thread frontend/src/components/workspace/recent-chat-list.tsx
Comment thread frontend/src/app/workspace/chats/page.tsx Outdated
Comment thread frontend/src/app/workspace/chats/page.tsx Outdated
Comment thread backend/packages/harness/deerflow/runtime/runs/store/memory.py Outdated
@LittleChenLiya LittleChenLiya force-pushed the fix/issue-3027-delete-chat-threads branch from e3d9410 to 346fbdb Compare May 27, 2026 05:48
@LittleChenLiya LittleChenLiya requested a review from Copilot May 27, 2026 05:50
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 21 out of 21 changed files in this pull request and generated 4 comments.

Comment thread frontend/src/app/workspace/chats/page.tsx Outdated
Comment thread frontend/src/app/workspace/chats/page.tsx Outdated
Comment thread backend/packages/harness/deerflow/runtime/runs/store/memory.py Outdated
Comment thread backend/packages/harness/deerflow/persistence/run/sql.py Outdated
@LittleChenLiya LittleChenLiya requested a review from Copilot May 27, 2026 06:24
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 22 out of 22 changed files in this pull request and generated 7 comments.

Comment thread frontend/src/core/threads/hooks.ts
Comment thread frontend/src/core/threads/hooks.ts Outdated
Comment thread frontend/src/core/threads/hooks.ts Outdated
Comment thread frontend/src/app/workspace/chats/page.tsx
Comment thread frontend/src/app/workspace/chats/page.tsx
Comment thread frontend/tests/e2e/thread-history.spec.ts Outdated
Comment thread backend/packages/harness/deerflow/runtime/runs/store/memory.py Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add ability to delete individual chat threads from the UI

2 participants