Repository navigation
Desktop: dsh-auth-* cookies accumulate on every launch and eventually break startup ("Web authentication failed") #11489
pmc19980323-web
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Summary
On Windows desktop (
@deepseek-ai/dsh-desktop0.2.1-rc.3, electron 44.7.0, node 24.21.0), every launch mints a newdsh-auth-*cookie for127.0.0.1in the Electron session jar. Nothing ever removes the old ones. After roughly 70 launches theCookieheader sent by the welcome handshake (connectDesktopWelcome) exceeds Node's default 16 KiB header limit, the request is rejected, and the app no longer starts:Because startup fails, the built-in retry loop crashes ~8 times, and the app then enters its recovery mode ("Disable third-party plugins, back up profile patch, and restart"), which additionally empties
dsh.profile.bundlesin the profile'spackage.json— so all third-party plugins silently disappear as a side effect.Environment
@deepseek-ai/dsh-desktop0.2.1-rc.3 (latest nightly as of 2026-10-23)%APPDATA%\@deepseek-ai\dsh-desktop\Network\CookiesSteps to reproduce
dsh-auth-<43 random chars>for host127.0.0.1.select count(*) from cookies where name like 'dsh-auth-%'.%APPDATA%\@deepseek-ai\dsh-desktop\logs\crash-*-host.logcontains the error above.Evidence from our machine
dsh-auth-*cookies (53,248-byte SQLite file).dsh-auth-+ 43), and eachname=value;pair is well over 150 bytes once the encrypted value is counted, so ~72 entries is exactly where a 16 KiB header blows up.Expected
The desktop shell should prune stale auth cookies, so long-term users do not hit a hard wall.
Suggested fix
In the main process, before the welcome handshake (or right after a successful one):
session.defaultSession.cookiesentries whose name starts withdsh-auth-except the one just issued, ordsh-auth-*entries older than e.g. 7 days, orA defensive check before
net.fetch(url, { credentials: 'include' })that measures the serialized cookie size and rotates the jar above a threshold (e.g. 12 KiB) would also prevent the hard failure.Workaround we use
A pre-launch step reads
Network\Cookieswith sqlite, sumslen(name)+len(value)+2for everydsh-auth-*entry, and moves the jar aside (the app recreates it) when the estimated header exceeds 12 KiB. Rotating the jar is safe because each launch mints a fresh cookie anyway.Additional observation
When startup crashes consecutively, recovery mode strips the profile patch and empties
dsh.profile.bundles, silently disabling every third-party plugin (all plugin tools disappear from the session). Recovering from that is non-obvious for users; a warning or a "restore plugins" action would help.All reactions