dsh-session-handoff

DSH PLUGIN记忆与知识

仓库 iuuuuuuuu/dsh-session-handoff

记忆与知识 L4 · 沙盒安装通过 安全审查:低风险 可信度:银 可安装插件
安装这个插件

为 DeepSeek Harness 提供记忆保留的会话交接:在旧会话因压缩失效前把上下文迁移到新会话,并抢救已卡死的会话。

一句话选型结论

按资料字段整理

dsh-session-handoff 是记忆与知识类的 DSH 可安装插件,验证等级 L4 · 沙盒安装通过,安全审查为低风险,列出 4 项功能,有可直接复制的安装命令。验证通过不等于安全:插件会读写文件、执行命令或联网,装前先到仓库确认它做了什么;涉及密钥或系统权限的,建议先在隔离环境试装。

分类记忆与知识 收录类型可安装插件 验证等级L4 · 沙盒安装通过 安全审查低风险
验证等级 L4 L4 · 沙盒安装通过
GitHub 星标 0 复刻 0 · 未关闭 issue 0
最近更新 2026-10-08 创建于 2026-10-08
README 13.0 KB 正文体量,越大说明说明书写得越细

安装

可安装插件
在 DSH 里执行,装完用 dsh plugin list 确认已挂上;标了 L4 / L5 的命令已在沙盒里真实跑通
dsh plugin --profile web add github:iuuuuuuuu/dsh-session-handoff
  1. 1
    确认版本与运行环境

    仓库没有标注兼容版本与 Node.js 要求,先确认你的 DSH 版本能装,再继续。

  2. 2
    执行安装命令

    在 DSH 里执行上面的命令;多包仓库要注意区分具体子包名,别装错包。

  3. 3
    确认已挂载

    用 dsh plugin list 查看列表里是否出现这个插件,出现即挂载成功。

  4. 4
    试跑并检查权限

    加载后跑一个最小用例,确认它能正常工作;同时看它申请了哪些文件、命令或网络权限。

兼容 DSH 版本未标注版本不匹配时安装会报错
Node.js 要求未标注来自仓库 package.json 的 engines 字段
前置依赖无需要同时安装的同级依赖
npm 包名未发布到 npm可用 npm view 查看包信息

能做什么

4 项功能
字段来自项目仓库与公开索引,中文说明由本站标注

dsh-session-handoff:为 DeepSeek Harness 做会话记忆交接的 DSH plugin

  • 会话压力监测与阈值告警
  • 四层记忆提取与有界摘要
  • 一键 /handoff 生成后继会话
  • 源会话最后归档可回读

适用场景

记忆

上游标签

compactioncontext-windowdeepseek-harnessdshdsh-pluginpluginsession-handoff

验证等级与安全审查

L4 · 沙盒安装通过
自动化流程结论,不是人工审核
验证等级L4 · 沙盒安装通过安装命令在隔离沙盒内真实执行成功,无依赖错误
安全审查低风险静态分析结论,未标注不代表已通过审查
仓库健康度活跃按仓库活跃度与最近更新时间给出
可信度银综合仓库活跃度与验证结果

上面的结论来自上游最近一次自动化验证(2026-10-08): 同一套检查会在插件发新版后重跑,页面显示的是最新一次的逐项结果。

逐项检查结果

L1 · 已找到 ✓ 通过
  • L1.0_DEFAULTED_FROM_L3 由 L3 推定 默认通过——L3 安装规范已通过(全库 L3 扫描策略)
L2 · 结构化 ✓ 通过
  • L2.0_DEFAULTED_FROM_L3 由 L3 推定 默认通过——L3 安装规范已通过(全库 L3 扫描策略)
L3 · 安装规范 ✓ 通过
  • L3.1_INSTALL_COMMAND_PARSED 安装命令已解析 方式:安装规范解析
  • L3.2_DSH_VERSION_DECLARED DSH 版本已声明 方式:DSH 版本声明
