You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
apps/desktop:connectDesktopWelcome() 只判断 if (!response.ok) throw new Error("desktop welcome: Web authentication failed"),把 431/5xx 一律归因为认证失败,崩溃弹窗进一步引导「重新安装」。
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
摘要
桌面版(macOS,
@deepseek-ai/dsh-desktop0.2.1-rc.3)在用了一段时间后,某天起每次启动都失败,弹窗「应用无法启动或已意外停止 / desktop welcome: Web authentication failed」,并提示重新安装——重装无效。真实原因不是认证失败:内置宿主返回
HTTP 431 Request Header Fields Too Large。桌面宿主每次启动都用随机端口,而认证 cookie 按host:port命名、有效期 30 天且从不清理,累积约 70 条后 Cookie 请求头超过 Node 默认 16 KB 上限。环境
@deepseek-ai/dsh-desktop0.2.1-rc.3(Electron 44.7.0 / Node 24.21.0),macOS darwin arm64@deepseek-ai/dsh0.2.1-rc.2(CLI,用于对照验证)dsh-base+dsh-web-app),locale zh-CN现象
desktop welcome: Web authentication failed;崩溃日志~/Library/Logs/DeepSeek Harness/crash-*-host.log,栈顶connectDesktopWelcome。http://127.0.0.1:<随机端口>/?token=…的实际响应为HTTP/1.1 431 Request Header Fields Too Large。~/Library/Application Support/@deepseek-ai/dsh-desktop/Cookies中dsh-auth-*共 71 条,每条 name 52 + value 173 ≈ 228 字节,合计 ≈ 16.2 KB;Nodehttp服务端默认maxHeaderSize为 16384。creation_utc与缓存中首条 431 记录同为12:16:22,此后每次重试均为 431。Application Support下,不在应用包内。根因
三处各自合理的设计叠加:
apps/desktop-host:宿主启动参数硬编码--port 0,每次启动 authority 都不同。packages/client/connection:cookieName(authority)以sha256(host:port)命名;cookieMaxAgeDays默认 30;对过期 authority 的 cookie 没有任何清理。端口每次变化即新增一条,永久累积。apps/desktop:connectDesktopWelcome()只判断if (!response.ok) throw new Error("desktop welcome: Web authentication failed"),把 431/5xx 一律归因为认证失败,崩溃弹窗进一步引导「重新安装」。触发条件为 Node 内置默认值,不是环境误配置;问题稳定复现,非偶发。
复现
最小复现(不必真等 70 次启动):注入 70 条
dsh-auth-*到 cookie 库后启动 App,必然复现。自然复现:正常使用,启动约 70 次后必然发生。
建议修复
任一项即可消除(按侵入性从小到大):
dsh-auth-*,或保留最近 N 条,使总数有界。maxHeaderSize,并在超限时返回可诊断错误。用户侧规避(已验证)
在
~/.dsh/profiles/desktop/cordis.patch.yml的 patch 层固定宿主端口,使 authority 恒定、cookie 恒为 1 条:验证:固定端口后 cookie 由 71 条降为 1 条(229 字节),
GET /仍返回 401(认证门有效),问题不再出现。说明:本报告为一次性提交,报告者后续不参与跟进、复现或验证,也不会回复后续追问。报告已包含完整定位与可复现证据,如需进一步数据请按上述步骤自行采集。
All reactions