Repository navigation
Replies: 2 comments 1 reply
|
A few clarifications on my own report, so nobody has to chase them. 1) About the launch count. The "2–3 restarts per day" line describes my normal usage. The 71 launches accumulated because during those days I was developing and debugging a desktop-pet plugin for myself, which meant dozens of extra start/quit cycles on top of daily use — a plugin developer's restart pattern, not a typical user's. The plugin itself is irrelevant to the bug: check 3 removed it from the profile entirely and 5 valid launches still added exactly 5 cookies. 2) Header arithmetic, written out. So the number can be checked instead of guessed: That budget also has to carry 3) Scope of the injection test. It was done on a copy of the Cookies database — the real one was never modified. The crash reproduced identically (same stack, same single Minimal reproduction for anyone who wants to confirm it:
The sanitized evidence package is already attached to the original post; happy to re-share it by email if that is more convenient. |
|
Your arithmetic matches the header exactly. Seventy-one cookies at 226 bytes each, plus 70 two-byte separators, is 16,186 — and that only adds up if every launch wrote a different name. The name is derived from the authority. function cookieName(authority: string): string {
return COOKIE_PREFIX + encodeBase64Url(createHash('sha256').update(authority).digest())
}and That also explains the recovery pattern: clearing cookies for 127.0.0.1 fixes startup, and reinstalling the app does not, because the jar lives outside the install. Fix shape, two halves. Make the name port-independent for loopback (hash the host, or use one fixed name and disambiguate inside the signed value), and on startup delete sibling |
Uh oh!
There was an error while loading. Please reload this page.
Environment: Windows 11 (win32 x64) ·
@deepseek-ai/dsh-desktop0.2.1-rc.2 · Electron 44.7.0 · Node 24.21.01. Background
dsh-whale-pet) — pure UI decoration and voice playback, nothing related to auth, cookies, or networking. Plugin debugging involved a lot of restartsWeb authentication failed2. The issue I'd like to report
Crash log
logs/crash-2026-10-22T14-35-51-369Z-host.log:While investigating, I found that 71
dsh-auth-*cookies had accumulated under127.0.0.1. The Cookie request header alone is 16,186 bytes (per cookie: 52-char name +=+ 173-byte value = 226 B, plus a 2-byte;separator between entries, i.e. 71×226 + 70×2). Add the usualHost,User-Agentand other headers, and the total necessarily exceeds Node.js's default 16,384-byte header limit (maxHeaderSize).The issue: the cookie count grows by exactly 1 on every restart, and I suspect that once the header crosses the limit, startup authentication fails. To confirm, I ran three sets of verification.
3. Verification
Check 1: each launch adds one cookie, and old ones are never removed
dsh-auth-+base64url(sha256(authority)), where authority contains the random listening port127.0.0.1:1024–65535mapped all 71 records to 71 distinct ports (range 49662–65534, the Windows dynamic port range)expiresset to 30 days after creation, so none would naturally expire during Oct 18–22ProxyEnable=0); credentials intact (after clearing the cookies the app started without re-login); no port conflict;authenticateWebHosthad already passed — the failure happened on the subsequent welcome connectionCheck 2: forced over-limit reproduction — push the cookies past the limit and it always crashes; roll back and it recovers
This is the most direct check. I ran an injection experiment on a copy of the app's Cookies database (the app itself was not modified):
dsh-auth-*countencrypted_value, +30 days expirycrashDetected=true, onecrash-*-host.log(phase: startup), zero renderer logs, 4 leftover processesdesktop welcome: Web authentication failedatconnectDesktopWelcome (main.js:8886:31)This closes the causal loop: cookies over the limit → startup authentication failure.
Check 3: ruled out my own plugin (control experiment)
To rule out "my plugin broke the environment", I ran a control experiment:
Conclusion: with or without the plugin, the behavior is identical — this is not related to third-party plugins.
A related observation: closing the main window leaves 5
DeepSeek Harnessprocesses behind. On the next launch the UI shows "no response / spinning forever" because control is handed to the windowless old instance — and every such retry also appears to add one more cookie.4. Code I came across (for reference only)
In
app.asar,lib/types/browser-auth.js(part of@deepseek-ai/dsh-desktop-host), the issuance logic looks like:From what I could see, there is no logic that cleans up old cookies (neither expiry-by-authority nor a cap with recycling). I did not read the entire codebase, so this is only my observation and may be incomplete — sharing it in case it helps the team.
5. My current workaround
Since I still need to use the app, I wrote a small local guard script (
dsh_cookie_guard.py) that watches for process exit and then deletes records matchinghost_key='127.0.0.1' AND name LIKE 'dsh-auth-%', with autostart, process patrol, and log rotation.This is only a stopgap so I can keep working — it doesn't modify the app, and I understand it is not a real fix. Long term, I'd hope the issuance/cleanup strategy could be revisited on the official side.
6. A few rough ideas (just brainstorming, take or leave)
7. How to reproduce / check, and evidence
DB path:
%APPDATA%\@deepseek-ai\dsh-desktop\Network\Cookies(if the header size is already over the limit, fully quit the app first — otherwise the file is locked).Evidence package (sanitized, safe to share):
dsh-cookie-repro-20261023-redacted.zipContains: before/after Cookies DB snapshots (real values replaced with 173-byte dummies; names, counts and header sizes preserved), crash logs, and a machine-readable
repro-result.jsondsh-cookie-repro-20261023-redacted.zip
SHA256:
00aeecda666c951a85061e09817da76b81e4b4a13c0fc3cec1c6e6b6e245acb2Happy to attach it or send it by email if further investigation needs it (no credentials included)
All reactions