L4 · 安装已测 ✓ 通过
  • L4.1_INSTALL_EXECUTED_CONFINED 受限沙盒内执行安装 方式:沙盒安装执行
  • L4.2_INSTALL_SUCCESS 沙盒安装成功 方式:沙盒安装执行
  • L4.3_ARTIFACT_CONFIRMED 安装产物已确认 方式:沙盒安装执行
L5 · 运行已测 ✕ 未通过
  • L5.1_INSTALL_PASSED_SANDBOXED 沙盒安装通过 方式:沙盒安装执行
  • L5.2_WEB_BOOT_READY Web 启动就绪 boot failed
  • L5.3_HTTP_SERVED HTTP 服务响应

风险详情

  • 审查结论 通过
  • 结论说明 vet 静态分析未发现可疑行为,判定为干净(clean)。
  • 风险计数 严重 0 / 高 0 / 中 0
  • 风险详情 未发现严重或警告级问题。

选择建议

装之前先看这几条
按条目字段给出的判断,不替你决定用不用

值得选的地方

  • 验证等级 L4:在沙盒里真实装过,依赖能装上,不是纸面声明。
  • 静态安全审查为低风险,没有发现明显可疑行为。
  • 有可直接复制的安装命令,不用自己翻文档找入口。
  • 列出了 4 项功能,能直接看出它解决什么问题。

先想清楚的地方

  • 没有声明 Node.js 版本要求,版本不匹配可能装不上。
  • 验证通过不等于安全:插件会读写文件、执行命令或联网,装前先到仓库确认它做了什么。

更适合

  • 需要在记忆与知识场景里给 DSH 补能力的人。
  • 想装完就能用、不想自己排依赖的人。
  • 能接受在本地装依赖、愿意自己确认权限的人。

不太适合

  • 只使用 DSH 官方内置能力、不接受第三方插件的人。

同类对比

6 个同类
同分类里挑最接近的几条,字段以各自详情页为准
插件验证等级安全审查星标兼容版本安装命令
dsh-session-handoff当前 L4 · 沙盒安装通过 低风险 0 未标注 有
ruflo L3 · 安装规范通过 低风险 7.4 万 未标注 无
OpenViking L3 · 安装规范通过 低风险 3.9 万 未标注 无
WeKnora L4 · 沙盒安装通过 低风险 3.3 万 未标注 有
distilly L4 · 沙盒安装通过 低风险 2.5 万 未标注 有
EverOS L4 · 沙盒安装通过 低风险 1.3 万 未标注 有

仓库档案

记忆与知识
字段来自项目仓库与公开索引,中文说明由本站标注
作者 / 维护方iuuuuuuuu仓库 dsh-session-handoff · 默认分支 main
分类记忆与知识memory
收录类型可安装插件声明了 dsh.bundle、可用 dsh plugin add 安装的条目
开发语言JavaScript仓库主语言
许可证MIT商用或二次分发前请确认条款原文
星标 / 复刻 / issue0 / 0 / 0收录时的数值,非实时
创建 / 更新2026-10-08 · 2026-10-08最后推送 2026-10-08
本站收录2026-10-08首次进入本站目录的时间

README 全文

13.0 KB
作者原文,中文版优先;只做安全转义,不改内容



dsh-session-handoff

English · 简体中文

Carry a conversation's memory into a new session before the old one becomes unusable.

The problem this solves

A long DSH session eventually reaches a size where its own compaction stops working. The
mechanism is worth stating precisely, because it is what makes the failure permanent:

  • Compaction replays the whole shadowed region as the input to one summarization request.
  • The upstream provider enforces a hard ceiling on one request's prompt.
  • Once the session passes that ceiling, the compaction request is itself over the ceiling.
  • So compaction fails with the same overflow it was supposed to cure, every time, forever.

The session then cannot be compacted, cannot be continued, and — because the naive handoff
implementations build their summarization request the same way — cannot be handed off either.
That is the deadlock. /handoff exists to break it.

Install

dsh plugin --profile  add /path/to/dsh-session-handoff

