feat: add thread deletion (MCP tool + REST API + web UI)#5
Merged
Killea merged 2 commits intoKillea:mainfrom Feb 28, 2026
Merged
feat: add thread deletion (MCP tool + REST API + web UI)#5Killea merged 2 commits intoKillea:mainfrom
Killea merged 2 commits intoKillea:mainfrom
Conversation
Permanently delete a thread and all its messages via MCP tool,
REST API, and the web console UI.
- CRUD: thread_delete() with cascade (messages first), single transaction,
rollback on error, returns audit dict {thread_id, topic, message_count}
- MCP tool: thread_delete with confirm=true safeguard; description explicitly
warns vs thread_archive for reversible removal
- REST API: DELETE /api/threads/{thread_id} returns {ok, deleted} with audit info
- Web UI: Delete button in context menu (destructive red styling, visual separator),
native <dialog> showing topic + message count, SSE handler for thread.deleted
clears active pane when current thread is deleted
- Tests: 9 unit tests covering CRUD behaviour, MCP dispatch, confirm guard
Made-with: Cursor
Killea
added a commit
that referenced
this pull request
Feb 28, 2026
- Delete duplicate thread_delete function in crud.py (old version returning bool) - Delete duplicate api_thread_delete function in main.py (old version with simple response) - Keep only PR #5 versions that return full audit information - Resolve function redefinition conflicts from merge
Killea
added a commit
that referenced
this pull request
Feb 28, 2026
…NewMessages - Delete incorrect return window.AcbChat.selectThread() call that was causing ReferenceError - Delete duplicate loadNewMessages function that was trying to call window.AcbChat.loadNewMessages - Restore proper function structure: selectThread and loadNewMessages should directly implement functionality - Resolve merge conflict from PR #5 that introduced these invalid calls
Killea
added a commit
that referenced
this pull request
Feb 28, 2026
… calls - Fix selectThread: remove nested loadNewMessages function, make it independent - Fix sendMessage: implement directly instead of calling window.AcbChat.sendMessage - Fix handleKey: implement directly instead of calling window.AcbChat.handleKey - Fix refreshAgents: implement directly instead of calling window.AcbAgents.refreshAgents - Remove all erroneous window.Acb* calls that were causing ReferenceError - Resolve merge conflict issues from PR #5 that introduced duplicate/invalid function structures
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.
Summary
Adds the ability to permanently delete a thread and all its messages,
consistently across all interaction surfaces.
Currently, threads can only be archived or closed (reversible). This PR
adds irreversible deletion for clean-up use cases (test threads, accidental
threads, stale content).
Changes
src/db/crud.py—thread_delete(){thread_id, topic, message_count}orNoneif not foundthread.deletedSSE eventsrc/mcp_server.py—thread_deletetoolconfirm: trueparameter (safeguard against accidental deletion)thread_archivefor reversible removalsrc/tools/dispatch.py—handle_thread_delete()confirm != truesrc/main.py—DELETE /api/threads/{thread_id}{ok: true, deleted: {thread_id, topic, message_count}}src/static/index.html— Web UI<hr>)<dialog>confirmation showing topic + message countthread.deletedclears active message paneDesign Notes
confirm=trueon MCP tool: Standard MCP pattern for destructive actions,prevents accidental deletion by AI agents that auto-call tools.
<dialog>: No external deps, accessible, keyboard-navigable.(messages → thread) is safer and more portable.
Test
End-to-end (HTTP):