Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

dsh-rolling-context

Latest version: v0.1.2

Overview

Last scanned
28 Nov 2026
Published
28 Nov 2026
npm package Publisher: hyyh
2 Versions

Scan summary

dsh-rolling-context was last scanned on 28 Nov 2026 at version 0.1.2. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: 2 versions, all published on 28 Nov 2026.
  • Findings: No rules fired in version 0.1.2.

Versions

2 versions published
Versions and the rules that fired in each
VersionPublishedStatus
0.1.2 LATEST 28 Nov 2026 No rules fired
0.0.0-stage 28 Nov 2026 Not shown

No rules fired in 0.1.2

Findings

Findings for v0.1.2. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.

The score describes 0.1.2; other versions have their own rules, not their own score.

README

The publisher’s own README, as collected from the registry.

dsh-context-window

npm 包名:dsh-rolling-context(dsh-context-window 已被其他作者占用)。

给 DeepSeek Harness(dsh / dsh-go)用的滚动上下文压缩插件:

  • 自动压缩时保留最近 N 个真实用户轮次原文,更早历史折叠成一条滚动摘要;
  • 总结规则、总结用的 provider/model 全部可配;
  • 复用 stock compaction-basic 的压缩事务、锁、溢出恢复和 tool-result 剪枝,不 fork;
  • 桌面版在 Plugins 页改配置,dsh-go 在 App 的插件设置页改配置。

运行时目标:dsh 0.2.2-rc.1(dsh-go Android 本机引擎)和 0.2.2-rc.2(Desktop)。 与 billion-context 不能同时启用:两者都想接管压缩。

安装

Desktop(tauri / web profile)

发布到 npm 后:

"C:/Users/jayma/AppData/Local/deepseek-harness/bin/dsh.cmd" plugin --profile tauri add dsh-rolling-context

安装前先移除 billion-context,装完重启 App:

dsh plugin --profile tauri remove billion-context

注意:

  • 用 App 自带的 dsh(0.2.2-rc.2),不要用 resources/dsh 里 0.2.0 的随包旧 CLI。
  • 不要用本地 file: / 目录链接安装:Desktop 的启动恢复会把它当 “orphaned internal preset plugin” 移除,或只当本地 HMR 插件而不应用 bundle patch。
  • 装好后在 Plugins 页看到的是 bundle 名 dsh-rolling-context,不是 tgz 文件名。

如果 npm 暂时不可用,可以用 HTTP tarball URL 作为 fallback:

cd C:/Users/jayma/cw-serve
python -m http.server 8765 --bind 127.0.0.1
# 另一个终端:
"C:/Users/jayma/AppData/Local/deepseek-harness/bin/dsh.cmd" plugin --profile tauri add \
  "http://127.0.0.1:8765/dsh-rolling-context-0.1.2.tgz"
dsh-go(Android 本机引擎)

本机引擎 profile 是 web。如果 dsh-go 是远程连这台电脑,它用的是 Desktop 的 tauri profile,重启 Desktop 后直接生效,不需要在手机上装。

如果 dsh-go 用的是手机本机引擎,发布到 npm 后直接:

dsh plugin --profile web add dsh-rolling-context

或让 PC 在 LAN 上提供 tarball(手机与 PC 同一 Wi-Fi):

cd C:/Users/jayma/cw-serve
python -m http.server 8765 --bind 0.0.0.0
# 手机访问 http://<PC-LAN-IP>:8765/dsh-rolling-context-0.1.2.tgz

装完在 App 的「本机引擎」页重启引擎。

配置

在桌面 Plugins 页找到 context-window-settings,或在 dsh-go 的插件设置页找到它。所有字段都是 volatile,保存后下一次压缩生效。

字段 默认 说明
enabled true false 时完全退回 stock 行为(等于是停用本插件)
auto true false 时自动压缩不运行,/compact 仍可用
retainTurns 8 原文保留的最近真实用户轮数(1–1000)
trigger pressure pressure(token 压力)/ turns(轮数)/ both
triggerTurns 0 轮数触发阈值;0 = retainTurns + 4,必须大于 retainTurns
thresholdRatio 0.8 压力阈值 = min(W×ratio, W−输出预留−headroom)
headroomTokens 65536 压力余量
summarizationProvider '' 总结 provider;与 model 必须同时为空或同时填写
summarizationModel '' 总结 model;空对 = 跟随当前会话模型
summaryMaxTokens 65536 总结输出上限
summaryInstruction '' 空 = 内置结构化指令;非空 = 完整覆盖正文
summaryRules '' 追加规则,每行一条
summaryLanguage auto auto / zh / en

示例(在 Plugins 页填等价内容):

enabled: true
auto: true
retainTurns: 8
trigger: both
triggerTurns: 12
summarizationProvider: opencode-go
summarizationModel: deepseek-v4.1-flash
summaryLanguage: zh
summaryRules: |
  Preserve exact file paths, commands and error strings.
  Call out user corrections and explicit constraints.

手动触发

