dsh-cookie-sentinel
在终端中运行以下命令:
dsh plugin install zhkkjF/dsh-cookie-sentinel
将以下提示词粘贴到 DeepSeek Harness 对话框中:
在 DeepSeek Harness 中可通过插件市场安装,或执行 dsh plugin install zhkkjF/dsh-cookie-sentinel 从 https://github.com/zhkkjF/dsh-cookie-sentinel 安装本 Host 插件。
插件介绍
DeepSeek Harness Desktop 每次启动都会在本地随机端口上拉起 Host Web 服务,浏览器会话 Cookie 会随端口不断追加 dsh-auth 条目。Cookie 按主机存储且默认保留约 30 天,多次启动后请求头里的 Cookie 会膨胀,最终触发 Node 的 16 KiB 头上限并返回 HTTP 431,桌面欢迎页便会提示 Web 认证失败。
本插件在 Host 侧做两件事:把在线 http.Server 的请求头上限提高到可配置范围(默认 128 KiB),让仍携带「已经撑爆」Cookie jar 的那次请求有机会走到认证路由;并在 authorizeIndex 真正 mint 新 dsh-auth Cookie 时,对请求里其余同名 Cookie 下发 Max-Age=0 的删除指令,把 Electron 会话里的 jar 收回到当前启动对应的那一枚。启动逻辑刻意不抛错,避免防护本身拖垮桌面应用。
适合反复冷启动 DSH Desktop、长期本地开发或曾因 431 /「Web authentication failed」被挡在欢迎页外的用户。可通过 ~/.dsh/cookie-sentinel.log 审计每次启动 pruning 数量,判断清理是否生效。
使用场景
- 欢迎页反复提示 Web authentication failed 且抓包可见 431
- 多次冷启动后本地 Host 认证请求突然全部失败
- 需要把历史 dsh-auth Cookie 从 Electron jar 里收回到当前端口
适合人员
- 日常频繁重启 DSH Desktop 的本地开发者
- 遇到过 Cookie 头过大导致认证路由无法触达的用户
- 负责 Host 插件与桌面安全运维的同学