Repository navigation
feat: clear all BotHarness data from Settings and the CLI - #2429
Merged
Merged
Conversation
Settings → Data & privacy → Clear all BotHarness data, and the matching `deepseekbot data-reset-preview` / `data-reset-confirm` commands, preview every folder that is removed ($DSH_HOME/botharness, the bundled IM Provider folders, ~/.botharness) and what stays (DSH credentials, Memory folders a Human chose, exports), then require a second confirmation. Confirming stops BotHarness writing, records a reset marker and restarts the Host; the folders are removed while the old process exits, or at the next Host start when it cannot restart itself. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017Bj3xgpNLb4rSz519tNeFh
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 9 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Requested by Vain · project thread
Why the change
Uninstalling the plugin leaves the database, Bots, Memory and IM settings on disk, so a reinstall brings the old Bots back; users need a way to start fresh.
Closes #2426
Special things to note
dataResetPlanremoves and keeps (packages/core/src/data-reset/reset.ts), and the exit-time / next-start removal.vitest relatedfor the diff (3544 passed;workspace-grant-roundtripfails identically onmainwithCannot bundle node:sqlite),pnpm lint,format:check,typecheck. On an isolated Host (verify-app,DSH_HOME=/tmp/bh-verify-reset): cleared once from the UI and once from the CLI; each time the Host restarted itself, the old Tob andbotharness/,integrations/dsh-feishuand~/.botharnesswere gone,.credentials.yamlkept the same md5, and a reused token was refused withdata-reset-preview-stale. Not run: Windows (locked files fall back to the next-start removal), a Host withoutappExit(restart-requiredpath covered by unit tests only).Change outline
data-reset/reset.ts:preview()lists existing targets with size and file count ($DSH_HOME/botharness, bundled IM Provider folders under$DSH_HOME/integrations,~/.botharness) and what stays (DSH.credentials.yaml, Memory folders a Human chose, even inside a removed folder, andBotHarness Exports).confirm(token)writes$DSH_HOME/botharness-reset.json, closes the operational database, then restarts throughappExit; the folders are removed while the old process exits, and again at the next start (applyPendingDataReset, first thing inapply()) if anything is left or the Host could not restart.dataResetPreview,dataResetConfirm.deepseekbot data-reset-preview,data-reset-confirm --confirmation-stdin --confirm(token on stdin, likebot-delete-confirm); documented indocs/bot-cli*.md.DangerTextButton,FormDialog(danger) andCallout, matching the Bot deletion dialog. DSH sessions, DSH settings and other plugins are not touched.Data & privacy — 1440 × 900
Before — the page had only backup and usage statistics. After — a new “Clear all BotHarness data” row.
Preview and second confirmation
The button stays disabled until the checkbox is ticked.
After confirming
Generated by Claude Code