DSH HUB
首页插件商店插件包社区排行榜资源发布指南
插件源码
返回插件目录

FukeWang /

FukeWang/dsh-context-squeeze

已验证

Compresses aged conversation turns into structured summaries with on-demand expansion, cutting context cost.

★ 1 Stars0 Forks0 IssuesN/A 社区评分0 已确认安装
查看 GitHub项目主页
README来源: main@75af82e8

Context squeeze

Keeps long conversations inside a small context window: each aged turn is replaced by one structured summary, the newest turns stay verbatim, and the agent can expand any summary back to the original log on demand. The full transcript stays in the session log and in the UI.

Cost

In the author's own tests, the average session cost was about 40% lower. That figure comes from the author's own long sessions, not a controlled benchmark; the gain depends on conversation length and how much tool output the session produces.

How it works

After a turn ends and the agent is idle:

  1. The oldest surface span outside the retained window is selected (the newest 2 completed turns stay verbatim by default).
  2. The cut is aligned to tool-call / tool-result pairs so a tool call is never split.
  3. The plugin's own summarization prompt turns the span into a structured checkpoint (goals, decisions, facts, files, errors, next steps, expandable clues).
  4. The span is replaced through the Harness surface replacement primitive, with a compaction/summary record that carries the shadowed token count and the summarizer usage.

The expand_context tool

expand_context({ id?: "squeeze-…", query?: "keyword", maxChars?: 8000 })
  • Without id: list the squeezed spans of this session.
  • With id: return the original messages, truncated to maxChars.
  • With query: only messages mentioning the keyword.

Configuration

Configure the context-squeeze row in cordis.patch.yml:

Field Default Meaning
enabled true Master switch.
retainTurns 2 Newest completed turns kept verbatim.
maxRegionChars 60000 Input cap for one squeeze.
minRegionChars 1200 Skip smaller spans.
maxSummaryTokens 1200 Summary output cap.
messageChars 4000 Per-message cap while rendering the span.
expandChars 8000 Default expansion budget.
expandMaxChars 24000 Hard expansion cap.
timeoutMs 180000 Summarizer timeout.

Install

dsh plugin --profile web add dsh-context-squeeze

Host-only plugin; no browser UI. Requires DSH 0.2.2-rc.5 or later.

Limits

  • Fixed overhead (system prompt, tool schemas, runtime context) is not compressed.
  • The newest retainTurns turns and the current turn stay verbatim.
  • When a summary would be at least 90% of the original size, the original is kept.
  • Subagent sessions are skipped.
  • Coexists with the built-in /compact; both write standard compaction/* records.

License

MIT. See LICENSE.

—/ 5

暂无评分

已验证 DSH bundle

Commit 75af82e8aeae

社区评论

还没有评论,来写第一条。

DSH HUB

社区维护的 DSH 插件索引。不是 GitHub 或 DeepSeek AI 的官方产品。

社区资源API关于