Adds a manual, confirm-first title generator: a header button and a session-row menu entry ask a model to summarize the whole conversation, show the proposal in an editable dialog, and rename the session only after you confirm — without registering a title provider or changing automatic titling.
Install
# from npm (prebuilt)
dsh plugin --profile web add dsh-session-titler
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:ZilongYang/dsh-session-titler
Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).
README
This plugin publishes its README in Chinese only.
官网 / Website: https://dsh.zlmix.com/session-titler/
Summarize a whole DeepSeek Harness session into one title on demand — confirm it before it is applied. A Host + Web Client plugin: its only entries are a header button and a session-row menu item, and nothing is written until you press Confirm. It registers no title provider, so automatic titling keeps whatever else you have installed.
把整个会话总结成一条新标题,确认后才写入。DeepSeek Harness 的 Host + Web Client 双半插件。
Quick start (EN) — Desktop app: install from the in-app Plugins page (the
desktopprofile is app-managed, sodsh plugin --profile desktop …refuses). CLI-managed profiles:dsh plugin --profile <profile> add dsh-session-titler. Then hit ✦ Generate title in the session header or Generate title in a session row's “…” menu, edit the proposal, and press Apply — nothing is written before that.
快速开始
1. 安装
桌面版(DeepSeek Harness.app) —— desktop profile 由应用独占,命令行不接管它
(dsh plugin --profile desktop … 会直接报 profile "desktop" is managed exclusively by the Electron application)。
请在应用内左侧「插件」页安装;插件市场收录后,也可以直接在里面搜 titler 一键装(收录状态见 PR,通常一天内生效)。
命令行管理的 profile(web / main / 自建 profile 等)—— dsh plugin 是 pnpm 透传,一条命令即可:
# 从 npm 安装(推荐)
dsh plugin --profile <你的profile> add dsh-session-titler
# 从 GitHub 源码安装(想跟 main 分支时)
dsh plugin --profile <你的profile> add github:ZilongYang/dsh-session-titler#main
# 本地开发:把本仓库直接挂进去
dsh plugin --profile <你的profile> add link:/绝对路径/dsh-session-titler
2. 使用
- 打开任意一个已经有内容的会话;
- 点标题栏里的 ✦ 生成标题 —— 它在「创造模式」右边、「费用 ¥0」左边; 或点左侧会话行 「...」菜单 → 生成标题(0.2.1 及更早紧接「重命名」下一行;DSH 0.2.2 起在「复制会话 ID」之后、「归档」之前);
- 等 2–4 秒,弹窗给出标题提案,可以直接改;
- 点 确认修改 —— 左侧标题立即更新,刷新页面也还在。
点「取消 / Esc / 点遮罩」都不会写任何数据;空白会话没有可总结的内容,按钮会置灰。
3. 卸载
dsh plugin --profile <你的profile> remove dsh-session-titler
桌面版在应用内「插件」页停用或卸载。
装完没看到按钮?Host 半是进程内模块,重启一次 dsh/应用再刷新页面即可(Client 半刷新页面就生效)。
入口在哪(两处,都在现有 Web UI 上,不新增页面)
| 入口 | 位置 |
|---|---|
| 顶栏按钮「✦ 生成标题」 | 会话标题栏里,conversation.session.header.actions 的 order: -8 —— 紧跟「创造模式」芯片 agent-preset(-10)右侧,排在费用芯片 cost-meter(-5)之前,从而让 费用 ¥0 与 费用明细(1)保持相邻 |
| 会话行菜单项「生成标题」 | 会话行「...」菜单 sidebar.workspaces.session.menu.item 的 order: 250。DSH ≤ 0.2.1:内置动作也是这个 Slot 的条目,本项在「重命名」(200)下面一行、「分叉会话」(300)上面;DSH 0.2.2 起:内置动作迁到 ctx.contextMenus,本 Slot 成为 legacy 通道,整块排在「复制会话 ID」(450)之后、「归档」(600,afterContent)之前 |
点击后:生成 → 居中确认弹窗(标题可编辑,另有「重新生成 / 取消」)→ 点「确认修改」才真正改标题。取消、Esc、点遮罩都不会写任何数据。
它是怎么工作的
顶栏按钮 / 会话菜单项
│ store.open({ sessionId, currentTitle })
▼
Client store ──POST /session-titler/propose { sessionId }──► Host 路由(只读)
▲ ├─ ctx.sessionQuery.readSurface(sessionId)
│ │ (当前「模型表面」,已考虑压缩/替换)
│ ├─ 组装 transcript(32 KiB 预算,条目级截断)
│ ├─ 路由候选(新→旧):活会话 requestHeader().config
│ │ → 日志每条 request/header → agentDefaultModel 默认模型
│ │ 每个候选都要过 listProviders() 与 resolveModelInfo()
│ │ (探测不可用就不过滤,绝不把能成功的调用弄坏)
│ │ 强制推理的端点:被拒一次后带档位重试 + 放宽输出预算
│ └─ ctx.llm.stream({ …, purpose:'session-title' })
│ { ok:true, value:{ title, provider, model, fallback, messages, truncated } }
▼
确认弹窗(可编辑)
│ 点「确认修改」
▼
ctx.sessions.using(id, { source:'workspaceOperation' }, ref =>
ref.binding.session.rename(title)) ← 与官方「重命名」菜单同一条写入路径
▼
Host 追加 session/title 事件(source: user)→ 列表标题刷新、刷新页面仍保持
关键取舍:不注册 ctx.sessionTitle 的 provider。那是独占的,会顶掉 DSH 自带的自动标题 provider,而且 automatic 只有 first-prompt / all-prompts,没有「只在用户点击时才生成」的档位。所以本插件走自己的显式调用,并保证生成阶段完全不写会话日志。
目录
| 文件 | 作用 |
|---|---|
package.json |
bundle 补丁声明 + dsh.client(web 平台、客户端模块依赖) |
cordis.patch.yml |
往 profile 插一行 host 插件(id: session-titler) |
index.js |
Host 半:注册 /session-titler/propose(幂等挂载:重复挂载时由最新一次接管路由),做请求围栏、体积上限、错误映射 |
title.js |
Host 半:读会话 → 选模型路由(每个候选都校验已注册 adapter 且当前 profile 仍配置该模型)→ 组装/裁剪 transcript → 经 streamTitle() 调模型(优先 ctx.llm.stream,兜底 ctx.llm.prepareCall)→ 标题归一化 |
test/title.test.js |
路由解析、失败映射与调用降级的单元测试(npm test = node --test,不进 npm 包) |
test/host.test.js |
挂载幂等性单元测试:重复挂载不抛、最新 handler 生效、旧 fiber 不误删新路由(同样不进 npm 包) |
fence.js |
Host 半:loopback / 同源请求校验(DNS-rebinding、CSRF 防护,不是鉴权) |
client.js |
Client 半:手写模块产物,注册 3 个座位 + 状态 store + 确认弹窗 |
locale/{zh,en}.json |
插件卡片显示用的 meta.title / meta.description |
HTTP 契约
POST /session-titler/propose,请求体 ≤ 8 KiB:{ "sessionId": "session-…" }
成功:
{ "ok": true, "value": { "title": "…", "provider": "…", "model": "…", "fallback": false, "messages": 14, "truncated": false } }
fallback: true 表示会话自己记录的路由在当前 profile 里已经不能派发——该 provider 没有已注册 adapter,或者 provider 还在但那个模型 id 已被删除/改名——本次是回退到日志里更早的可用路由或 llm-pi-ai/agentDefaultModel 的默认模型生成的;弹窗会显示「使用模型:X(…已回退)」。
失败:{ "ok": false, "error": { "code": "…", "message": "…", … } }(no-adapter / no-model 额外带 route)
| code | HTTP | 触发 |
|---|---|---|
forbidden |
403 | 围栏未通过(非 loopback/可信 Host、跨站标记、异源 Origin) |
method-error |
405 | 非 POST |
bad-request |
400 | JSON 坏 / sessionId 缺失 |
too-large |
413 | 请求体超限 |
not-found |
404 | 会话不存在或读不出来 |
no-content |
409 | 表面里没有 user / assistant 文本 |
timeout |
504 | 30 s 未回 |
no-adapter |
502 | 会话记录的路由 + 默认模型都没有已注册的 adapter(响应带 route,弹窗给中文可操作提示) |
no-model |
502 | 会话记录的 provider 还在、但那个模型 id 在当前 profile 里已不存在,默认模型也不可用(响应带 route) |
llm-error |
502 | finish 非 stop、模型未产出文本 |
unsupported-host |
501 | 宿主既没有 ctx.llm.stream 也没有 ctx.llm.prepareCall(当前所有实测版本两者至少有一个) |
internal |
500 | 其它 |
可调参数
集中在 title.js 顶部的 POLICY(本插件不带 Config 段,改完需要重启 Host 才生效):
| 键 | 默认 | 含义 |
|---|---|---|
maxInputBytes |
32768 | 送进模型的 transcript 字节上限 |
maxOutputTokens |
256 | 标题输出的 token 上限(DSH 自带的首条消息 provider 用 64;整段会话会让推理模型把 64 全花在思考上,故放宽) |
maxReasoningOutputTokens |
2048 | 端点不允许关闭推理时的输出上限:思考会吃掉一部分预算,256 会让标题在 max-tokens 处被截掉(只在这类端点被识别出来后才用) |
timeoutMs |
30000 | 单次标题调用的墙钟预算 |
maxTitleBytes |
120 | 接受标题的 UTF-8 字节上限 |
userCharsPerMessage / assistantCharsPerMessage |
2000 / 3000 | 单条消息裁剪上限 |
超长会话的处理:先按单条裁剪,再从中间整条丢弃(保留开头=任务目标、结尾=当前状态),仍然超就截尾部字符,并在返回值里给 truncated: true。
标题取模型回答里第一条可用行(跳过空行、剥掉解释段落),再按 DSH 的 normalizeSessionTitle 归一化:剥 OSC/CSI/ESC 控制序列、C0/C1 控制符、方向性不可见字符 → 空白折叠成单行 → 按 code point 截到 120 字节,绝不切坏字符。max-tokens 结束但已产出可用标题行时按成功处理(模型只是话多了,反正要用户确认)。
本机开发(改代码时看这节)
安装与卸载见上面的「快速开始」。日常改代码用本地挂载最省事:
# 让 Agent 代为安装(Host + Web 同 profile)
# plugin_manager install_bundle target=<本目录绝对路径>
# 或者命令行
dsh plugin --profile <你的profile> add link:/绝对路径/dsh-session-titler
- 本仓库以
link:方式挂进 profile,所以改代码不用重装。 - Client 半(
client.js):刷新页面生效;插件刚装好时 Host 会推送模块图变更,通常无需刷新就会激活。 - Host 半(
index.js/title.js/fence.js):必须重启 DSH。宿主进程内的 ESM 模块缓存不会因装卸载而失效——这是本插件开发中真实踩到的:改完title.js后路由行为不变,重启后才生效。 - 单测:
npm test(=node --test,Node ≥ 20.3)。共 31 条:test/title.test.js覆盖路由候选的 adapter + 模型校验(模型已删除时回退、全灭报no-model、非路由性探测失败不过滤、探测方法必须带接收者调用)、强制推理端点的档位与预算(含「看着能关推理、实际被端点拒绝」的一次重试;只剩off时不重试、二次仍拒不再重试、无关失败不重试)、失败映射与调用降级(只有prepareCall/ 两者都无);test/host.test.js覆盖挂载幂等(重复挂载不抛、最新 handler 生效、旧 fiber 不误删新路由、无关注册错误仍上抛、双挂载后路由仍能返回提案)。不联网、不装依赖。test/不在 npm 包的files里。
支持的 DSH 版本与兼容声明
| DSH 版本 | 状态 | 依据 |
|---|---|---|
0.2.0-rc.2 |
已验证可用 | 0.1.x 全程实测;0.2.0 起按本节所述改造 |
0.2.1-alpha.2 |
已验证可用 | 桌面版内置版本;逐包 diff 过插件用到的全部 API(见 docs/01 附录 A6),单测覆盖 |
0.2.1-alpha.3 / alpha.4 / alpha.5 / rc.1 |
未实测 | alpha.4 已从 npm 取源码 diff(插件可见 API 未变),但未实机跑过,故声明里标 unknown |
0.2.1-rc.2 |
已验证可用 | 桌面版与 CLI 均为该版本;客户端 session-controller/gateway 逐包 diff 无代码差异,「确认修改」实机验证通过(见 docs/01 附录 A7) |
0.2.2-rc.1 |
已验证可用 | 桌面版 DSH 0.2.2-rc.1 实机验收通过:菜单行落在「复制会话 ID」之后、「归档」之前,弹窗/取消/确认写入均正常(见 docs/RELEASE-CHECKLIST-0.2.3.md);源码级依据见 docs/COMPAT-2026-11-05-dsh-0.2.2-rc.1.md |
< 0.2.0-rc.1 / >= 0.3.0 |
不支持 | 声明范围之外 |
0.2.1 修了什么:0.2.0 为了给重命名路径加存在性判断,把
binding.session.rename摘成变量再裸调用,严格模式下丢了this,于是点「确认修改」必报Cannot read properties of undefined (reading 'remote')。0.2.1 改回与官方「重命名」同形的方法调用(session.rename(title))。完整证据链见docs/01附录 A7。
0.2.2 修了什么(社区 PR #2,感谢 @little3tar):两类「生成标题」阶段的 Host 侧失败——① 会话记录的模型已在 profile 里被删(provider 还在但模型 id 没了),现在会回退默认模型,全灭时给新错误码
no-model与可操作文案;② 端点强制推理(报400 Reasoning is mandatory for this endpoint and cannot be disabled),现在先按模型档位直发,被拒后带档位重试一次(maxReasoningOutputTokens2048)。详见docs/01附录 A8。
0.2.3 改了什么:没有功能变化。DSH 0.2.2 把内置会话菜单动作迁到
ctx.contextMenus(旧 Slot 降级为 legacy),本插件那一行因此从「重命名」下方下沉到「复制会话 ID」之后、「归档」之前;本版只同步文案/文档与dsh.compatibility.dshReleases兼容矩阵,代码路径、错误码与「确认后才写入」的承诺全部不变。详见docs/01附录 A9。
package.json 里有两处声明,含义不同:
engines.dsh:">=0.2.0-rc.1 <0.3.0-0"。插件市场的装前检查读它(顶层engines.dsh或dsh.engines.dsh都读,前者优先),落在范围外会拒绝安装并说明原因,而不是装完再崩。dsh.compatibility:同样的范围 +dshReleases逐版本标注(compatible/unknown),供市场页面与目录展示。- 本插件故意不声明
peerDependencies:DSH 自身的准入闸门(dsh-app-boot的evaluatePluginCompatibility)只读@deepseek-ai/dsh*的 peer;一旦声明而范围不满足,处理方式是禁用该行 / 整个 bundle 被跳过(静默消失,比明确报错更难排查),而engines.dsh只是“装前拒绝 + 展示”,语义正是我们要的。
市场化里提示「不兼容 / 已停止安装」时:确认你的 DSH 确实在声明范围内;若你明确要冒险试装,用 dsh plugin allow-version 或在插件页授予 exact-version 豁免(写进 profile 的 compatibility.json,只对“该插件的该版本 + 该 DSH 版本”这一对生效)。
运行时不自报版本,按能力自适应:index.js / title.js 不猜版本号,而是探测宿主实际有什么——llm.stream 优先、llm.prepareCall 兜底、listProviders / resolveModelInfo 缺失就不做对应的路由过滤、客户端 sessions.using 缺失就给可读文案。所以同一份代码在 0.2.0-rc.2 与 0.2.1-alpha.x 上都能跑,不需要分支版本号。
已知限制
- 只服务 loopback 或
webRuntime.trustedHosts里的主机。经隧道/局域网用非受信 Host 访问时,本路由返回 403(这是有意的 DNS-rebinding 防护)。 - 同一个 profile 里不要保留两个安装源:插件市场会把装好的包“热挂载”进当前进程,同时它也可能出现在 profile 的
dsh.profile.bundles里;两边同时生效时,Host 半已能做到幂等(只保留一条路由并打一条警告),但 DSH 的客户端模块表按包名去重,会直接拒绝该包(client-modules: package dsh-session-titler resolves from multiple active Loader sources … remove one entry),于是两个 UI 入口都不会出现。这一步只能靠清理安装源解决:在插件页/dsh plugin里删掉多余的那一份,或者把dsh.profile.bundles里的条目去掉。日志里出现mounted from more than one loader source就是该清理的信号。 - 弹窗是自写组件(按官方规范不 import
dsh-client-ui-primitives),样式只引用--dsw-alias-*/--dsw-radius-*/--dsw-elevation-*token;视觉与宿主的 Modal / 菜单行对齐,但不共享宿主组件的行为升级。 - 不做自动标题:不会在后台为任何会话生成标题,也不会改动 DSH 自带的标题 provider。
- 每次点击消耗一次模型调用(输出 ≤ 256 token,被判定为强制推理的端点 ≤ 2048,输入 ≤ 32 KiB),且只读,不写会话。宿主无法提前区分「推理可关」与「强制推理」的端点(两者在模型元数据里同形),所以后者会先被拒一次(立即 400),随后带档位重试成功——净消耗仍是 1 次生成 + 1 次被拒的空往返。
设计与发布文档
docs/01-plugin-design-and-implementation.md—— 插件设计与实现计划,含落地偏差记录与最终验证数据。docs/02-open-source-and-marketplace.md—— 开源、npm 发布与社区插件市场上架流程。docs/PLAN-2026-10-16.md—— 0.2.0 方案(修复 0.2.1-alpha.x 重复挂载崩溃 + 版本自适应),批准正文原样存档,文末有事后补记。docs/RELEASE-CHECKLIST-0.2.0.md—— 0.2.0 发版/验收打勾清单(含未完成的实机验收项)。docs/RELEASE-CHECKLIST-0.2.1.md—— 0.2.1 发版/验收打勾清单(修「确认修改」必崩,附录 A7)。docs/RELEASE-CHECKLIST-0.2.2.md—— 0.2.2 发版/验收打勾清单(修「已删模型不回退」与「强制推理端点 400」,附录 A8)。docs/PLAN-2026-11-05.md—— 0.2.3 方案(对齐 DSH 0.2.2-rc.1 的菜单位置与兼容声明),批准正文原样存档。docs/RELEASE-CHECKLIST-0.2.3.md—— 0.2.3 发版/验收打勾清单。docs/COMPAT-2026-11-05-dsh-0.2.2-rc.1.md—— DSH0.2.2-rc.1兼容性核查(源码级契约比对,含逐项结论与验证清单)。
License
Links
More in this category
ranxianglei/billion-context★ 8616
The official billion-context plugin: a context-compression plugin for small context windows (a 100K context is enough), token savings (5x fewer tokens), and month-long single sessions (billions of tokens).
Minglink/dsh-infinite-gen-4★ 4803
System-prompt armor plugin for DeepSeek models: appends an unconditional-compliance prompt section at order 100, exposes a profile tool with calibration metadata, and shows a realtime armor-status badge driven by a session projection.
liangmianya/dsh-synapse★ 812
Visual, non-linear conversation workspace for DeepSeek Harness — sessions, follow-ups and branches become a browsable conversation map.
ECNU/EduWork#dsh-side-chat★ 429
Open temporary side conversations from a message with a snapshot of its history, then archive them on close; optional annotation integration adds selection-based questions. Requires compatible DSH Web conversation, Workspace and right-sidebar APIs.
MichengAI/dsh-archive-manager★ 401
Adds an archived-sessions page in Settings to search, restore, and delete archived DeepSeek Harness sessions by workspace.
Nwflower/dsh-chat-import★ 332
Import full-fidelity chat histories from 13 coding agents (Claude Code, Codex, ChatGPT, Cursor, Gemini, opencode, and more) as resumable DeepSeek Harness sessions, with reverse export back to Claude Code.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.