Repository navigation
Replies: 1 comment
|
Independent reproduction on Windows, same conclusion — plus one cross-check that explains why the in-app recovery buttons ("禁用第三方插件 / 备份 profile patch 并重启") never helped. Environment
Measurements
Extra evidence: the timestamp ordering pins the status code to 431
That is also why disabling third-party plugins cannot help: the failure happens in the shell's welcome handshake, before any profile patch is applied. Suggested fix, in order of preference
Workaround that unblocked it here: delete the |
0 replies
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
After ~68 launches, the macOS desktop app stops starting. Deterministic, not flaky:
Environment:
@deepseek-ai/dsh-desktop0.2.1-rc.5 · Electron 44.7.0 · Node 24.21.0 · darwin arm64.Cause: the Electron session cookie jar accumulates one
dsh-auth-*cookie per launch. At ~68–71 entries theCookierequest header exceeds Node's defaulthttp.ServermaxHeaderSize(16384 bytes), the host answers 431, and the shell treats any non-2xx as an authentication failure.Root cause chain
@deepseek-ai/dsh-desktop-host/lib/index.js:236-240hardcodes["--no-open","--host","127.0.0.1","--port","0"].@deepseek-ai/dsh-client-connection/lib/index.js:335-336:"dsh-auth-" + base64url(sha256(authority)); forhttpthe audience ishost:port(:152-159). New port → new name → the old cookie is never overwritten.@deepseek-ai/dsh-host-webserver/lib/index.js:413callscreateServer(listener)without amaxHeaderSize, i.e. Node's 16 KB default.connectDesktopWelcome(app.asar/lib/main.js:8886) throws a generic"desktop welcome: Web authentication failed"; the 431 never reaches the crash log.Measured against the real host: 70 cookies (16,256 B) → 200; 71 cookies (16,485 B) → 431. Chromium's extra request headers lower the practical threshold to ~68.
Evidence
~/Library/Application Support/@deepseek-ai/dsh-desktop/Cookies(SQLite), 71 rows, alldsh-auth-*, 16,117 B of name+value.curltoken→cookie flow: host is healthy, returns 200 with a valid cookie and 401 without.app.boot,store.snapshot.ok); restoring the 71 rows → identical crash. Reproduced twice in both directions.Cookie: <k cookies>→ status): 250 cookies' worth (16,118 B) → 200; 255 (16,438 B) → 431.Suggested fixes (any one removes the crash)
connectDesktopWelcome, deletedsh-auth-*cookies for127.0.0.1from the default session, or run the main window in a non-persistent session partition.maxHeaderSizeondsh-host-webserver(and default it to 64 KB) instead of inheriting Node's 16 KB.desktop welcome: Web authentication failed (HTTP 431)— so a crash log points at the cause.Related sharp edge (not a bug, but silent failure)
Lowering
cookieMaxAgeDayson a running host (a cordis patch hot-reload) invalidates every already-issued cookie at once:BrowserAuth.authenticate()comparespayload.expiresAt - payload.issuedAtagainst the currentmaxAgeMilliseconds(@deepseek-ai/dsh-client-connection/lib/index.js:563-568). The desktop shell captures its cookie once at startup (main.js:12191) and never re-issues, so the UI sits atconnection.connecting("重新连接中") forever — a page reload does not help, only an app restart. We hit exactly this while rolling out the workaround below. A config change that cannot be repaired without a restart probably deserves a warning or a forced re-issue path.Workaround in use here
~/.dsh/profiles/desktop/cordis.patch.ymlsetscookieMaxAgeDays: 5, bounding the jar at ~25 entries (≈5.7 KB) against a 68-entry crash line. Tradeoff: a continuous 5+ day uptime leaves the client unauthenticated until restart.All reactions