xingzoudefengye/dsh-session-recall ↗★ 0
dsh-session-recall
Bounded, model-free session chronicle for DeepSeek Harness, plus a switch that turns on the harness's own workspace-authorized session history tools. 适合需要向模型提供受控、精简的会话历史纪实,或启用只读历史工具的用户。
Other repositories with this package name
Install
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:xingzoudefengye/dsh-session-recallREADME
Read the full README ↗配置
史书本身没有任何配置键:它是对会话事件日志的纯函数投影,不落盘、不建索引、不跑后台任务。真正可调的只有下面三处。
工具参数(每次调用)
| 参数 | 类型 | 默认 | 作用 |
|---|---|---|---|
lastTurns | integer | 不传 = 全部 | 只返回最新的 N 条回合记录;非正整数按不传处理。 |
maxChars | integer | 6000 | 返回文本的字符预算,上限也是 6000;低于 64 时按 64 渲染。 |
maxChars 限制的是渲染出来的史书文本;API 返回的对象另有 12000 字符的传输上限,不会为了它删除读者还有额度容纳的回合。
挂载点
bundle 默认插入两行(见 cordis.patch.yml):
- insert:
- id: session-chronicle
name: 'dsh-session-recall/service'
- id: tool-session-chronicle
name: 'dsh-session-recall/tool'
session-chronicle提供ctx.sessionChronicle服务,供其他插件消费,本身不占模型请求。tool-session-chronicle注册模型可调用的session_chronicle工具,每个请求多一个 tool schema。
只想关掉模型工具、保留服务,在 profile 的 cordis.patch.yml 里按 id 覆盖:
- id: tool-session-chronicle
disabled: true
读工具开关
enable-read-tools.mjs 追加的组长这样:
- insert:
- id: optional-session-search
name: cordis:group
group: true
isolate:
sessionQuery: true
config:
- id: optional-session-query-sqlite
name: '@deepseek-ai/dsh-session-query-sqlite'
config:
path: ':memory:'
openAt: first-search
- id: optional-tool-session-query
name: '@deepseek-ai/dsh-tool-session-query'
isolate.sessionQuery 让这个组开自己的 sessionQuery,所以 profile 里原有的 sessionQuery 行保持自己的配置;组内用 :memory: 索引,且到第一次搜索才打开(openAt: first-search)。
代价:这 5 个工具是上游的 opt-in 功能,每个模型请求固定多出 5 个 tool schema 加一段引导文字,即使这一轮根本不搜历史。不需要跨会话检索就不要开。
DSH_HOME
脚本用 DSH_HOME 定位 profile;未设置时是 ~/.dsh。这不是插件的配置键,只是脚本与 dsh 共用的环境变量。