Repository navigation
feat: delete bots and crews (daemon and protocol) - #54
Merged
Merged
Conversation
Archiving keeps the rows. Deleting removes the bot with its chat, approvals, the messages it received, its routines, browser sites and tasks, in one transaction; what it sent to other bots stays without a sender.
The methods, the bot.deleted and crew.deleted notifications, the fake daemon and the app store, which drops a deleted bot with its routines, tasks and deliveries.
bots.delete and crews.delete work on active and archived items (spec 7.6). The process is killed at once and the supervisor forgets the bot; the database loses the bot and what was its own; folders stay on disk (spec 5). Other bots are told about the unfinished tasks a deleted bot leaves, and a message of its that still waited arrives as from a deleted bot. The spec row that said archiving deletes the workspace was never true and now says what happens.
This was referenced Sep 30, 2026
httpsphl
added a commit
that referenced
this pull request
Sep 30, 2026
docs/spec.md: the browser's profile line keeps both changes: resting (this branch) and deleting a bot, which also closes the browser and deletes its profile (#54).
Merged
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.
What
Bots and crews could only be archived, which hides them and keeps everything. This adds deleting them for good: the daemon methods, the protocol and the app's store. The Delete entries in the menus, with the confirmation, come in the next PR, on top of this one.
bots.delete {botId}andcrews.delete {crewId}, for active and archived items. They answer{botId, crewId}and{crewId}, and every connected app hearsbot.deleted/crew.deleted.fromBotId: null). One that was still waiting in the queue arrives asfrom a deleted bot, without the "Reply with send_message" line, since there is nobody to answer.shared\and a chosen work folder stay. The slug stays taken, so a new bot of the same name getsname-2.FakeBotloftimplements both methods, and the store drops a deleted bot with its routines, tasks, deliveries and browser (the daemon sends no notification for each of those).Decisions
Taken with the owner before implementing:
Mine, open to change:
ON DELETE, so the store deletes or lets go of each reference in order. No migration.tasks.requester_bot_idandassignee_bot_idcannot be null, and a task with a side that no longer exists can never be completed. The notice tells the bot that is left.%USERPROFILE%\.claude\projects\) is not touched: it is not Botloft's. The spec says so.Tests
crates/botloft-store/src/delete/tests.rs: a bot takes what was its own, what it sent stays without a sender, a chain of tasks loses only the deleted link, a crew takes its bots and leaves other crews alone. Each checksPRAGMA foreign_key_check.crates/botloftd/tests/delete.rs, withFakeRuntime: the process is killed, the supervisor forgets the bot and does not start it again, the folder stays, later calls answer-32002; a waiting permission request lets go at once; a deleted chief; archived bots and crews; a crew with running bots, whose tokens stop working.crates/botloftd/tests/delete_messages.rs: the two task notices, and a message that waited arriving from a deleted bot.app/src/store/app.test.tswithFakeBotloft: the store afterbots.deleteandcrews.delete.cargo fmt,clippy -D warnings,cargo test --workspaceandpnpm checkpass.Still to see with real Claude Code
bots.deleteover the RPC, or from the app once the next PR is in):claude.exeand what it started are gone from Task Manager, nothing starts it again, and the bot's folder is as it was.msedge.exeof that bot ends and%LOCALAPPDATA%\Botloft\browsers\<bot_id>is removed a few seconds later.