DSH Plugins Marketplace

DSH Plugins

Plugins

/

dsh-tool-set-session-title

H

dsh-tool-set-session-title

Manifest valid

DeepSeek Harness(DSH)插件:对话标题工具,支持当前会话命名和历史会话重命名

hasBundlePatchMachine translated

对话标题工具 · DSH 插件

插件类型:DeepSeek Harness(DSH)插件。

给 DeepSeek Harness 的模型侧工具:把对话命名成 MMDD|类型|主题。

工具作用底层路径
set_session_title(title, force?)命名当前对话ctx.sessionTitle.rename(session, title),直接写日志
rename_conversation(session_id, title, force?)重命名任意已有对话(含已关闭的历史对话)ctx.sessionController.rename,即 Web 侧栏改名同一条路径(会解析/恢复目标会话)

两者的共同规则:

  • 写入的是 user 来源的 session/title 事件,因此标题被「钉住」:harness 的自动标题(first-prompt provider)被取代,之后的用户消息也不会再自动改名。
  • 格式校验 ^\d{4}\|(功能|设计|修复|优化|发布|探索|文档|研究)\|[^|]+$,报错时附上规范说明。
  • 字节上限预检:上限从部署里挂载的标题服务读取(ctx.get("sessionTitle").config.maxTitleBytes)。超限会直接报错并给出实际字节数,避免被服务静默截断;force: true 表示"照写不误",此时接受服务的安全截断。
  • force: true 同时绕过格式与长度校验,只在用户明确要求非规范标题时使用。
  • 子代理调用 set_session_title 时,若能取到存活 agent 注册表(ctx.get("agents"),惰性),会沿会话血缘上溯到仍然存活的父会话,改的是人在看的那个对话。

测试

node --import ./test/setup-stub.mjs --test ./test/title-tools.test.mjs   # 或 pnpm test

15 条用例覆盖:注册、当前会话改名、任意会话改名、格式拒绝、force 旁路、空标题、无 agent、子代理上溯、无存活父会话、字节上限(取自服务 / 回退默认)、控制器缺失、以及规则函数本身。测试通过 test/setup-stub.mjs 把 @deepseek-ai/dsh-tools 指向桩模块,因此不需要 harness 安装即可运行。

桩只透传定义对象;真实 defineTool 的 schema 转换由"启动验证"覆盖(见下)。

实现要点(踩过的坑)

  • inject 只能列 profile 根作用域 存在的服务。本插件用 ["tools", "sessionTitle"]。 早期版本把 agents 也写进 inject,而该服务在 preset 作用域里才组装,profile 层插件永远等不到它、apply 从不执行,工具也就永远不注册。agent 注册表改为在 execute 里惰性取用。
  • 安装形态必须是 真实包目录:link:(软链到工作区)在运行中的进程里不会成为包解析拦截层;用 tarball 安装进 profile 的 node_modules 才可靠(与 dshmarket 等一致)。
  • 替换已安装的包后热更 不会 换掉进程里已缓存的模块代:必须重启 Harness 才会加载新代码。

运行时已知边界

  • 热更不 import 新模块:profile 配置重载只重新应用 patch,不会 import 新插入行的模块(新文件的新 URL 也不行)——新工具一律等一次重启。
  • rename_conversation 对正被另一个进程持有的活跃会话会被拒绝(already owned by an active write handle):这种对话在 Web 侧栏改名,或让那个对话自己的 agent 调 set_session_title(同进程即可)。
  • 子代理会话(parentSession 血缘、侧栏隐藏)被服务层拒绝(owned by subagent routing),属设计内行为。
  • 跨进程只追加标题事件时,磁盘投影缓存(storages/session_projcache/sessions/<id>.json)不一定刷新;同进程改名会自动刷新。

安装 / 升级

# 1. 在包目录打包
cd <repo>/dsh-tool-set-session-title
mkdir -p ~/.dsh/profiles/desktop/vendor
pnpm pack --pack-destination ~/.dsh/profiles/desktop/vendor     # 产出 <name>-<version>.tgz

