In DeepSeek Harness (DSH), new sessions are numbered by default using timestamps, making it difficult to quickly browse lists of long-running sessions. Existing solutions either wait until idle before generating titles (no title while the user waits) or call a model on every turn (high cost). This plugin splits these two concepts into complementary stages: instant keyword titling and idle budget-model refinement.
Core Features¶
- Two-stage pipeline: generates a keyword-based title immediately when a user message arrives (zero cost, millisecond-level); after the session becomes idle, it calls a budget model for refinement, so the title evolves with the session.
- Cost control: budget routing automatically selects the cheapest model from the registered model catalog by name pattern, and automatically invalidates the cache when the model topology changes.
- Raw keyword algorithm: includes denoising (code blocks/URL/Markdown), script detection (Latin/CJK), stopword and function-word filtering, and order-preserving character-budget truncation, supporting Chinese, English, Japanese, and Korean.
- Title deduplication: identical titles are not written again; duplicate titles across sessions automatically get a numeric suffix (e.g.,
Fix Login Bug (2)). - Summary integration: the refinement stage also generates a one-line session summary, written to the session log via the
session/caption-noteevent for list UIs and export tools. - Respect manual titles: after a manual rename, automatic generation completely stops and never overwrites (even if a rename occurs while a refinement call is in progress, no write-back occurs).
- Zero-config startup: works out of the box with the default configuration, and all behavior is tunable.
Installation and Activation¶
Install the latest version into a specified profile via the command line:
dsh plugin --profile demo add github:JohnXu22786/session-titler
Remove the plugin:
dsh plugin --profile demo remove dsh-session-caption
It can also be installed from a local directory or tarball:
# 从本地目录
dsh plugin --profile demo add /path/to/dsh-session-caption
# 从本地 tarball (需先 npm pack)
dsh plugin --profile demo add ./dsh-session-caption-0.1.0.tgz
After installation, the DSH process must be restarted for changes to take effect. After successful installation, the output of dsh --profile demo --dump-config should include the session-caption configuration line.
Configuration¶
The plugin supports zero-config startup; all behavior is tunable. The configuration file is located at $DSH_HOME/cordis.patch.yml. The following are the key configuration items:
- id: session-caption
config:
instant:
enabled: true # 开启 Phase 1 关键词提取
maxCjkChars: 14 # 中日韩标题最大字符数
maxWords: 6 # 拉丁语标题最大单词数
refine:
enabled: true # 开启 Phase 2 优化
timeoutMs: 60000 # 单次调用超时时间
model:
provider: '' # 显式指定 Phase 2 使用的模型提供商
model: '' # 显式指定 Phase 2 使用的模型名称
dedup:
enabled: true # 开启标题去重
suffix: '({n})' # 重复后缀模板
Technical Implementation¶
The plugin is a standard DSH Bundle (configuration layer + plugin code), pointing to cordis.patch.yml via the dsh.bundle field in package.json. On startup, it disables the built-in session-title-llm (because the session-title service is designed as single-provider) and registers its own session-caption provider.
- Phase 1: performs direct keyword extraction on user messages without calling an LLM.
- Phase 2: triggered only during the session’s idle window. Model selection priority is: explicit configuration > budget mode (filter for cheap models) > the session’s own routing.
Notes¶
- Restart required: after installation, the DSH process must be restarted for the configuration to be loaded.
- Single-provider conflict: the
session-titleservice is designed as single-provider. If another plugin also registers a title provider, they will replace each other. The plugin’s bundle layer disables the built-insession-title-llmby default. - Idle window: if
instant.enabledis turned off, Phase 1 no longer generates titles, but Phase 2 still only runs during the idle window and does not generate during busy periods.
References¶
- GitHub: https://github.com/JohnXu22786/session-titler
- Catalog page: https://www.skillhub.cn/plugins/JohnXu22786/session-titler