If your profile's cordis.patch.yml already mounts this plugin by hand, remove that row
first, or you will run two instances.

Restart DSH. This is required, not optional: the harness keeps loaded plugin modules in
its loader cache, and hmr.root defaults to [], so editing a plugin's source does not
take effect in a running host.

After restarting, the log shows:

[session-handoff] installed: /handoff registered, pressure monitor active (upstream limit 1048576)

Use

/handoff           hand this conversation off to a fresh session
/handoff-status    show the measurement, the binding ceiling, and the trigger state

/handoff prints a report:

Handed off `session-9ef22e43-…` to `session-e7d70ba3-…`.

- read: 32286 messages, 117541 events
- memory: 240 facts, 0 checkpoints
- summarize: 70 chunk(s), source=map-reduce, 18422 chars
- seed: 21544 chars (~5386 tokens)
- create: session-e7d70ba3-…
- archive: session-9ef22e43-…

The source session is archived; it stays readable in the sidebar.

The source is archived last, so a failure anywhere earlier leaves it intact and usable.

What it does

It watches

At every turn boundary the plugin measures the session's token pressure and classifies it
against two independent ceilings, binding on whichever is tighter:

Ceiling Where it comes from Why it matters
The model's context window read from the model configuration the session is using what the model itself accepts
The upstream prompt limit configured, because nothing declares it what the provider accepts on one request

The second is the one that actually kills sessions, and it is not derivable from the first —
a routed model may advertise a 1,000,000-token window while the account behind it enforces
less on a single request.

When pressure crosses the policy ladder the plugin injects a notice into the session
naming the measured number, the binding ceiling, and the way out. A notice is model-facing
context for the next step, so it never starts a turn on its own, and it is rate-limited on
both growth and time so a session parked at critical does not nag.

It hands off

/handoff runs one transaction:

1. read        the live session (messages + events)
2. memory      extract four layers of memory
3. summarize   bounded map-reduce, one request per chunk
4. create      the successor, inheriting the source's route and cwd
5. deliver     the seed as the successor's opening turn
6. archive     the source, with stopActivity — its work is terminated
7. release     drop the source's live event tree

The successor starts working immediately. The seed is not a note for you to read; it is
delivered as the successor's first turn, so the new session picks the work up and continues.

Archiving does not free memory, and releasing only half-frees it

Archiving is a visibility change: the session id joins the archive set, which hides it
from the sidebar's default view. Its log stays on disk, it stays readable, and unarchiving
restores its exact position. Nothing is deleted, and nothing is freed.

One rule governs memory: a session is released only once it is archived. A handoff that
keeps the source visible — the automatic default — leaves it resident, because you may still
be looking at it. Anything you archive yourself is picked up by a periodic sweep of the
archive set, since a manual archive emits no event a plugin can listen for.

Releasing calls SessionStore.remove(id), which runs the store's official detach lifecycle.

What that does and does not free. A session is held by two independent registries:

Registry What it holds Can a plugin drop it?
ctx.sessions the session's event tree yes — sessions.remove(id)
ctx.agents the agent, which holds the session no

The agent registry is a plain Map with no public removal: agents.enter() returns the
detach disposer, but enter() is called by the agent loop, not by a plugin, and neither
agents.remove nor agent.dispose exists on the public surface. So releasing a session
removes it from the session store while its agent keeps the tree reachable. The log on disk is
untouched either way.

Measured, with a real SessionStore and a real AgentRegistry:

BEFORE release:  sessions.get(id) -> true    agents.get(id) -> true
AFTER  release:  sessions.get(id) -> false   agents.get(id) -> true
the agent still carries all events

A session whose own agent is still running is skipped, because removing it then would race
its closing events. Switch the sweep off with monitor.releaseArchived: false.

The memory it carries

The design question is what to carry. Four layers, ordered by cost:

Layer Source Fidelity Cost
Verbatim facts Regex extraction over the transcript Exact Free
Earlier checkpoints Successful compaction/end summaries the session already wrote Exact Free
Recent turns, verbatim The tail of the conversation, word for word Exact Free
Narrative summary Model-written, map-reduce Paraphrase One pass

