DSH Plugins Marketplace

DSH Plugins

Plugins

/

dsh-cookie-guard

k

dsh-cookie-guard

Discovered

DeepSeek Harness Desktop (Windows) plugin: periodically cleans up accumulated dsh-auth cookies to prevent request headers exceeding 16 KB from triggering 431 "Web authentication failed"| DSH desktop (Windows) plugin that cleans stale dsh-auth cookies to prevent 431 Web auth failures.

Machine translated

dsh-cookie-guard

给 DeepSeek Harness 桌面版(Windows) 用的小插件:按时清掉越积越多的 dsh-auth cookie,避免某天突然打不开 DSH。

它治的是什么病

DSH 桌面版每次启动,本地服务的端口都是随机的;会话 cookie 的名字是 dsh-auth- 拼上 authority(127.0.0.1:端口)算出来的哈希。

而 cookie 只按域名存,不认端口。于是:

每重启一次,127.0.0.1 底下就多一条新 cookie,旧的 30 天内不会被清。

攒到七十条左右,请求头就超过 Node 默认的 16384 字节上限,请求在进业务代码之前就被拒掉(431)。

界面上你只会看到:

Web 认证失败
(建议:重装,或者禁用第三方插件)

两条建议都没用——这跟装了什么插件一点关系都没有。

它怎么解决

插件不自己删:DSH 跑着的时候,Chromium 独占锁着 Cookies 库,连只读打开都不行。

它当调度员:

插件(跑在 DSH 里)
├─ 写一个 guard.cmd
├─ 建系统计划任务(每天固定时间)
└─ 往「启动」文件夹放一个隐藏 VBS(登录后 60 秒)
        ↓  真正动手的是它
cleaner.mjs
├─ 先探测库锁:锁着就跳过,绝不硬来
├─ 按 dsh-auth- 前缀精确删,其它 cookie 一条不碰
└─ 把结果写进 guard.log

安装

方式一:从本地目录装(拿到 zip 解压后)

dsh plugin --profile desktop add <解压后的目录路径>

或者用 Harness 的插件管理器,选「从本地目录安装」。装完 重启 DSH。

方式二:从 GitHub 装

dsh plugin --profile desktop add github:<你的用户名>/dsh-cookie-guard

注意

  • 只支持 Windows(靠 schtasks 和启动文件夹)
  • 桌面版 profile 叫 desktop;用别的 profile 就把 --profile desktop 换掉
  • 如果提示 profile "desktop" is managed exclusively by the Electron application,说明桌面版不让命令行管理——改用插件管理器安装

用起来

装好后打开 设置 → Cookie 清理:

项说明
启用关掉会把系统计划任务和启动垫片一起撤掉
每天 / 每隔二选一。每天=固定时刻(默认 20:00);每隔=每 N 分钟(1–1439)
清多少只清 dsh-auth-*(推荐)或整个 Cookies 文件换掉
留备份清理前复制一份,保留最近 3 份
立即清一次登记成「等 DSH 完全退出后执行」,最多等 6 小时

卡片下方能看到计划任务状态、下次运行时间、登录垫片是否放置、Cookies 库大小,以及最近几条清理记录。

数据在哪

<DSH_HOME>/cookie-guard/
├─ config.json   配置
├─ guard.cmd     计划任务调用的入口
├─ guard.log     每次清理的记录
└─ backups/      备份(开了才有)

DSH_HOME 默认是 %USERPROFILE%\.dsh;设了环境变量就用那个。

两个要知道的限制

  1. DSH 开着的时候不会清。 库锁着,硬删会伤数据。所以「每天 20:00」那次如果 DSH 正好开着会跳过;兜底靠登录后那一次。
  2. 登录触发器用的是启动文件夹垫片,因为 schtasks /SC ONLOGON 和带 LogonTrigger 的 XML 都需要管理员权限。不喜欢就删掉启动文件夹里的 DSH Cookie Guard.vbs。

卸载

先关掉开关(会把任务和垫片删干净),再从插件管理器移除。

常见问题

Q:我已经打不开了,装不上插件怎么办?

手动救一次:完全退出 DSH(主进程、子进程都结束),删掉

%APPDATA%\@deepseek-ai\dsh-desktop\Network\Cookies
%APPDATA%\@deepseek-ai\dsh-desktop\Network\Cookies-journal

再启动,Cookie 库会自动重建,账号登录不受影响。然后再装这个插件,免得下次又攒满。

Q:日志里写「Cookies 仍被占用,跳过」?

说明清理那一刻 DSH 还开着。这是设计,不是失败。

Q:会不会把别的登录态删掉?

默认只删 dsh-auth- 开头的。平台账户登录用的是本地存的 grant(x-dsh-auth-token 头),不依赖这些 cookie。

License

MIT

Comments

Loading…

Similar plugins

dsh-cookie-sweep

by ALingStudio

DSH desktop plugin: sweeps leftover login-cookie files on every start so they cannot pile up past the 16KB request-header limit (HTTP 431 / "Web authentication failed").

Manifest valid

★ 0

MIT

JavaScript

Oct 31, 2026

dsh plugin --profile web add dsh-cookie-sweep

by kevindawn11-hash

Cap DSH desktop session cookie lifetime to avoid HTTP 431 / Web authentication failed startup crash. 修复 DSH 桌面端 dsh-auth-* cookie 累积导致的启动崩溃。

Security & AuditManifest valid

★ 2

MIT

JavaScript

Oct 31, 2026

dsh plugin --profile web add dsh-cookie-guard

Keeps DeepSeek Harness desktop dsh-auth-* session cookies bounded by deleting stale ones during the token exchange performed on every launch, so random-port accumulation cannot reach the 16 KiB reques

Development & InfrastructureManifest valid

★ 0

dsh plugin --profile web add dsh-cookie-fix

by dududreamer

Collapses the port-suffixed dsh-auth-* cookie pile so the DeepSeek Harness desktop shell never exhausts Node's 16 KB request-header budget.

Manifest valid

★ 0

MIT

JavaScript

Nov 1, 2026

dsh plugin --profile web add dsh-cookie-janitor

by zhkkjF

Raises the DSH Desktop Host header budget to 128 KiB and prunes stale dsh-auth cookies only on the launch-token response that mints the replacement, so random-port launches cannot lock the desktop out with HTTP 431.

Security & AuditDevelopment & InfrastructureManifest valid

★ 1

MIT

JavaScript

Nov 7, 2026

dsh plugin --profile web add dsh-cookie-sentinel

by Yazzyk

DeepSeek Harness (dsh) 插件:在 Web GUI 里手动点选文件或目录,屏蔽 agent 对它们的读取、搜索、写入与编辑。A dsh plugin that denies an agent read/search/write/edit access to chosen files and directories, picked from the plugin's own We

Security & AuditUI & ExperienceDevelopment & InfrastructureManifest valid

★ 3

MIT

JavaScript

Nov 8, 2026

dsh plugin --profile web add dsh-file-shield