DeepSeek Harness Plugin Hub

发布与管理完整 Harness Profiles,发现适合你的插件。

探索

插件目录环境预设文档中心动态

社区

发布插件联系我们报告问题

相关链接

Plugin Hub GitHubDeepSeek Harness 官方项目系统状态隐私说明
© 2026 DeepSeek Harness Plugin HubPowered byPaxTech

独立、非官方社区项目,与 DeepSeek 官方无隶属、授权或背书关系。

DeepSeek Harness Plugin Hub
ProfilesPlugins分类动态文档登录管理 Profiles
ProfilesPlugins分类动态文档登录
← Plugins
C

dsh-context-decay

Context Decay

面向 DeepSeek Harness 的模型驱动有损上下文衰减:内联位置锚点、多跨度摘要、显式丢弃、分层重新压缩、不可恢复。

插件会安装到这里;不确定时保持 web。

npx -y @deepseek-ai/dsh plugin --profile web add github:LDyty/dsh-context-decay#3d0f368b6a8d19aa01dd763afdb5689cae3bb06f
README兼容性版本

兼容性与来源证明

Context Decay 以 dsh-context-decay 发布,当前版本为 0.1.0。Plugin Hub 会校验它的 manifest,并保存精确安装来源,便于复现安装结果。

DSH 兼容范围
*
运行环境
web
发布来源
github
Registry 更新时间
2026/10/20

版本

0.1.0stable
2026/10/20

相关插件

正在加载相关插件…

最新版
0.1.0
DSH
*
HMR
重启进程
Tree shaking
已声明 sideEffects: false
解包体积
未提供
文件数
未提供
Surface
web
许可证
MIT
发布源
github
GitHub
★ 0
周下载
0
最近提交
2026/11/2
查看源码 ↗
README Badge

点击下方 Badge 复制 Markdown,粘贴到 README 即可。

这是你的 Plugin?认领权益 · 优先安全扫描

验证 package.json 声明的 GitHub 仓库,即可管理这个公开页面。认领后,Hub 会优先安排当前版本的安全扫描,并在通过后公开展示结果。

认领这个 Plugin →
报告问题

相关插件

继续浏览 memory-context 分类下经过校验的插件。

Experimental Session Search@deepseek-ai/dsh-experimental-session-search为 Agents 提供搜索和读取当前工作区早期会话的工具。Hindsight Coding Agents@vectorize-io/hindsight-coding-agents面向编程代理的仅反思式 Hindsight 长期记忆(可插拔支持多种运行框架:opencode、……),自动在后台导入(无需设置 CLI)。Contextdsh-context用于上下文洞察和管理的 DeepSeek Harness 插件,提供上下文仪表板和上下文命令,帮助了解上下文的构成及其演变过程。Mnemondsh-mnemon面向 DeepSeek Harness 的可组合、基于视图的上下文。开箱即用的可插拔来源与策略、分层记忆和自我演进技能。

README

dsh-context-decay

简体中文

Model-driven, lossy context decay for DeepSeek Harness.

The model decides when and what to compress. Finished spans are replaced by self-written summaries; the current turn is always kept. There is no recovery: the summary is the only surviving record.

Install note: This is a manual-install plugin: it requires a DSH checkout with the modelMessageDecoration seam and is not a drop-in plugin-market bundle (see Requirements).

Sidebar panel: effective-window pressure, total-window occupancy, reminder state, and context-ordered position space

What it does

  • Inline position anchors. Every model-addressable message with a visible text block is prefixed with ⟦p<number>⟧; tool-call-only assistant turns are unanchored by design. Compression ranges use those anchors directly: ⟦p<from>⟧ summary ⟦p<to>⟧. Anchors are presentation, never part of the content.
  • Copied anchors removed. If the model starts a reply with one or more anchors, the leading run is stripped at the request boundary and again before the reply is committed, so the transcript and later requests stay clean.
  • Model-selected spans. The model calls compress with one or more half-open ranges and writes each summary itself. No extra summarizer request. Split around content that must stay live; pass all consumed spans in one call so the prefix is not invalidated repeatedly.
  • Lossy by design. Compressed content is gone. There is no decompress, no original-text search, and no external table. The summary must be self-contained.
  • Tool results are compressible. All results of one assistant tool-call message must stay in the same span. A boundary inside that group is rejected; the plugin never silently widens a span.
  • Current turn protection. The active turn and its tool results cannot be compressed. If the turn starts with unanchored system/runtime messages, a to boundary at its first visible anchor keeps those messages and compresses only the history before the turn; "end" remains the end-of-compressible-history sentinel.
  • Tiered re-compression. Compressing a live summary block again produces a tier-2 summary; larger merges increase the tier. drop removes a block completely with no tombstone.
  • Pressure without automation. The plugin reports context pressure and injects reminders when context grows noticeably or crosses a warning level. It never compresses automatically; the model decides.
  • Live panel + audit. A sidebar panel shows pressure, blocks, positions, request counts, and the reminder ledger. An optional JSONL audit records each request and compression.

