dsh-cookie-cap 0.0.0-stage → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 dsh-cookie-cap contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,62 @@
1
- # Temporary Holding Version
1
+ # dsh-cookie-cap
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Fix the **DeepSeek Harness (DSH) desktop** startup failure caused by unbounded `dsh-auth-*` cookie accumulation — a config-only bundle (no runtime code) that caps the connection cookie lifetime.
4
+
5
+ > **Cross-validated:** installed, restarted, and verified on **two different Windows PCs** (Home + Pro, DSH `0.2.2-rc.1`), including a stable reproduction of the hot-install disconnect pitfall documented below.
6
+
7
+ ## Symptom
8
+
9
+ After roughly **72 launches**, DSH Desktop fails to start:
10
+
11
+ ```
12
+ DeepSeek Harness is unavailable
13
+ The application could not start or stopped unexpectedly.
14
+ desktop welcome: Web authentication failed
15
+ ```
16
+
17
+ The host log shows `HTTP 431` (Request Header Fields Too Large).
18
+
19
+ ## Root cause
20
+
21
+ 1. Every DSH Desktop launch starts a local host on a **random port** (`--port 0`).
22
+ 2. The `connection` plugin (`@deepseek-ai/dsh-client-connection`) sets a cookie `dsh-auth-<sha256("127.0.0.1:<port>")>` — a **new cookie each launch**, never overwritten, never pruned.
23
+ 3. Each cookie costs ~228 bytes in the `Cookie` request header; Node's `maxHeaderSize` is 16384 bytes, so the **72nd** launch overflows → `HTTP 431`.
24
+ 4. Cookies default to `cookieMaxAgeDays: 30`.
25
+
26
+ ## Fix
27
+
28
+ Override the `connection` plugin's `cookieMaxAgeDays` from `30` to `7`, so old cookies expire on their own and the count stays bounded (~35 cookies ≈ 7 KB):
29
+
30
+ ```yaml
31
+ # cordis.patch.yml
32
+ - id: connection
33
+ config:
34
+ cookieMaxAgeDays: 7
35
+ ```
36
+
37
+ ## Install
38
+
39
+ ```sh
40
+ dsh plugin --profile <profile> add dsh-cookie-cap
41
+ ```
42
+
43
+ or install this directory via `plugin_manager` `install_bundle`.
44
+
45
+ > ⚠️ **Restart DSH immediately after install.** This bundle overrides `connection` (the WebSocket plugin); hot-installing it mid-session drops the client connection and can leave the UI at "Reconnecting…". If the install returns "unknown outcome / interrupted", the write is usually already persisted — restart, then verify; don't blindly retry.
46
+
47
+ ## Verify
48
+
49
+ - `list_bundles`: `dsh-cookie-cap` with `enabled:true` and `overrides:["connection"]`.
50
+ - `list_plugins`: `include:connection` still `enabled:true / fiberPhase:active`.
51
+
52
+ ## Clean up already-accumulated cookies (optional)
53
+
54
+ This bundle only prevents **future** accumulation; existing cookies keep their 30-day lifetime until cleaned. With DSH fully closed (including the tray icon), run the companion `cleanup-dsh-cookies.py` (backup + delete `dsh-auth-*` rows). See the full kit for the script and a `--dry-run` variant.
55
+
56
+ ## Scope
57
+
58
+ Desktop only (Web/CLI use a fixed port and are unaffected). Verified on DSH `0.2.2-rc.1`; community reports also `0.2.1-rc.3 / rc.5`.
59
+
60
+ ## License
61
+
62
+ MIT
@@ -0,0 +1,3 @@
1
+ - id: connection
2
+ config:
3
+ cookieMaxAgeDays: 7
package/icon.svg ADDED
@@ -0,0 +1,10 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" width="64" height="64">
2
+ <path d="M32 3 L55 12 V30 C55 46 45 57 32 61 C19 57 9 46 9 30 V12 Z" fill="#2563eb"/>
3
+ <path d="M32 8 L51 16 V30 C51 43.5 43 53 32 57 C21 53 13 43.5 13 30 V16 Z" fill="#eff6ff"/>
4
+ <circle cx="32" cy="31" r="15" fill="#d97706"/>
5
+ <circle cx="27" cy="27" r="2.4" fill="#92400e"/>
6
+ <circle cx="37" cy="26" r="2.4" fill="#92400e"/>
7
+ <circle cx="30" cy="36" r="2.4" fill="#92400e"/>
8
+ <circle cx="39" cy="35" r="2.4" fill="#92400e"/>
9
+ <path d="M26 31 l4.5 4.5 l8 -8.5" stroke="#fff7ed" stroke-width="3.2" fill="none" stroke-linecap="round" stroke-linejoin="round"/>
10
+ </svg>
package/locale/en.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "Cookie lifetime cap",
4
+ "description": "Caps the desktop session-cookie lifetime so dsh-auth cookies stop piling up and breaking startup."
5
+ }
6
+ }
package/locale/zh.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "Cookie 生命周期上限",
4
+ "description": "限制桌面端会话 Cookie 的有效期,避免 dsh-auth Cookie 持续累积导致启动失败。"
5
+ }
6
+ }
package/package.json CHANGED
@@ -1,6 +1,40 @@
1
1
  {
2
2
  "name": "dsh-cookie-cap",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "1.0.0",
4
+ "description": "Fix the DeepSeek Harness desktop startup failure (HTTP 431 / \"Web authentication failed\") caused by dsh-auth cookie accumulation after ~72 launches — caps the connection cookie lifetime.",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "exports": {
8
+ "./locale/*.json": "./locale/*.json",
9
+ "./icon": "./icon.svg"
10
+ },
11
+ "files": [
12
+ "cordis.patch.yml",
13
+ "locale/*.json",
14
+ "icon.svg"
15
+ ],
16
+ "publishConfig": {
17
+ "access": "public"
18
+ },
19
+ "keywords": [
20
+ "dsh",
21
+ "deepseek-harness",
22
+ "deepseek",
23
+ "harness",
24
+ "cookie",
25
+ "dsh-auth",
26
+ "cookie-accumulation",
27
+ "http-431",
28
+ "startup-failure",
29
+ "web-authentication-failed",
30
+ "cookiemaxagedays",
31
+ "fix",
32
+ "patch",
33
+ "bundle"
34
+ ],
35
+ "dsh": {
36
+ "bundle": {
37
+ "patch": "./cordis.patch.yml"
38
+ }
39
+ }
6
40
  }