/compact 就是手动触发,不需要新命令:

  • dsh-go:输入框 / → “压缩”;
  • Desktop:输入框 / → Compact。

它走引擎的 dsh-command-compact → ctx.compaction.compactNow()。本插件替换的是 backend,所以同一个 /compact 会使用你配置的总结规则、总结模型,以及同一个 N 轮窗口:只压掉第 N 轮之前的历史,保留最近 N 轮原文。

注意:

  • 如果当前历史本来就不超过 retainTurns 轮,/compact 会返回 “No compactable history yet.”(没有可压的旧区间)。
  • dsh-go 只对 /compact 给 30 分钟长超时;不要另起 /cw 等名字做主入口,否则长摘要可能被默认超时取消。

压缩后的上下文长什么样

压缩成功后,模型看到的 surface 大致是:

[0] system/message                     系统提示词,永远保留
[1] user/message (compact-checkpoint)  摘要注入在被压旧区间的起始位置
    preamble + <compacted-summary> + 摘要正文 + </compacted-summary>
[2..] 最近保留的 N 轮                   自动压缩保留的原文
  • 注入方式是 surfaceOp: { op: 'replace', startSeq, endSeq },不是追加到末尾。
  • 对模型可见的上下文是覆盖:旧区间被 shadow,不再发送。
  • 对持久化日志不是删除:session log 是 append-only,旧事件仍在,compaction/summary.shadowedSeqs 记录被 shadow 的 seq。
  • 不覆盖 system prompt、工具声明、保留的 N 轮,以及 checkpoint 之后的任何消息。
  • 下一次压缩可能把上一个 checkpoint 也压进去,新摘要会在同一位置替换它并合并旧事实,所以是一份滚动摘要。
  • dsh-go 的原生聊天记录不显示 checkpoint(它不是 human prompt),只显示 /compact 命令行和“压缩中”活动条;桌面 Web 会在该位置显示一个 compaction 标记/摘要卡。原始摘要可在 session log 的 compaction/summary 事件里查看。

与 stock 的差异

  • 自动压缩的保留策略从“按 token”换成“按真实用户轮数”。
  • 总结指令可自定义(默认正文来自 stock,追加了语言规则)。
  • 总结 provider/model 来自插件配置,而不是会话路由(空对时仍跟随会话)。
  • /compact 也使用同一套 N 轮窗口(复用 stock 的 idle-maintenance 事务,只替换区间选择);溢出恢复和 model-switch 安全压缩仍走 stock 逻辑,溢出时忽略 N 轮窗口,最大化压缩。

Base-only compositions

web / Desktop / dsh-go 都把 compaction-basic 挂在 agent preset 里,本插件通过 internal/config gate 替换。只有 base 这种把 compaction-basic 挂在顶层的组合,patch 不能把已有行改名(loader 会报 name mismatch 并跳过)。这种组合需要手工:

# <profile>/cordis.patch.yml
- id: compaction-basic
  disabled: true
- insert:
    - id: context-window-backend
      name: 'dsh-rolling-context/backend'

并确保 dsh-rolling-context bundle 已安装、context-window-core 行存在。普通用户的 Desktop / dsh-go 不需要这一步。

已知限制

  • 手动 /compact 和自动压缩共用同一个 retainTurns;没有单独的“手动保留轮数”配置。
  • checkpoint 外层 preamble 和 <compacted-summary> framing 固定,不能通过本插件改。
  • 自动压缩的轮数窗口不是硬约束:压力重试、model-switch 或 overflow 可能压到 retainTurns 以下。
  • token meter 对中文按 4 字符/token 会低估;中文长会话建议 trigger: both 或 turns。
  • internal/config gate 依赖 Cordis 内部事件;dsh 升级后需要重新验证(gate 会打日志,改写数为 0 时检查 preset 注入)。
  • 与 billion-context 冲突:检测到它会自动 inert,需要移除后重启。

开发

npm install
npm test
npm pack --dry-run

测试是 Node 内置 node:test,不需要额外测试框架。

回滚

dsh plugin --profile <profile> remove dsh-rolling-context

重启后 bundle patch 层消失,stock compaction-basic 恢复。若 Plugins 页写过 context-window-settings 的覆盖,需要在 profile 的 cordis.patch.yml 里删掉对应条目。

OX Radar and Response Center

Find threats in your stack.

OX Radar can check high-priority threats, like critical package CVEs, against your context.

Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.

Where it’s listed

The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).

  • npm dsh-rolling-context

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Powered by Read the latest findings

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

CVE

Java4Shell (CVE-2026-114938): Easy to Crash, Hard to Exploit — Less Than 0.12% of JVMs Estimated at Risk of RCE

Copy of Template Design OX Blog (2)
Research

NGINX2Root: Five Critical NGINX Flaws Expose Web Servers to Remote Code Execution

Plug and Pray: Your AI Agents Are Taking Orders From Strangers
Research

Plug and Pray: Your AI Agents Are Taking Orders From Strangers

Frame 2085668439 (1)
Group 1261154229