Chuyển đến nội dung chính

dsh-manual-compact

Đã xác minh

dsh-manual-compact · v0.1.0 · MIT · Giao diện web

Manual context compaction for DeepSeek Harness: keep the latest N conversation items with stop or batch mode and a per-session compaction archive — embedded in the context meter popup when the meter panel slot exists, or a composer button otherwise.

Cài đặt

dsh plugin add dsh-manual-compact

Xác nhận layer đã áp bằng dsh --profile default --dump-config — xem hướng dẫn cài plugin.

Mã nguồn

Thẻ

Tác giả

Readme

dsh-manual-compact

手动上下文压缩插件(DeepSeek Harness / DSH)。

点击上下文圆圈(或输入框旁的"压缩"按钮)→ 选择保留最近 N 条 → 停止或分批压缩 → 每次压缩都有存档可查。

功能

  • 保留最近 N 条:5 / 10(推荐)/ 20 / 30 / 50 / 自定义
  • 处理方式
    • 完成一批后停止
    • 分批处理直到完成
  • 压缩存档:每次压缩显示时间、条数、约计 tokens,点击展开完整摘要
  • 调用 DSH 官方 compaction API(compaction.compactRegion):不拆开工具调用对、会话忙时自动拒绝、失败不改动会话

安装

dsh plugin --profile web add dsh-manual-compact

安装后重启一次 DSH。

界面位置

  • 如果 DSH 带有 conversation.input.contextMeterPanel Slot(对应上游补丁),控件嵌入上下文圆圈弹窗
  • 否则自动降级为输入框工具行右侧的"压缩"按钮(弹窗面板)

工作原理

  • 浏览器端通过 manual-compact 设置命名空间写入 request(会话、保留数、模式)
  • 宿主端读取请求,经当前会话的 compaction 服务执行,把结果写回 lastRun
  • 存档来自会话日志中已落地的 compaction/summary 事件,随会话持久化

License

MIT