Skip to content

A team of long-lived bots for DeepSeek Harness, with main bots, bot-to-bot messages and group chats.

Tell a data folder that is gone from an unexpected failure

AdamPlatin123b96e24b59b7d
diff --git a/app/src/start-window.mjs b/app/src/start-window.mjs
index f60b044c..8cab7d66 100644
--- a/app/src/start-window.mjs
+++ b/app/src/start-window.mjs
@@ -188,8 +188,10 @@ export function handoffBox(whale, { start, team, viewportWidth }) {
// sends it about 0.72 s after ready on a celebrating hand-off and 0.22 s otherwise (start-window §8).
export const fallbackMs = ({ start, celebrate }) => (start === 'first' || celebrate ? 2500 : 800)
-// The five reasons of the failure page (windows-onboarding §3), most specific first: a Host
-// that stopped says so and carries its own error output, which names the cause.
+// The reasons of the failure page (windows-onboarding §3), most specific first: a Host that
+// stopped says so and carries its own error output, which names the cause. A folder of the data's
+// that is not there (a drive that is gone) is 'missing', after the program's own files.
+const MISSING = /ENOENT: no such file or directory, (?:mkdir|open|access|stat|lstat|scandir|opendir|rename|copyfile) /u
const REASONS = [
['permission', /\b(?:EACCES|EPERM)\b|permission denied|operation not permitted|access is denied/iu],
['space', /\b(?:ENOSPC|EDQUOT)\b|no space left|not enough space|disk (?:is )?full/iu],
@@ -207,7 +209,7 @@ function missingOwnFile(error, text, program) {
/**
* @param {{ program?: string[] }} where `program`: the folders of the app's own files
- * @returns {'permission' | 'space' | 'files' | 'engine' | 'other'}
+ * @returns {'permission' | 'space' | 'files' | 'engine' | 'missing' | 'other'}
*/
export function failureReason(error, { program = [] } = {}) {
const code = typeof error?.code === 'string' ? error.code : ''
@@ -216,7 +218,7 @@ export function failureReason(error, { program = [] } = {}) {
for (const [reason, pattern] of REASONS) {
if (pattern.test(text) || (reason === 'files' && missingOwnFile(error, text, program))) return reason
}
- return 'other'
+ return MISSING.test(text) ? 'missing' : 'other'
}
// The Main Bot that a kept team's sidebar shows first (ds-bot's channel.js: mainBotIds[0]; an
diff --git a/app/src/start/text.mjs b/app/src/start/text.mjs
index 3c1374be..c247ef8b 100644
--- a/app/src/start/text.mjs
+++ b/app/src/start/text.mjs
@@ -82,11 +82,13 @@ export const TEXT = {
'reason.start.files': '程序文件不完整,可能被杀毒软件拦掉了一部分。',
'reason.start.engine': '本机引擎启动到一半停下了。',
'reason.start.other': '出了点意外。',
+ 'reason.start.missing': '找不到放数据的文件夹,可能是移动硬盘没插上。',
'card.failed.do.permission': '换一个能写入的位置,或者给这个文件夹写入权限后重试。',
'card.failed.do.space': '清理出一些空间后重试,或者换个位置。',
'card.failed.do.files': '重新安装 DeepSeek Bot 后再打开。',
'card.failed.do.engine': '先重试一次;还不行,就复制详细信息去反馈。',
'card.failed.do.other': '先重试一次;还不行,就复制详细信息去反馈。',
+ 'card.failed.do.missing': '插上那块硬盘,或者把文件夹放回原处后重试。',
'reason.copy.inUse': '文件被别的程序占用',
'reason.copy.permission': '没有权限读取',
'reason.copy.full': '磁盘满了',
@@ -262,11 +264,13 @@ export const TEXT = {
'reason.start.files': 'Program files are incomplete; antivirus software may have blocked some of them.',
'reason.start.engine': 'The local engine stopped halfway through starting.',
'reason.start.other': 'Something unexpected happened.',
+ 'reason.start.missing': 'The data folder can’t be found; the external drive may be unplugged.',
'card.failed.do.permission': 'Pick a place you can write to, or allow writing to this folder and try again.',
'card.failed.do.space': 'Free up some space and try again, or pick another place.',
'card.failed.do.files': 'Reinstall DeepSeek Bot and open it again.',
'card.failed.do.engine': 'Try again; if it still fails, copy the details and report it.',
'card.failed.do.other': 'Try again; if it still fails, copy the details and report it.',
+ 'card.failed.do.missing': 'Plug the drive back in, or put the folder back, and try again.',
'reason.copy.inUse': 'a file is in use by another program',
'reason.copy.permission': 'no permission to read',
'reason.copy.full': 'the disk is full',
diff --git a/app/test/start-page.test.mjs b/app/test/start-page.test.mjs
index 9e73362e..c720df10 100644
--- a/app/test/start-page.test.mjs
+++ b/app/test/start-page.test.mjs
@@ -217,7 +217,7 @@ const recovers = (card, kind) => {
test('the failure page says what happened, what to do for each reason, and folds out the log', () => {
const card = cardOf('failed')
assert.match(card, /<p class="lead" data-t="reason\.start\.\{reason\}"><\/p><p class="small do" data-t="card\.failed\.do\.\{reason\}"><\/p>/u)
- for (const reason of ['permission', 'space', 'files', 'engine', 'other']) assert.ok(`card.failed.do.${reason}` in TEXT.zh, reason)
+ for (const reason of ['permission', 'space', 'files', 'engine', 'missing', 'other']) assert.ok(`card.failed.do.${reason}` in TEXT.zh, reason)
assert.match(card, /data-act="retry" data-main/u)
recovers(card, 'failed')
})
@@ -356,7 +356,7 @@ test('every text key that the page uses exists', () => {
}
// Keys the page builds from the snapshot's views, the stages and the failure reasons.
for (const key of ['voice.failed', 'voice.viewFailed', 'voice.watchdog', 'status.phase.data', 'status.phase.import', 'status.phase.engine', 'status.phase.team', 'status.state.pending', 'status.state.active', 'status.state.done', 'status.state.failed']) assert.ok(key in TEXT.zh, key)
- assert.deepEqual(matching('reason.start.{reason}').sort(), ['reason.start.engine', 'reason.start.files', 'reason.start.other', 'reason.start.permission', 'reason.start.space'])
+ assert.deepEqual(matching('reason.start.{reason}').sort(), ['reason.start.engine', 'reason.start.files', 'reason.start.missing', 'reason.start.other', 'reason.start.permission', 'reason.start.space'])
assert.deepEqual(matching('reason.place.{reason}').sort(), ['reason.place.drive', 'reason.place.dsh', 'reason.place.foreign', 'reason.place.nested', 'reason.place.onedrive', 'reason.place.permission', 'reason.place.program', 'reason.place.space', 'reason.place.workspace'])
assert.deepEqual(matching('reason.copy.{reason}').sort(), ['reason.copy.full', 'reason.copy.inUse', 'reason.copy.other', 'reason.copy.permission'])
})
diff --git a/app/test/start-window.test.mjs b/app/test/start-window.test.mjs
index 68574111..b959f8c7 100644
--- a/app/test/start-window.test.mjs
+++ b/app/test/start-window.test.mjs
@@ -50,7 +50,7 @@ test('the team window shows by itself after 2.5 s on a first start or a celebrat
assert.equal(fallbackMs({ start: 'later', celebrate: false }), 800)
})
-test('a failure gets one of the five reasons of the failure page', () => {
+test('a failure gets one of the six reasons of the failure page', () => {
const coded = (code, message) => Object.assign(new Error(message), { code })
assert.equal(failureReason(coded('EACCES', 'EACCES: permission denied, mkdir \'D:\\data\\profiles\'')), 'permission')
assert.equal(failureReason(new Error('EPERM: operation not permitted, open \'x\'')), 'permission')
@@ -73,9 +73,9 @@ test('only a missing file of the app\'s own says that the install is incomplete'
const exe = join(program, 'DeepSeek Bot.exe')
assert.equal(failureReason(missing(exe, `spawn ${exe} ENOENT`), where), 'files')
assert.equal(failureReason(missing(exe, `spawn ${exe} ENOENT`)), 'other')
- // A saved data folder on a drive that is gone.
+ // A saved data folder on a drive that is gone: its own reason, with what to do about it.
const data = join(tmpdir(), 'gone', 'DeepSeek Bot', 'data', 'profiles', 'ds-bot')
- assert.equal(failureReason(missing(data, `ENOENT: no such file or directory, mkdir '${data}'`), where), 'other')
+ assert.equal(failureReason(missing(data, `ENOENT: no such file or directory, mkdir '${data}'`), where), 'missing')
// A Host that stopped: its error output names the missing file.
const bundle = join(program, 'resources', 'app.asar.unpacked', 'node_modules', 'x', 'index.js')
assert.equal(failureReason(new Error(`The DSH Host stopped (exit 1):\nError: ENOENT: no such file or directory, open '${bundle}'`), where), 'files')
diff --git a/docs/plans/2026-10-26-start-window.md b/docs/plans/2026-10-26-start-window.md
index 762f5f66..b8460d3a 100644
--- a/docs/plans/2026-10-26-start-window.md
+++ b/docs/plans/2026-10-26-start-window.md
@@ -230,7 +230,7 @@
- 鲸鱼的话立刻换成「DeepSeek Bot 没能启动」,写在圆环和卡片之间(第 2 节),读屏读出这一句。
- 鲸鱼换成失败的姿势(第 3 节),卡住的那段弧变红,不画叉:失败只靠鲸鱼的姿势、红的那段弧和这一句。
- 提示行淡出。
- - 纸面变成恢复卡:一句发生了什么(原因)、一句该怎么办(小字,按原因写:没有写入权限「换一个能写入的位置,或者给这个文件夹写入权限后重试。」,空间不够「清理出一些空间后重试,或者换个位置。」,程序文件不完整「重新安装 DeepSeek Bot 后再打开。」,引擎停下和其他「先重试一次;还不行,就复制详细信息去反馈。」)、五个按钮、「详细信息」。卡片没有鲸鱼的第一行。数据文件夹建不出来、写不进去时红的是第一段,引擎起不来或者 Host 退出时红的是引擎那段。水塘缩小上移,圆环在卡片上面(第 2 节)。
+ - 纸面变成恢复卡:一句发生了什么(原因)、一句该怎么办(小字,按原因写:没有写入权限「换一个能写入的位置,或者给这个文件夹写入权限后重试。」,空间不够「清理出一些空间后重试,或者换个位置。」,程序文件不完整「重新安装 DeepSeek Bot 后再打开。」,找不到放数据的文件夹(移动硬盘没插上)「插上那块硬盘,或者把文件夹放回原处后重试。」,引擎停下和其他「先重试一次;还不行,就复制详细信息去反馈。」)、五个按钮、「详细信息」。卡片没有鲸鱼的第一行。数据文件夹建不出来、写不进去时红的是第一段,引擎起不来或者 Host 退出时红的是引擎那段。水塘缩小上移,圆环在卡片上面(第 2 节)。
- 焦点移到〔重试〕。窗口不隐藏。
- 〔复制详细信息〕点过后,按钮上的字变成「已复制」,1.6 秒后变回来。复制的是版本、平台、原因和最后 200 行日志。
- 〔保存日志…〕打开挂在启动窗口上的系统保存框(默认文件名 `DeepSeek-Bot-log.txt`),把同样的开头和最后 5000 行日志写进选的文件;取消就什么都不做。失败页、「团队界面没有加载出来」、180 秒的卡和复制失败的卡上都有这两个按钮,代替原来的〔打开日志文件夹〕。「详细信息」最多展开 168 px,日志在框里滚动。
@@ -413,6 +413,7 @@
- 2026-11-01(待维护者确认):动画只有一个来源。启动窗口的卡片和团队窗口里代替系统对话框的卡片(`app/src/page-card.css`)用同一组颜色和弹簧,都由 `scripts/start-assets.mjs` 从插件的 `themes.js` 和 `motion.js` 生成:卡片出现走 `SPRING_SHAPE`,收起用启动窗口卡片的退场(下沉 6 px、缩到 .975、模糊 3px,.16 s),减少动态效果时只淡入 .12 s、淡出 .16 s(第 9 节)。导入的几张卡(第 6 节)由主进程的 `import-flow.mjs` 发快照,页面照旧只按快照画。
- 2026-11-01 交接的露面:在桌面应用里录了交接(真的 Electron 44、真的 `StartWindow`、替身团队页、ffmpeg 60 帧录屏),看到三个问题:长大用 `cubic-bezier(.2,.7,.2,1)`,前 40% 就走完了大半,窗口很早看着就长完了,鲸鱼落下后在一大块空的深色窗口里等 200 多毫秒;主窗口用 `show()` 露面时 Windows 自己的打开过渡压在启动窗口上,有一两帧整窗发灰、鲸鱼和头像错开成两个,然后深色一下跳成浅色;长大前 160 ms 的等待让鲸鱼停在跳的最高点。改成:主窗口在 `ready()` 时就以不透明度 0 显示在启动窗口下面(打开过渡看不见地走完,也不卡长大的第一步);长大 `handoffShow` + 40 ms 开始,260 ms,缓入缓出;鲸鱼长到位 60 ms 后落下,主进程等 `handoffDone` 才让主窗口变成不透明,再把启动窗口 180 ms 淡出,鲸鱼化进头像。减少动态效果和页面没发 `handoffShow` 时不长大,同样淡出。依据:录屏前后对比(首次启动就绪到主窗口露出 1.24 秒带一帧发灰,变成 1.09 秒开始淡、1.29 秒淡完;以后的启动 0.58 秒开始);启动窗口的单元测试(主窗口在 `ready()` 时透明地显示在下面、等落下或 300 ms、淡出后才给焦点、失败时收回)。Mica 窗口用 `setOpacity` 淡出在 Windows 11 上正常。
- 2026-11-02 复制没有停止按钮:圆环下那个停止复制的小按钮看着像留下的一个点。用户定的:「取消终止复制按钮」。第 6 节去掉按钮和「停止复制?」那张确认卡;要停就退出应用或关窗口,复制先停下、不留下半个团队再退出。
+- 2026-11-02 找不到放数据的文件夹:恢复卡的原因多一种,数据所在的盘不在了(不是程序自己的文件不见了)不再写「出了点意外」,而是「找不到放数据的文件夹,可能是移动硬盘没插上。」,红的是第一段。
- 2026-11-02 复制失败的卡:第 6 节,加一句该怎么办。
- 2026-11-02 团队界面没加载出来的卡:第 7 节,加一句发生了什么、一句该怎么办和「详细信息」,和恢复卡一样。
- 2026-11-02 恢复卡说该怎么办:用户要「报错页也都进行补充」。第 7 节:恢复卡在原因下面加一句该怎么办(按原因写)。
diff --git a/docs/plans/2026-10-26-windows-onboarding.md b/docs/plans/2026-10-26-windows-onboarding.md
index 70e5a6f4..640bf307 100644
--- a/docs/plans/2026-10-26-windows-onboarding.md
+++ b/docs/plans/2026-10-26-windows-onboarding.md
@@ -106,7 +106,7 @@ Windows 是桌面应用的主要平台:0.2.0 到 0.2.2 三个版本的安装
- 首次启动的位置检查和「移到…」用同一套规则检查定出的根:不能是整个磁盘、不能是别人的非空文件夹,外加一次试写。
- `locations.json` 只在引擎第一次成功启动(`ready`)、导入问题也答完之后才写。同时写一份 UTF-16LE 的 `locations.ini` 给卸载程序读。应用自己新建的数据文件夹里放一个不含任何机密的 `.deepseek-bot` 标记,这个标记在建文件夹时就写、不等 `ready`:首次启动没走完就退出时,留下的文件夹下次才认得出是自己建的(定根规则里的「以前的根」),不会被当成别人的非空文件夹。「首次启动没走完就退出时什么都不记」的规则不变:记的只是 `locations.json`。每次启动先删掉上次留下的暂存(路径记在 `%APPDATA%` 里,加上数据文件夹里所有的 `.import-*` 和 `.import-check-*`)。
- 然后加载引擎的页面:DSH 的「预览版说明」→「继续」。DSH 自己的「开始使用」和「添加一个 API Key」不再自动出现:应用在自己的 profile 补丁(和 `search-patch.mjs` 一样经 `runProfile` 的 `patchFiles` 传入)里设 `ui-settings-models` 的 `credentialOnboarding: false`,这是 DSH 有文档的配置。补丁会替换这一行的整个 `config`,所以每次升级锁定的 DSH 都对照新版本重写这一行。应用的补丁里只有这一行。
-- **启动失败**时,启动页当场变成恢复页(不再等 GitHub、不再隐藏窗口、不再弹英文「Error」框):鲸鱼那一行写「DeepSeek Bot 没能启动」(卡住的那段弧变红),不说俏皮话,下面一句对应的原因(没有写入权限 / 磁盘空间不够 / 程序文件不完整,可能被杀毒软件拦掉了一部分 / 本机引擎启动到一半停下了 / 出了点意外),每种都给〔重试〕〔换个位置…〕〔用新的空白团队开始…〕〔打开日志文件夹〕〔复制详细信息〕(换位置按第 3 节定根的规则,数据和总工作区一起搬,搬的规则同第 8 节:同一个卷上改名,不同的卷上复制完再删旧的;还没有团队时只是换个空文件夹),再加一个「详细信息」折叠区(日志最后 200 行,已脱敏)。
+- **启动失败**时,启动页当场变成恢复页(不再等 GitHub、不再隐藏窗口、不再弹英文「Error」框):鲸鱼那一行写「DeepSeek Bot 没能启动」(卡住的那段弧变红),不说俏皮话,下面一句对应的原因(没有写入权限 / 磁盘空间不够 / 程序文件不完整,可能被杀毒软件拦掉了一部分 / 本机引擎启动到一半停下了 / 找不到放数据的文件夹,可能是移动硬盘没插上 / 出了点意外)和一句该怎么办,每种都给〔重试〕〔换个位置…〕〔用新的空白团队开始…〕〔打开日志文件夹〕〔复制详细信息〕(换位置按第 3 节定根的规则,数据和总工作区一起搬,搬的规则同第 8 节:同一个卷上改名,不同的卷上复制完再删旧的;还没有团队时只是换个空文件夹),再加一个「详细信息」折叠区(日志最后 200 行,已脱敏)。
- 启动超过 180 秒:鲸鱼问「等太久了,要不要重试?」,卡片上只有〔继续等待〕〔重试〕〔复制详细信息〕〔保存日志…〕,引擎同时继续启动。
- 后台更新器发现了新版本时,恢复页上显示「DeepSeek Bot {版本} 已经发布,可能修好了这个问题。」〔下载并安装〕,带下载百分比和「下载太慢?手动下载」(打开镜像页)。
- 引擎起来了但 DS Bot 界面 20 秒内没报告就绪(ds-bot 在界面挂载完成后调用 `dsBotApp.ready()`):回到启动页,显示「团队界面没有加载出来」〔重新载入〕〔复制详细信息〕〔保存日志…〕。
diff --git a/docs/plans/2026-10-29-start-copy.md b/docs/plans/2026-10-29-start-copy.md
index 0ebffceb..3a2b4cde 100644
--- a/docs/plans/2026-10-29-start-copy.md
+++ b/docs/plans/2026-10-29-start-copy.md
@@ -72,7 +72,7 @@
| `importFailed` | `card.importFailed.lead` | |
| (新) | `card.importFailed.do` | 复制失败的卡:该怎么办 |
| (新) | `card.viewFailed.lead`、`card.viewFailed.do` | 团队界面没加载出来的卡:发生了什么、该怎么办 |
-| (新) | `card.failed.do.{reason}` | 恢复卡上原因下面的「该怎么办」,按 `reason.start.*` 的五种原因各一句 |
+| (新) | `card.failed.do.{reason}` | 恢复卡上原因下面的「该怎么办」,按 `reason.start.*` 的六种原因各一句 |
| `failed.reason.*` | 见 `reason.start.*` | 卡片直接用 `reason.start.{reason}` |
| `update.available / downloading / installing / failed / slow` | `card.update.available / downloading / installing / failed / slow` | |
@@ -200,3 +200,4 @@
- 2026-11-02:恢复卡说该怎么办([启动窗口](2026-10-26-start-window.md) 同一天的变更):加 `card.failed.do.permission / space / files / engine / other`。
- 2026-11-02:团队界面没加载出来的卡([启动窗口](2026-10-26-start-window.md) 同一天的变更):加 `card.viewFailed.lead / do`。
- 2026-11-02:复制失败的卡([启动窗口](2026-10-26-start-window.md) 同一天的变更):加 `card.importFailed.do`。
+- 2026-11-02:找不到放数据的文件夹([启动窗口](2026-10-26-start-window.md) 同一天的变更):加 `reason.start.missing` 和 `card.failed.do.missing`。