# 2. 在 profile 目录安装(相对路径,保持 profile 自包含)
cd ~/.dsh/profiles/desktop
pnpm add ./vendor/dsh-tool-set-session-title-<version>.tgz

# 3. 首次安装还要把包名追加进 package.json 的 dsh.profile.bundles

# 4. 重启 Harness 让新模块代生效

说明:dsh plugin --profile desktop ... 被 CLI 显式拒绝(desktop profile 由 Electron 应用独占管理),所以走 pnpm;Web 侧栏 插件 → 添加插件 也接受本地绝对路径/压缩包,但要注意 link: 形态的坑(见上)。

自包含校验:pnpm install --frozen-lockfile 在 profile 目录应当直接 Already up to date(已验证)。

验证

  • 会话里让模型调用两个工具,标题应立刻变成新值,且此后不再被自动标题覆盖。
  • 侧栏 插件 页能看到组合包 dsh-tool-set-session-title。
  • 启动验证(schema 转换等只有真实运行才能覆盖):复制 profile 到隔离的 DSH_HOME,用 --profile <副本> --no-open --port 0 起一次性实例,确认工具注册且行为正确,再销毁。

卸载

cd ~/.dsh/profiles/desktop
pnpm remove dsh-tool-set-session-title
# 并从 package.json 的 dsh.profile.bundles 移除该名字

然后重启。

结构

文件作用
package.json组合包清单,声明 dsh.bundle.patch,version 与 scripts.test
cordis.patch.ymlprofile 层两行插入(全局工具层)
index.jsset_session_title
rename.jsrename_conversation
title-rule.js纯规则:格式、字节上限、错误文案(无 harness 依赖,便于单测)
test/单测与 @deepseek-ai/dsh-tools 桩(不随包发布)
locale/{en,zh}.json插件页展示用的标题与描述
dsh-tool-set-session-title-0.1.4.tgz构建产物(已装进 profile vendor/)

Comments

Loading…

Similar plugins

dsh-session-title-refresh

by leolee9086

DeepSeek Harness 会话标题插件:在会话菜单中根据对话内容重新总结标题,零运行时依赖

Development & InfrastructureManifest valid

★ 0

MIT

JavaScript

Sep 12, 2026

dsh plugin --profile web add dsh-session-title-refresh

by CHIP-PHILO-GH

DeepSeek Harness「新建会话」命名插件:点新建会话先弹一个轻量对话框填会话名,留空则按第一条消息自动命名。Ask for a session name when starting a new conversation.

Terminal & ClientsManifest valid

★ 0

MIT

JavaScript

Sep 15, 2026

dsh plugin --profile web add dsh-session-namer

by drscrewdriver

给 DeepSeek Harness 侧边栏加一个会话内容检索——标题/内容一键切换,还能按用户/回复/工具筛选

Sessions & MessagesManifest valid

★ 3

↓ 255/wk

MIT

TypeScript

Sep 13, 2026

dsh plugin --profile web add dsh-session-search-toggle

by drscrewdriver

给 DeepSeek Harness 侧边栏加一个会话内容检索——标题/内容一键切换,还能按用户/回复/工具筛选

Terminal & ClientsSessions & MessagesManifest valid

★ 4

↓ 24/wk

MIT

TypeScript

Oct 18, 2026

dsh plugin --profile web add dsh-session-search-toggle

by y2zyyr

Automatic session titles for DeepSeek Harness, using the conversation model. English and Chinese documentation.

Sessions & MessagesManifest valid

★ 0

MIT

JavaScript

Oct 4, 2026

dsh plugin --profile web add smart-session-title

by WiseXin

DeepSeek Harness 独立会话意图分类自动命名插件(⚡ 优化 / 🐛 修复 / ✨ 功能)

Sessions & MessagesManifest valid

★ 0

MIT

JavaScript

Oct 15, 2026

dsh plugin --profile web add dsh-session-intent-title