Repository navigation
Replies: 3 comments
|
pnpm install dsh-cookie-cleaner ① 先看现状(客户端开着也能跑,只会告诉你读不到)& "$env:USERPROFILE.dsh\profiles\desktop\node_modules.bin\dsh-cookie-cleaner.cmd" ② 完全退出客户端:托盘图标 → 退出,并确认进程列表已无 DeepSeek HarnessGet-Process | Where-Object { $_.ProcessName -match 'DeepSeek|dsh' } # 应当没有输出 ③ 清理(先看会删几条,再真删)& "$env:USERPROFILE.dsh\profiles\desktop\node_modules.bin\dsh-cookie-cleaner.cmd" --clean --dry-run |
|
Independent confirmation on macOS arm64, Measured on the affected install (read directly from the Electron cookie store at
Fully quitting the app and deleting the One extra data point for the bounded-jar suggestion above: since the name is random per launch rather than derived from the authority, a fixed name per host would keep the jar at exactly one entry regardless of launch count. |
|
The upstream PR route is closed to external contributions on this repo — CONTRIBUTING.md: "We are sorry that we cannot accept external pull requests at the moment" (enforced by the diff --git a/apps/desktop/src/welcome-backend.ts b/apps/desktop/src/welcome-backend.ts
index 15b0932..750d491 100644
--- a/apps/desktop/src/welcome-backend.ts
+++ b/apps/desktop/src/welcome-backend.ts
@@ -58,7 +58,7 @@ export function connectDesktopWelcome(
headers: { 'content-type': 'application/json', cookie },
body: JSON.stringify({ type: 'client-request', rpcId, method, payload: { args: request.args } }),
})
- if (!response.ok) throw new Error('desktop welcome: Web request failed')
+ if (!response.ok) throw new Error(`desktop welcome: Web request failed (HTTP ${response.status})`)
const envelope: unknown = await response.json()
if (!record(envelope) || envelope.type !== 'server-response' || envelope.rpcId !== rpcId
|| !record(envelope.result) || envelope.result.ok !== true) {Crash reports would then carry Tests (sparse-checkout workspace,
No test or snapshot asserts the old message string. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Summary
After roughly 68–70 launches,
dsh-desktopstops starting forever with:It is not an account/network problem. The Host answers 431 Request Header Fields Too Large,
and the desktop shell maps every non-2xx to a generic auth error.
Cause: the Host mints a new browser-session cookie on every launch whose name embeds
host:port. The port is random per launch, so each start adds one moredsh-auth-*cookie for127.0.0.1that is never removed (30-day expiry). Chromium sends all of them on thelaunch-URL redirect; once
Cookieplus the other request headers exceed Node's defaultmaxHeaderSize(16 KiB), the Host rejects the request with 431.Environment
@deepseek-ai/dsh-desktop0.2.1-rc.5 (nightly feeddownload.deepseek.com/dsh-desk/feeds/win-x64/)%APPDATA%\@deepseek-ai\dsh-desktop\logs\crash-2026-11-01T08-04-50-928Z-host.logError: desktop welcome: Web authentication failed at connectDesktopWelcome (.../resources/app.asar/lib/main.js:8886:31)Root cause — three sites in
master1. One cookie per launch, never cleaned up
packages/client/connection/src/browser-auth.ts:116authorityishost:port(seerequestAudience), so every launch — random port — creates anew cookie name for the same host
127.0.0.1.sessionCookie(:131) writesMax-Age=<30 days>; Path=/; HttpOnly; SameSite=Strict. Nothing ever deletes the old ones.2. The Host's HTTP server keeps Node's default 16 KiB header limit
packages/host/webserver/src/index.ts3. The desktop shell hides the real status
apps/desktop/src/welcome-backend.ts:49Electron
net.fetchfollows the Host's303, the redirect targetGET /carries everyaccumulated cookie, and the 431 (or any other status) collapses into the same message.
Measured evidence (real profile, 2026-11-01)
%APPDATA%\@deepseek-ai\dsh-desktop\Network\Cookies: 71 rows, allhost_key='127.0.0.1',path='/', namesdsh-auth-<hash>, one per distinctsource_port.Cookieheader: 16,104 bytes; plus Chromium's usual headers ≈ 16.7 KB.http.maxHeaderSizeunder the app's own Node 24.21.0: 16384.--user-data-dirNetwork\CookiesHPE_HEADER_OVERFLOWHPE_HEADER_OVERFLOWThe probe is a plain
node:httpserver created the way the Host creates it, hit with a cookieheader built from the real profile values plus Chromium-shaped headers.
Deterministic reproduction (no 70 restarts needed)
node:httpserver with default options (or the real Host).GET /withCookie: <70 × "dsh-auth-<43 chars>=<173 chars>">(≈15.9 KB) and a normalChromium header set → the server emits
clientError HPE_HEADER_OVERFLOWand answers 431.desktop welcome: Web authentication failed.Real-world reproduction is just "launch the app ~70 times"; that is what the profile above shows
(created dates spread over 2026-10-15 … 2026-11-01, ~14 on the busiest days).
Suggested fixes
createServer({ maxHeaderSize: 64 * 1024 }, listener)(same for thehttpsvariant).Removes the cliff; nothing else changes.
host:port. The signed payload alreadycarries
authority({version, authority, issuedAt, expiresAt}) andisAuthenticatedre-checks it, so a fixed per-host name is enough and keeps the jar at exactly one cookie
per host instead of one per launch.
127.0.0.1dsh-auth-*cookies beforeconnectDesktopWelcomeso already-poisoned profiles heal on upgrade.throw new Error(\desktop welcome: Web authentication failed (HTTP ${authenticated.status})`)`.One line, and this whole investigation would have started from the answer instead of the symptom.
A/B alone make this unreachable; C+D are cheap insurance.
Impact
Any desktop user hits a hard, permanent startup failure after enough launches, with no
recovery path in the UI (the dialog only offers Exit / Restart / "disable third-party plugins and
back up profile patch"). The same 16 KiB wall also hits
dsh webwhen its tokenized launch URL isopened in one browser profile ~70 times.
User-side workaround
Quit the app, then delete
%APPDATA%\@deepseek-ai\dsh-desktop\Network\Cookies(the app recreates it; make a backup first). Startup then succeeds immediately.
中文摘要
dsh-desktop启动约 68–70 次后会永久启动失败,报desktop welcome: Web authentication failed。真实原因是 Host 返回了 431(请求头过大),桌面壳把所有非 2xx 都当成认证失败。
三处成因(master 均未修):
packages/client/connection/src/browser-auth.ts:116—— cookie 名是dsh-auth-<sha256(host:port)>,端口随机 → 每次启动新增一条、30 天过期、从不清理,127.0.0.1下越攒越多。packages/host/webserver/src/index.ts——createServer(listener)没设maxHeaderSize,沿用 Node 默认 16 KiB。
apps/desktop/src/welcome-backend.ts:49——net.fetch跟随 303 后,431 被压成"Web authentication failed",看不出真实原因。
实测:71 条 cookie,
Cookie头 16,104 字节,加常规头 ≈16.7 KB;68 条 → 200,70/71 条 → 431HPE_HEADER_OVERFLOW。删掉Network\Cookies立刻恢复正常。建议:A) Host 端把
maxHeaderSize提到 64 KiB;B) cookie 名不再绑定端口(签名里已有authority,可校验);C) 桌面启动前清理旧的
dsh-auth-*;D) 错误信息带上 HTTP 状态码。A+B 即可根治,C+D 是低成本保险。
All reactions