Requirements

  • DeepSeek Harness 0.2.1-rc.2 with the local host patch in patches/dsh-model-message-decoration.patch applied. Stock DSH does not expose the decoration seam; there is no runtime fallback. Installation alone is not enough: rebuild the host after patching.
  • Node.js >= 22.19.
  • A web profile. The client half needs the sidebar/session/locale UI packages listed in package.json.
  • The bundle patch disables official automatic compaction (compaction-basic.auto: false), keeps the manual /compact command, and disables the in-place surface rewriters (tool-result-pruner, image-offload) when those rows exist. /compact remains an emergency host fallback; its checkpoint is not a context-decay block.

Install

Manual patched install:

# 1. Apply the host patch to a DSH checkout and rebuild the host.
git -C /path/to/deepseek-harness apply /path/to/dsh-context-decay/patches/dsh-model-message-decoration.patch
pnpm -C /path/to/deepseek-harness install
pnpm -C /path/to/deepseek-harness build

# 2. Install this plugin into a profile (checkout or tarball).
dsh plugin --profile web add /path/to/dsh-context-decay
# or: dsh plugin --profile web add ./dsh-context-decay-0.1.0.tgz

# 3. Restart the web server and open the profile.
dsh web --profile web

See docs/INSTALL.md for the full patched-checkout workflow, Windows commands, verification, updating, and rollback.

Tools

ToolPurpose
compress({spans:[{from,to,summary,topic?}]})Replace one or more half-open ranges with self-written summaries. from/to are visible anchor texts such as "⟦p12⟧" (bare "p12" and integer 12 also work); to may also be "end". Several non-overlapping spans per call are allowed. Tool-group edges are rejected.
drop({from,to})Remove exactly one live summary block. Use the block's printed anchor pair; "end" is allowed for a tail block. No tombstone, no recovery.

A live summary block prints its pair inline as ⟦p<from>⟧ summary ⟦p<to>⟧; use that pair for drop. The sidebar panel shows pressure and the block ledger, so no extra status tool is needed.

Examples:

# one span
compress({spans:[{from:"⟦p4⟧", to:"⟦p9⟧", summary:"Read the three requirements files; constraints are ..."}]})

# two non-overlapping spans in one call
compress({spans:[
  {from:"⟦p4⟧", to:"⟦p9⟧", summary:"Read the requirements; constraints are ..."},
  {from:"⟦p9⟧", to:"end", summary:"Implemented the parser and tests; ..."}
]})

# drop one live summary block
drop({from:"⟦p4⟧", to:"⟦p9⟧"})

The anchor ids above are illustrative; use anchors visible in the current session.

Configuration

KeyDefaultMeaning
enabledtrueEnable the plugin.
contextWindowTokensroute valueOverride the total context window.
reservedOutputTokensroute valueOverride the reserved output budget.
defaultContextWindowTokens128000Fallback when the route has no window.
growthTokens20000Normal reminder after this much growth since the last reminder.
warnRatios[0.70, 0.81, 0.95]Warning levels as fractions of the effective window.
reminderCooldownTurns1Minimum turns between reminders.
maxSpansPerCall8Maximum spans in one compress call.
minSummaryChars20Minimum summary length.
maxSummaryChars8000Maximum summary length.
maxMissTokensnullOptional one-time miss guard.
maxPaybackRequestsnullOptional payback guard.
auditfalseWrite request/compression audit JSONL.
debugfalseVerbose plugin logging.

The effective window is total window - reserved output. The model sees pressure as a fraction of the effective window. The panel labels that percentage as effective pressure, shows the total and reservation, and adds a total-window occupancy line for direct comparison with the built-in context meter. Pressure, reminder, and request facts are kept per session, so switching sessions updates the panel.

How it works

The host patch adds a modelMessageDecoration service. The plugin registers a decoration provider that prefixes the messages selected by the replay state; the agent loop, token meter, and request payload all apply the same decoration. Positions come from the replayed surface, not from message text. Compressions append compaction/start, compaction/summary, a replacement user message, and compaction/end; replay rebuilds blocks, tiers, and the free list.

See docs/ARCHITECTURE.md for the state model, invariants, and failure modes.

See docs/PROMPTS.zh-CN.md for a Chinese translation of the model-facing prompts, tool descriptions, reminders, and error copy.

Limitations and non-goals

  • No recovery. There is no decompress, search, or spill archive. This is deliberate; it is also the main trade-off.
  • Requires a patched host. The decoration seam is not upstream. Without it the plugin cannot safely present anchors or replay positions.
  • No automatic compression. Reminders are advisory. A model may ignore them; the budget stays protected by the request guard, not by silent compaction. The official automatic policy is off; manual /compact remains available.
  • /compact is a manual fallback. It runs the official backend and writes an official checkpoint, not a context-decay tier block. Use it only when a session is already too large for a normal request.
  • Manual install, not a market bundle. A market index cannot express the host-patch requirement, and engines.dsh cannot distinguish a patched host from a stock one. Distribute the checkout or tarball with the patch instructions until the seam is upstream.
  • One compression backend per profile. Do not run another compaction backend or an in-place surface rewriter alongside it.
  • Replay depends on the current event format. Compression replay uses the current surfaceOp and compaction event shape.

Development

npm install          # if building outside a DSH checkout
npm run build        # src/ -> lib/ (JS + declarations), client/ -> lib/client.js
npm run check        # typecheck only
npm test             # node:test suite against lib/

Local development can reuse a DSH checkout's TypeScript: set DSH_HARNESS_ROOT or place the checkout next to this package.

License

MIT. See LICENSE.