dsh-set-session-title: DeepSeek Harness Agent Session Rename Tool

Preface

DeepSeek Harness (DSH) maintains session titles by recording log-only session/title events (zero tokens), provided by the @deepseek-ai/dsh-session-title service. This service is written by deterministic prompt fallback or an optional LLM provider.

However, in version 0.2.0-rc.2, the automatic title generation capability has flaws (e.g., writing back vocabulary from the instructions themselves, such as “session title”, as the title), and the SessionTitleService.rename capability is not exposed to the model side (no tool, no CLI subcommand, restricted API). This plugin fills this gap by exposing the existing rename service as a tool to the model.

Plugin Introduction

dsh-set-session-title is a model-facing set_session_title tool. It allows intelligent agents to rename their own sessions without human intervention.

  • Author: CancerTiN
  • Category: Model Inference
  • License: MIT

Core Features

  1. Rename Capability: Allows agents to rename the current session via tool invocation.
  2. Event Writing: Writes a session/title event to the log, marking the source as user.
  3. Priority Override: User-sourced titles are authoritative and override ongoing automatic generation; subsequent prompts will not trigger automatic generation (unless explicitly refreshed).
  4. Scope Restriction: Limited to the calling agent’s own session (exec.agent.session); cross-session renaming is not supported.
  5. Data Normalization: Input is trimmed, stripped of terminal control sequences, and limited by the deployment configuration’s maxTitleBytes (default 80 for dsh-base). If empty after normalization, the write is rejected.
  6. Zero Cost: Does not consume any conversation tokens and does not alter message content.

Installation and Activation

Install using the official plugin manager. Using Git specifications with version tags is recommended to ensure reproducibility.

dsh plugin --profile <name> add github:CancerTiN/dsh-set-session-title#v0.1.1

Note: If #v0.1.1 is not specified, the default branch will be followed instead of locking to a release version.

After installation, the plugin registers the tool into the configuration tree via the dsh.bundle.patch patch declared in the manifest. Some build versions may require restarting the configuration file for it to take effect.

Usage

Invocation Method

Ask the agent during conversation, or invoke directly in a skill. The tool accepts a JSON parameter:

{"title": "Install terminal plugin and verify connectivity"}

Return Result

{"title": "Install terminal plugin and verify connectivity", "eventSeq": 1307}

Verify Title

Read back the title via projection cache or persistent log:

Via Projection Cache (GUI Reading Source):

python3 -c "import json;print(json.load(open('$DSH_HOME/storages/session_projcache/sessions/$DSH_SESSION_ID.json'))['record']['rows']['title'])"

Via Persistent Log:

zstd -dc "$DSH_HOME"/sessions/*/"$DSH_SESSION_ID"/session.v4.jsonl.zstd | grep session/title | tail -1

Notes and Limitations

  1. Permission Restrictions: Limited to the calling session; no cross-session renaming capability; rejects non-agent callers (pure host-side execution will be rejected).
  2. Prerequisites: The deployment must include the session-title service (@deepseek-ai/dsh-session-title). Missing this service will cause an error during plugin loading.
  3. Dependency Management: This plugin intentionally declares no dependencies to avoid failures in other tool calls due to module identity splitting in pnpm environments.

Conclusion

This plugin fills the gap in DSH’s session title correction, providing a zero-cost, zero-token approach for intelligent agents to manage their own context. For scenarios requiring fine-grained control over session naming or fixing automatic generation errors, this is a necessary supplement.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye