Foreword¶
The default session title in DeepSeek Harness (DSH) is usually taken only from the first message. As a conversation develops, the title often becomes disconnected from the current topic, making retrieval and maintaining conversational memory context difficult. Manually maintaining these titles is not only time-consuming but also error-prone. To address this pain point, the dsh-smart-title plugin uses a large model to summarize and rewrite the full conversation context, enabling automated and intelligent management of session titles.
What It Is¶
dsh-smart-title is a memory-related DSH plugin developed by maintainer weibaohui and released under the MIT License. It uses an LLM to summarize and rewrite session titles, automatically updating the title after each conversation turn. The goal is to make the session titles in the sidebar reflect the actual intent and progress of the conversation.
Core Features¶
- Full-conversation summarization: Performs a summary over the complete transcript of “user message + assistant response,” so the title reflects what the conversation is actually doing rather than repeating the first sentence.
- Immediate titling on the first message: As soon as the first message in a session arrives, an LLM title is generated, taking over the official
first-promptcadence. - Refresh throttling: A minimum refresh interval is set (default 2 minutes) to avoid consuming the LLM every turn in long sessions, while also eliminating duplicate refreshes between the initial title and the turn-end update.
- Long-session freeze: When user messages exceed a threshold (default 100), automatic refresh stops to reduce the probability of topic drift (except for the startup backfill path).
- Silent same-title skip: If the newly generated title is the same as the current title, the plugin silently returns the current value without triggering write operations or sidebar flicker.
- Automatic retry on failure: Performs fallback retries when the official built-in title provider fails, ensuring that temporary/default titles do not remain permanently.
- Manual rename protection: Titles that a user has manually renamed in the UI (pinned titles) are never overwritten automatically.
- Controlled scope: Can automatically skip subagent sessions and forked sub-sessions, and can be configured to include or exclude assistant responses.
- Startup backfill (optional): Rewrites active sessions whose titles are still fallback text one by one (disabled by default).
- Model selection: By default, follows the current session model; a dedicated route can also be specified for title generation.
Install and Enable¶
Run the following command to install the plugin:
dsh plugin --profile web add @weibaohui/dsh-smart-title -w
After installation, restart dsh web to activate it. During installation, DSH’s built-in first-prompt title provider is automatically disabled (only one provider can coexist in the session-title service; after uninstalling this plugin, the built-in provider is automatically restored).
Typical Usage¶
- Normal usage: After installing and restarting, chat normally. The session title in the sidebar will automatically become a summary-style title after the first turn of conversation.
- Visual configuration: Go to Settings → Smart Session Titles to adjust the master switch, title length, refresh throttling interval, long-session freeze threshold, title model route, scope exclusions, and startup backfill parameters. Changes take effect immediately after saving.
- Repairing existing sessions: Enable the Startup Backfill option and restart the DSH instance once. The plugin will rewrite active sessions whose titles are still fallback text one by one (titles manually changed by users are not affected).
- Editing configuration directly: You can also directly edit the
dsh-smart-title:section in~/.dsh/settings.yaml; changes take effect approximately 2 seconds after saving.
How It Works¶
The plugin writes titles through the official DSH sessionTitle service log event mechanism (session/title), sharing the same channel as the built-in provider. The client sidebar refreshes automatically without any user action.
- Trigger mechanism: The plugin registers as the sole provider to take over the
first-promptautomation cadence and subscribes to theturn/end(completed) event insession/eventto trigger explicit refreshes. - Context construction: On each refresh, the plugin reads the complete session log to build a transcript. User messages are attributed by
seq, assistant responses are trimmed according to a budget, and a summary is generated. - Independent request: The plugin uses
ctx.llmto issue an independent auxiliary request withpurpose: session-title, without affecting the main conversation context or KV Cache. - Filtering and throttling: Before the
turn/endrefresh, two conditions are checked:refreshMinIntervalMs(the minimum interval since the last generated title, covering all paths including the first title) andrefreshMaxTurns(long-session freeze, exempt for the backfill path). - Deduplication: If the generated result has the same title as the current title (ignoring case and whitespace differences), the plugin silently returns the current value without writing or raising alerts.
Applicable Scenarios and Precautions¶
This plugin is suitable for DSH users who need to maintain session context over the long term and rely on the sidebar to quickly find session topics.
The plugin runs with the permissions of the current DSH process. Before using it, it is recommended to review the plugin source code and license (MIT) to confirm its security.
Summary¶
dsh-smart-title provides a complete solution from installation to configuration to backfill, solving the problems of irrelevant default titles and cumbersome manual maintenance. For developers who value session management efficiency, it is a plugin worth adding to the toolbox.