The three exact layers are never dropped to make room for the paraphrase: only the narrative
layer is truncated, and only from its middle. The verbatim tail gets a reserved share of the
seed budget rather than competing with prose for the leftovers, because facts give you the
paths while only the tail gives you the exact thought you were mid-way through.

Credentials never ride along

The verbatim layer is a copy, so anything the session once echoed — a token printed while
debugging, a key in a dotenv dump — would be copied too. A handoff seed is a new artifact that
may be read or shared, so it is redacted by shape before it is written: bearer tokens, sk- /
ghp_ / github_pat_ / xox / AKIA keys, JWTs, PEM private keys, password=-style
assignments and inline connection-string passwords. The fact layer is redacted too, since a
path can embed a secret.

Automatic handoff

Automatic handoff is on by default; automatic archiving is off.

The distinction is the point: handing off creates a successor that keeps working, while
archiving hides the session that broke. When a session dies while you are away, that session
is evidence — you want to see what it was doing, not find it gone.

Three independent triggers, because a session can become unusable in three different ways:

Trigger Signal Default
Pressure measured pressure reaches atLevel critical
Failed turns a run of consecutive failed turns 2
Compaction failure a failure streak and enough volume 3 failures, 35% of the window

Only error and max-tokens turn endings count as failures. completed resets the streak;
aborted (your own stop) and interrupted (a crash closer) are not failures, because
neither means the session is broken.

The compaction trigger is deliberately a joint condition. A compaction failure is not
judged on its own: a policy refusal can repeat hundreds of times on a session that is working
fine, so the count alone would tear down healthy sessions. It requires both a failure streak
and volume. A terminal code (the request no longer fits at any size) bypasses the volume
floor, and a platform-level pool failure is deliberately not a trigger, because a handoff
cannot fix a fault the successor would inherit.

A session is handed off at most once. A successful handoff suppresses that session for the
rest of the process; a failing one stops after three attempts and tells you to run /handoff
by hand.

Configuration

Mount config in your profile patch, or edit it live in Settings → 会话交接 / Session handoff:

- id: session-handoff
name: 'dsh-session-handoff'
config:
monitor:
enabled: true
policy:
language: zh                        # language of the reminder in the transcript
watchRatio: 0.45
warnRatio: 0.6
criticalRatio: 0.75
remindEveryTokens: 50000
remindCooldownMs: 600000
seedBudgetTokens: 24000
autoHandoff:
enabled: true
atLevel: critical
onAnomaly: true
anomalyThreshold: 2
archive: false

Neither ceiling is configured. The model window is read from the model configuration the
session is actually using, so it follows a model switch with no setting touched. The upstream
request limit is a property of the account behind a route and appears in no model
configuration, so the plugin carries the value measured on this machine as its default; it is
available as policy.upstreamPromptLimit for a deployment that measures a different one.

Guarantees

Asserted by the test suite (node --test tests/smoke.test.mjs):

  • No assembled summarization request can exceed its budget — the invariant that makes the
    plugin safe on a session that is already over the limit.
  • Redaction is neither blind nor over-eager: a clean tail passes through byte-identical
    (including SHA-256 digests, which look like secrets but are evidence worth keeping), while
    the same tail with credentials spliced in has every one removed.
  • Facts and checkpoints survive even when the prose layer cannot fit.
  • Hidden reasoning never leaks into the seed.
  • An estimated reading can remind you but can never trigger an automatic handoff.
  • The settings page renders every label in both languages, and every colour in its stylesheet
    comes from a design token.

