133563825as-ai/oha-whale-compress
DeepSeek Harness「压缩会话」插件:自定义 token 阈值自动压缩、一键压缩当前会话、输入框常驻按钮可开关。哦鲸鲸出品。
Project Overview项目介绍
dsh-oha-whale-compress is a session-compaction plugin built specifically for the DeepSeek Harness (DSH) runtime, shipped under the "Oha Whale" brand alongside dsh-session-manager. It exposes two UI entry points: a sidebar-bottom icon that opens the full panel, and a persistent button under the chat composer that opens a stripped-down "half" panel. The full panel exposes the compression provider and model, an auto-compress toggle, and the threshold input; the half panel collapses to just two toggles plus the trigger button. Installation is performed with dsh plugin --profile web add dsh-oha-whale-compress, and a source-tree install is supported via file:/root/dsha-oha-whale-compress. The plugin only hard-injects webServer; every other service is fetched lazily through ctx.get().
The auto-compress logic replaces DSH's window-ratio trigger (contextWindow * thresholdRatio) with an absolute token threshold defaulting to 409600 (≈400K), configurable and persisted to ~/.dsh/storages/dsh-oha-whale-compress/config.json. It neutralizes the parent's ratio check by setting thresholdRatio to a dummy 0.02, then intercepts compactIfNeeded('pressure') from the agent/pre-step hook to enforce the real cutoff. A context-overflow fallback path always fires regardless of toggles or thresholds. Manual compression is exposed via POST /oha-whale-compress/compress and goes through ctx.get('commands').execute(agent, '/compact', …); companion routes /configure, /status, and /icon (image/png, max-age=3600) round out the HTTP surface.
For auto-compress to actually use the new threshold, the preset's engine line must be swapped to dsh-oha-whale-compress/engine; the README provides an injectPreset({ presetPath, userRoot, mode: 'inject', expectedCount: 4 }) snippet that batch-updates the four presets inlined in cordis.patch.yml. The injector enforces a five-rule contract: writes only under the user root, never re-serializes YAML (preserving comments and !!js), unique-or-count check, backups first, and idempotency. Modifying src/* or the preset engine line requires restarting DSH (the loader does not watch preset files); modifying client/client.js only needs a browser refresh. The package is MIT-licensed and requires @deepseek-ai/dsh-compaction, dsh-compaction-basic, and @deepseek-ai/dsh-agent-preset to be present, with package.json exports declaring ./engine to avoid ERR_PACKAGE_PATH_NOT_EXPORTED.
dsh-oha-whale-compress 是 DeepSeek Harness(DSH)专属的会话压缩插件,归属「哦鲸鲸」家族,与 dsh-session-manager 同品牌设计。它通过侧边栏底部入口和输入框下方的常驻按钮触发,提供完整面板与减半面板两种形态:完整面板可配置压缩所用的 provider、model、自动压缩开关与阈值;减半面板仅保留开关与触发按钮。安装方式为 dsh plugin --profile web add dsh-oha-whale-compress,亦支持 file: 源挂载,仅需挂载 webServer 服务。
自动压缩的核心改进是把判定权从框架的窗口比例(contextWindow * thresholdRatio)拆出,由本插件用绝对 token 数(默认 409600,约 400K)独立触发,并在模型上下文溢出时无条件兜底。手动压缩走 POST /oha-whale-compress/compress,由插件调用 ctx.get('commands').execute(agent, '/compact', …) 触发,不直写会话日志;HTTP 路由还包括 /configure、/status、/icon。配置写入 ~/.dsh/storages/dsh-oha-whale-compress/config.json,含 autoCompress、autoThresholdTokens、dockButton 等字段。
插件依赖 @deepseek-ai/dsh-compaction、dsh-compaction-basic 与 @deepseek-ai/dsh-agent-preset,并要求 preset 内联 cordis.patch.yml 中将引擎名替换为 dsh-oha-whale-compress/engine(用 injectPreset 注入或还原)。插件不公开保留条数选项(retainTokens: 40000 写在托管块),改源码需重启 DSH,改 client 只需刷新页面。许可为 MIT。
请帮我安装这个 DSH 插件。安装前先完成【兼容性检查 + 安全性检查】,检查通过再动手。
插件:oha-whale-compress(133563825as-ai/oha-whale-compress)
仓库:https://github.com/133563825as-ai/oha-whale-compress
本站详情页:https://www.yhbd.top/plugins/133563825as-ai-oha-whale-compress/
本站登记:类型 plugin · 归类 原生 DSH 插件 · 许可证 MIT · ⭐ 2 · 最近提交 2026-09-27 · 主语言 JavaScript
按下面顺序执行,每步先把结论告诉我,再进入下一步:
【1 兼容性检查】
① 我这边:DSH 版本、Node 版本、操作系统、当前 profile(web / desktop)。
② 读它的 README、package.json、插件 manifest,列出它要求的 DSH 版本 / Node 版本 / 操作系统 / 外部依赖 / 需要另外先装的运行时。
③ 逐条比对,结论只写「满足 / 不满足 / 未知」三种;不满足的给出可行替代方案。
④ 检查是否和我已装的插件冲突:命令名重复、skill / tool 重名、端口占用、重复注册的 MCP server。
【2 安全性检查】
① 仓库可信度:和上面「本站登记」是否一致;star / fork 数、创建时间、最近提交,是否归档或长期停更。
② 安装脚本:逐行看 package.json 的 preinstall / install / postinstall,以及 install.sh、setup.ps1 之类脚本。出现 curl|bash、下载后直接执行、混淆代码、访问与插件功能无关的域名,立刻停下来告诉我,不要继续装。
③ 依赖:列出新增依赖,标出无人维护、或与知名包拼写近似的可疑包(typosquatting)。
④ 权限与副作用:它会读写哪些目录、访问哪些域名、需要哪些 DSH 权限(filesystem / network / shell / clipboard 等),以及怎么卸载和回滚。
⑤ 如果它要求 sudo / 管理员权限,或权限明显超出功能所需,先停下来问我。
【3 安装】
上面两步没有「不满足」和「高危项」时才执行;用官方推荐方式安装,不要自行提权。
【4 汇报】
用表格输出:检查项 / 结论 / 依据 / 是否需要我决策。拿不准的一律写「未知」并说明要我怎么确认——不要猜,也不要替我决定。
Send this message to DSH in your current session: it verifies compatibility and security first (answering met / not met / unknown item by item) and only installs once everything checks out — it will stop and ask you if it finds a high-risk item. The box scrolls; the copy is the full prompt. CLI install commands may not be accurate across systems, so DSH is the safer route.把上面这条消息直接发给当前会话里的 DSH:它会先核对兼容性与安全性(逐条给「满足 / 不满足 / 未知」),确认没问题再安装,有高危项会停下来问你。框内可滚动,复制到的是完整提示词;安装命令不一定准确,发给 DSH 更稳。
- Only 2 stars - very few users, little community feedback星标只有 2,几乎没人在用,遇到问题缺少社区反馈
DSH walks through these 9 checksDSH 会逐条核对这 9 项
Compatibility兼容性
- DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
- External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
- Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册
Security安全性
- Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
- Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
- curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
- Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
- Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
- Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式
Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。
Or use CLI install (for developers)或使用命令行安装(适合开发者)
CLI Install命令行安装
dsh plugin --profile web add dsh-oha-whale-compress
把 133563825as-ai/oha-whale-compress 加入你的 DSH 配置(web profile)即可启用。
READMEREADME
dsh-oha-whale-compress
DeepSeek Harness 专用「压缩会话」插件(哦鲸鲸 family,与 dsh-session-manager 同品牌设计)。
功能
- 侧边栏底部入口(挨着「会话管理」):点开完整面板。
- 完整面板:自动压缩开关与阈值 · 输入框下方按钮开关 · 压缩用 provider / model · 一键「压缩当前会话」。
- 自动压缩:上下文估算超过阈值时自动压一次。阈值是绝对 token 数,可开关、可改(默认
409600,即 400K)。 - 输入框下方常驻「压缩」按钮:可一键显示 / 隐藏,关掉后输入框下方恢复干净;点它开的是减半面板。
- 减半面板:只留两个开关 + 压缩按钮 + 结果,去掉选 API、保留条数与提示词。
- 查看结果:展示当前会话大小(节点数 / token 数)与本次压缩的状态 / checkpoint 文本。
两个开关在完整面板与减半面板里都显示 —— 减半面板正是从输入框下方的按钮点进来的,开关得在它自己面前可调。两个开关都是拨动即存;阈值输入在失焦或回车时落盘(边打字边存会把中间态写进配置)。
自动压缩怎么工作
框架自带的自动压缩按窗口比例判定(contextWindow * thresholdRatio),表达不了「到 400K 就压」这种绝对值。本插件的做法是把判定权拆开:
- 注入 preset 时把父类的
thresholdRatio让到一个哑值(0.02),父类从此不再实际把关 —— 但仍保留 2% 窗口的兜底,万一插件那条路径失效也不至于彻底失控; - 子类
WhaleCompactionEngine.compactIfNeeded接管「步进压力」这一路:- 未到
autoThresholdTokens→ 直接返回null,父类根本不会跑; - 到了阈值 → 交给父类,此时它的哑阈值必然已被越过,压缩照常发生;
- 未到
context-overflow(模型已经报窗口溢出)是兜底路径,不受阈值与开关管辖,一律放行。
配置落在 ~/.dsh/storages/dsh-oha-whale-compress/config.json:
| 字段 | 默认 | 含义 |
|---|---|---|
autoCompress |
true |
自动压缩总开关 |
autoThresholdTokens |
409600 |
触发线(绝对 token 数) |
dockButton |
true |
输入框下方按钮是否显示 |
为什么 preset 里会多出一段托管块
自动压缩保留多少由框架的 selectCompactableRange 决定 —— 那是 dsh-compaction-basic 的内部函数,既不在 @deepseek-ai/dsh-compaction 的导出里,插件也触及不到。所以面板没有、也不该有「保留多少条」这类选项(早期版本有过一个 keepN,从头到尾没接上,已删除)。实际保留量写在这段托管块里:retainTokens: 40000,即压缩后保留尾部约 40K tokens。
retainTokens 用绝对值而不是 retainRatio,一是语义直接,二是可以绕开上游「retainRatio 必须小于 thresholdRatio」的加载期校验(那条校验只在比例存在时触发)。托管块由注入器写入、由还原精确删除,不会碰你自己写的 config。
触发链路
侧边栏 / 常驻按钮 → POST /oha-whale-compress/compress {sessionId}
→ host 取 agent = ctx.get('agents').get(sessionId)
→ ctx.get('commands').execute(agent, '/compact', [], signal)
→ (command-compact 在压缩 group 里执行 compactNow,真正压缩)
→ 返回 { ok, message }
手动压缩必须走框架
ctx.get('commands').execute(agent, '/compact', ...),绝不直写会话日志。
自动压缩走的是另一条路:agent/pre-step → compactIfNeeded('pressure') → 本插件先判阈值 → 再交父类。
HTTP 路由
| 路由 | 方法 | 作用 |
|---|---|---|
/oha-whale-compress/configure |
GET / POST | 读 / 写面板配置(provider / model / keepN / promptTemplate / prompt / autoCompress / autoThresholdTokens / dockButton) |
/oha-whale-compress/status |
GET | 当前会话大小(?sessionId=,nodes/totalTokens),非破坏性 |
/oha-whale-compress/compress |
POST | {sessionId} → 触发 /compact |
/oha-whale-compress/icon |
GET | 返回 assets/icon.png(image/png,max-age=3600) |
Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →
liangmianya/dsh-synapse
alaliqing/claude-paper
acryldev/acryl
omdsh-dev/dsh-annotation
Anionex/dsh-turn-rewind
Tyan66666/billion-context-dsh
qkycir-123/dsh-run2skill