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
source: host
phase: startup
--- error ---
Error: desktop welcome: Web authentication failed
at connectDesktopWelcome (.../app.asar/lib/main.js:8886:31)
at async Object.start (.../app.asar/lib/main.js:12195:22)
应用立即退出,之后每次启动都一样。
根因
apps/desktop-host/src/index.ts 自提交 ecd9bf92
("fix(desktop): listen on an OS-assigned port by default",2026-09-30)起,用 系统随机端口 启动 Web(--host 127.0.0.1 --port 0);此前是固定 --port 19387。
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.
摘要
Windows 桌面端每次启动都会在 Electron 的 cookie 库里写入一个新的
dsh-auth-<sha256(127.0.0.1:端口)>cookie。原因是桌面宿主启动 web 服务时用的是系统随机分配的端口,而鉴权 cookie 的名字直接由"主机:端口"算出来,所以每次启动
cookie 名都不一样;旧 cookie 又从不删除(
Max-Age30 天)。大约 70 次启动后,Cookie:请求头本身就接近 16 KiB,超过 Node HTTP server 默认的 16,384 字节上限,host 返回
431 Request Header Fields Too Large,桌面端在desktop welcome: Web authentication failed处抛错退出,之后每次启动都失败。用户侧表现:桌面端彻底打不开,只能手动清 cookie 或重装 profile 才能恢复。
环境
@deepseek-ai/dsh-desktop 0.2.1-rc.5(Electron 44.7.0,Node 24.21.0)@deepseek-ai/dsh-client-connection@0.2.1-rc.5、@deepseek-ai/dsh-desktop-host@0.2.1-rc.5、@deepseek-ai/dsh-host-webserver@0.2.1-rc.5DSH_HOME=~/.dsh),没有任何自定义 cookie / web-server 配置0.2.2-alpha.2里dsh-client-connection/lib/index.js与0.2.1-rc.5字节级完全一致,问题未修复。
症状
崩溃日志(
%APPDATA%\@deepseek-ai\dsh-desktop\logs\crash-*-host.log):应用立即退出,之后每次启动都一样。
根因
apps/desktop-host/src/index.ts自提交ecd9bf92("fix(desktop): listen on an OS-assigned port by default",2026-09-30)起,用
系统随机端口 启动 Web(
--host 127.0.0.1 --port 0);此前是固定--port 19387。packages/client/connection/src/browser-auth.ts用 authority 派生 cookie 名:端口随机 →
127.0.0.1:<port>每次不同 → cookie 名每次不同 → 每次启动新增一条,而不是覆盖上一条。
cookie 以
Max-Age = cookieMaxAgeDays(30 天)签发,且包内没有任何删除旧 cookie 的代码(
deleteCookie/clearCookies均不存在)。apps/desktop/src/welcome-backend.ts的connectDesktopWelcome(ready.url, net.fetch, …)使用
credentials: 'include',这些 cookie 被存进 Chromium 的 cookie jar。Node HTTP server 默认
maxHeaderSize = 16,384字节,Cookie 头累积到超过它时,鉴权处理之前就会先返回
431。实测数据(Windows 11,rc.5)
cookie 库
%APPDATA%\@deepseek-ai\dsh-desktop\Network\Cookies:dsh-auth-*(每次启动一条;Path=/、HttpOnly、SameSite=Strict、Max-Age30 天、值约 173 字节)。10/22 1、10/23 12、10/24 7、10/25 1、10/26 2、10/27 3、10/28 11、10/29 10、10/30 8。
这 71 条拼出的
Cookie:头为 16,186 字节(15.81 KiB)。对运行中的官方 host 做只读探测(
GET /):Cookie:头大小第 71 条 cookie 写入时间 2026-10-30 17:08:32Z,第一次崩溃发生在 17:08:35Z,
之后每次启动都在同一点失败,桌面端直接退出。
复现方式
手动:
dsh-auth-*。desktop welcome: Web authentication failed;检查Network/Cookies里的
dsh-auth-*数量即可确认。确定性复现:
127.0.0.1插入 71 条 30 天有效、值约 173 字节的dsh-auth-*假记录。Web authentication failed。GET /发送 16,384 字节的Cookie头,观察 431。建议修法
connectDesktopWelcome之前,通过session.defaultSession.cookies.get({ url })取出所有dsh-auth-*,删掉名字不等于当前 authority 对应 cookie 的记录;遇到 431 时清空并重试一次。
这样每次启动是覆盖而不是新增。
authenticateWebHost(ready.url)拿到了 cookie,并在
forwardWebRequest里显式转发;welcome 也可以显式传,而不是依赖
credentials: 'include'与 Chromium 的存储。maxHeaderSize,或对dsh-auth-*cookie 数量设上限,把不可恢复的启动崩溃变成可恢复的错误。
用户当前绕过方案
完全退出 DSH 后,备份并删除
%APPDATA%\@deepseek-ai\dsh-desktop\Network\Cookies里name GLOB 'dsh-auth-*'的记录;下次启动会重新签发一个,即可正常使用。在修复发布前,大约每 60–70 次启动需要清理一次。
All reactions