Limits, stated plainly

  • It does not shrink the live session. Handoff moves work to a new session; the old one
    stays on disk (archived, still readable) until you delete it.
  • The summary is a paraphrase. Exact recall comes from the facts and checkpoints layers and
    from the archived session, which remains openable.
  • The upstream request limit is a measured default, not a discovery. It is the one ceiling
    that cannot be read from anywhere, so the value is what this machine's route measured.
  • Map-reduce costs one request per chunk. On a very large session that is tens of requests;
    the report tells you how many.
  • Archiving is not deletion. It removes the session from the sidebar's default view.
  • The automatic triggers have not fired on a naturally occurring failure yet. The logic is
    verified against real data and in an isolated host, but that moment is still unobserved.
  • The reminder's language is a setting, not the browser locale. The host half cannot read the
    browser's language, so policy.language decides it and defaults to zh.

Layout

lib/
index.js         plugin entry: commands, pressure monitor, triggers
client.js        settings page (browser half)
handoff.js       the transaction
memory.js        layered extraction + redaction + seed assembly
summarize.js     bounded map-reduce summarization
pressure.js      classification, reminder policy, the joint compaction condition
token-budget.js  token estimation and request budgeting
tests/
smoke.test.mjs           unit tests for every module
auto-trigger-real.mjs    replays a real failure sequence through the plugin
client-render.mjs        renders the settings page with a faithful jsx-runtime stub
e2e-real-session.mjs     read-only probe on a real transcript
make-fixture.mjs         rebuilds the local fixture from a real session log
docs/
NOTES.md                 how this was verified, and what went wrong on the way

Documentation

File Language
README.md English
README.zh-CN.md 简体中文
docs/NOTES.md English — engineering notes and verification evidence
docs/NOTES.zh-CN.md 简体中文 — 同上
DELIVERY.md 简体中文
DELIVERY.en.md English

License

MIT

常见问题

7 问
答案由本站依据条目字段整理,不引用上游原文
dsh-session-handoff 怎么安装?

在 DSH 里执行 `dsh plugin --profile web add github:iuuuuuuuu/dsh-session-handoff` 即可。

dsh-session-handoff 的验证等级是什么意思?

L4 · 沙盒安装通过。安装命令在隔离沙盒内真实执行成功,无依赖错误

dsh-session-handoff 安全吗?

低风险。vet 静态分析未发现可疑行为,判定为干净(clean)。

dsh-session-handoff 装之前要先确认什么?

先看它会读写哪些文件、执行哪些命令、连接哪些网络地址;验证等级只说明装得上、跑得起来,不等于安全。涉及密钥或系统权限的,建议先在隔离环境试装。

dsh-session-handoff 用的是什么许可证?

上游标注为 MIT。商用或二次分发前请到仓库确认许可证原文。

dsh-session-handoff 有哪些功能?

会话压力监测与阈值告警、四层记忆提取与有界摘要、一键 /handoff 生成后继会话、源会话最后归档可回读。

这条记录的数据可靠吗?

本站按仓库名去重后合并整理,字段以作者仓库与 npm 元数据为准;安装命令、仓库地址与 README 保持原文,带 L4 / L5 标记的安装命令已在隔离沙盒里真实跑通。

同名或近似条目

8 条
不同作者的仓库分开列,请确认你要装的是哪一个
记忆与知识
按星标排序,可作替代方案

ruflo

ruflo

L3 · 安装规范通过 7.4 万 星

OpenViking

OpenViking

面向 DeepSeek Harness 的 OpenViking 记忆与上下文插件:pre-step 自动召回与画像注入、会话捕获、`vik

L3 · 安装规范通过 3.9 万 星

WeKnora

WeKnora

把 WeKnora 知识库接入 dsh 的四个只读工具:列出知识库、混合检索原文片段、按顺序还原单篇文档,以及直接取用 WeKnora 自己

L4 · 沙盒安装通过 3.3 万 星

distilly

distilly

Distilly — Distill how they think into reusable Skills for any Agent o

L4 · 沙盒安装通过 2.5 万 星

EverOS

EverOS

L4 · 沙盒安装通过 1.3 万 星

MemOS

MemOS

L4 · 沙盒安装通过 1.2 万 星

iuuuuuuuu 的其它插件

6 个

插件的元信息来自作者仓库;分类、验证等级与安全结论的中文说明为中文整理,最近核验 2026-10-08。