Skip to content

fix(recovery): restore Reset Harness Data action on plugin recovery view - #135

Closed
yaojin3616 wants to merge 1 commit into
mainfrom
fix/plugin-recovery-reset-data
Closed

fix(recovery): restore Reset Harness Data action on plugin recovery view#135
yaojin3616 wants to merge 1 commit into
mainfrom
fix/plugin-recovery-reset-data

Conversation

@yaojin3616

Copy link
Copy Markdown
Contributor

背景

#81 中为 Harness 启动失败对话框添加了「重置数据」按钮,后来 #94 引入更完善的 plugin-recovery.html 恢复页面时该选项被遗漏。当 startup failure 命中的是内置/无法识别的插件(例如 failed to import loader entry 48a498a7 (@deepseek-ai/dsh-cordis-client-runner): client-modules: bundle script ... failed to load)时,resolveProfileRecoveryPlugins 返回空数组,恢复页面只剩下「打开 Harness 日志」和「退出」,用户只能手动删除 harness 目录才能恢复 — 与 #69 截图里显示的状态一致。

主要改动

  • src/main/plugin-recovery-view.ts:当 canUninstall === false 时,把主操作从「打开 Harness 日志」改为「重置 Harness 数据」,新增 canResetData / resetLabel / resetBusyLabel / resetDetail / resetSafetyNote 字段
  • src/main/index.ts:新增 reset-data 动作,调用 resetHarnessData()(重命名 harness 目录到带时间戳的备份,再创建新目录),并重新启动 Harness;新增 resetHarnessData() 复用 fix: add Reset Harness Data recovery option for startup failures #81 中的实现
  • build/plugin-recovery.html:主按钮在没有可卸载插件时导航到 dsh-recovery://reset-data
  • test/plugin-recovery-view.test.ts:更新原有断言,新增中文/英文场景覆盖 canResetData 切换与按钮文案

验证

  • npm test:plugin-recovery / plugin-recovery-view / plugin-recovery-html / plugin-recovery-detection 共 35 个用例通过
  • npm run typecheck:通过
  • npm run build:通过
  • git diff --check:无空白问题

Closes #69

The 'Reset Data' option originally added in #81 was lost when the
plugin-recovery view replaced the simple dialog in #94. When a
third-party plugin cannot be identified as the cause of a startup
failure (e.g. a built-in core plugin reports 'failed to import loader
entry ...'), the user is left without a self-service recovery path
and must manually delete the harness directory.

This change re-exposes 'Reset Harness data' as the primary action
when no removable plugin is identified. It backs up the current
harness directory, recreates a clean working folder, and retries
startup automatically. The action is hidden when a removable
third-party plugin is offered instead.

Closes #69
@yaojin3616 yaojin3616 closed this Aug 21, 2026
@yaojin3616
yaojin3616 deleted the fix/plugin-recovery-reset-data branch August 21, 2026 08:49
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.

插件不兼容导致GUI界面崩溃,一直无法启动。

1 participant