DSH Plugins Marketplace

DSH Plugins

Plugins

/

dsh-auto-rename

T

dsh-auto-rename

Manifest valid

Automatic conversation naming plugin for DeepSeek Harness (DSH): names the first prompt and streams AI title suggestions in the rename dialog.

UI (client)hasBundlePatch
dsh-auto-rename icon

dsh-auto-rename

Automatic conversation naming for DeepSeek Harness. The first prompt names itself, and the rename dialog streams AI suggestions.

version license dsh node

English · 中文


Features

Names the first prompt. When a session sends its first message and the title is still empty, a title is generated — once, from that message alone. A manual rename pins the title afterwards, so it is never rewritten under your hands.

Suggests titles when you rename. The AI Name button sits at the top of the conversation page. Its dialog looks and behaves like DSH's native rename window, with three extra things:

Streaming candidatesSuggestions arrive one at a time (NDJSON), each revealed by a 500 ms left-to-right sweep
One-click applyClick a chip to fill the input; Regenerate for a fresh set
Native feelEnter confirms, Esc closes, and Enter during IME composition never submits by mistake

Uses a model you choose. Naming follows the conversation's main model by default, or pins a cheaper one. The dropdown is built from the host's remote.session.modelCatalog(), which enumerates providers one by one and drops those that return nothing — so every entry is a model the host has actually authenticated and can really call.

Leaves the audit trail. The provider id dsh-auto-rename is written into source.provider of every session/title event, so you can always tell which titles this plugin produced.

Why it builds its own dialog instead of extending the native one

The native rename window is an internal host component with no extension point: RenameForm declares no injectable slot, the requestSessionRename it needs is passed only as a prop into sidebar menu items, and nothing in the bundle ctx.provides it. The plugin can therefore neither insert a suggestion row into it nor open it programmatically. It builds its own dialog and copies the native window's CSS rules one by one, so the two are visually indistinguishable.

Install

dsh plugin add dsh-auto-rename

From a checkout instead:

dsh plugin --profile desktop add <path-to-this-repo>

The package declares dsh.bundle.patch, so installing it also inserts dsh-auto-rename into the profile's bundle stack and disables the built-in session-title-llm row from dsh-base. That second part is required: SessionTitleService.register() accepts exactly one provider globally, so if the built-in row registers first, this plugin's registration throws.

Restart DSH afterwards. Client-side changes hot-reload; host-side changes need the restart.

Settings

Open the AI Name dialog and click the gear in its title row, left of the close button. The panel expands inside the same dialog. Edits are staged in a draft and written only when you press Save; an empty field means "use the default".

FieldDefaultNotes
Rename on first promptonTurning it off leaves suggestions working
Naming modelFollow main modelLists only models the host has authenticated and can currently list
Suggestions3Candidates fetched per dialog open (1–5)
Output limit (tokens)64Per-generation token cap
Timeout (ms)60000Longest wait for one generated title
Title width (CJK characters)12The only length knob; longer output is truncated

If the host has no remote assembled, or listing fails, the model row falls back to manual Provider / Model fields. They must be filled in pairs: a half-set route logs a warning at startup and errors clearly when used, rather than silently doing nothing.

How it works

It reads only what you typed. Neither path looks at assistant replies: automatic naming takes the first human message, suggestions take the three most recent ones so they describe the topic in progress rather than the opening line. Each message is clipped to maxInputBytes (default 4096) before it reaches the model, because the official shared implementation throws on oversized input.

Length is measured in display width, not characters. One CJK character costs 2 half-width units, everything else — spaces included — costs 1. The budget is Title width × 2, so the default 12 allows 12 Chinese characters or 24 Latin characters including spaces, roughly 3–4 words. One knob governs both scripts; there is no separate word count for English, because word lengths vary too much for a count to mean anything.

The official shared implementation still wants a targetWords value (prompt-only, never truncating), so it is derived from the same budget at ~6 units per word — 12 yields 4. That keeps the model's target close to the hard cut instead of writing long and being trimmed.

Truncation avoids mangling words. A cut landing mid-word falls back to the previous space, so you never get sessio. When there is no space to fall back to — a provider/model route, a URL — the title is left alone: slightly too wide beats a broken word.

Why the plugin has to truncate at all

The official caller passes Number.MAX_SAFE_INTEGER as the truncation argument of normalizeSessionTitle — that is, no truncation whatsoever. The host does enforce a maxTitleBytes ceiling (80 bytes ≈ 26 CJK characters), but it is far too loose to keep titles short. So "not too long" is this plugin's job, and the practical ceiling of the width knob sits below the host's byte limit.

Project layout

lib/config.js    Pure logic: config merge, source-message picking, title truncation.
                 Zero imports, testable on its own.
lib/index.js     Host half — registers the title provider and the HTTP bridge.
lib/client.js    Client half — header button, rename dialog, in-dialog settings panel.
cordis.patch.yml Bundle patch: insert this plugin, disable built-in session-title-llm.
locale/          Display metadata for the plugin manager (title, description).
test/            Self-checks: logic, host apply, client render, locale audit, patch.

The two halves talk over three HTTP routes, each accepting loopback origins only (127.0.0.1, ::1, ::ffff:127.0.0.1) and rejecting sec-fetch-site: cross-site:

RoutePurpose
POST /dsh-auto-rename/suggestStream N candidate titles as NDJSON
POST /dsh-auto-rename/configEcho the currently effective config, for debugging
POST /dsh-auto-rename/settingsWrite config through the host settings service, whitelist-filtered

The write route answers 503 when the host settings service is absent, rather than reporting success it did not achieve.

Development

npm run check

Six gates, all fast and all offline:

  1. Syntax check of the host and config modules, plus a parse check of the client bundle.
  2. Pure-logic self-test — config merge, message picking, the width budget and the byte budget.
  3. Host apply() smoke against a fake context: metadata, degradation paths, provider shape, route guards, and the exact Config schema field list.
  4. Client apply() smoke: renders the header entry and the settings panel for real, and covers all three catalog degradations. The fake context reproduces the host's restricted facade, including the fact that reading ctx.inject throws.
  5. Locale audit: every dictionary key used in code exists in both zh and en.
  6. Patch check: cordis.patch.yml disables the built-in row, inserts this one, and touches nothing else.

The smokes need @deepseek-ai/schemastery. Locally, junction it from an installed profile:

New-Item -ItemType Junction -Path node_modules\@deepseek-ai\schemastery `
  -Target "$env:USERPROFILE\.dsh\profiles\desktop\node_modules\@deepseek-ai\schemastery"

test/stubs/ holds a dsh-session-title-llm stand-in that echoes the arguments it receives, so the call wiring can be verified outside DSH without reimplementing the official provider.

Known limits

  • Slot renames fail silently. The header button depends on conversation.session.header.actions, declared in DSH 0.2.0-rc.2. When a slot is not declared, the slots.inject callback never fires and nothing throws — so a host upgrade that renames it makes the button vanish without a trace. The version badge above records the host this was last verified against.
  • Settings are deliberately not on the host settings page. Both available slots were tried (plugins.bundle.config and plugins.item): registration succeeds inside an instrumented stand-in, renders nothing in the real UI, and reports no error. The panel is therefore drawn inside the dialog and reads/writes over the HTTP bridge.
  • Prompts are the official ones. Automatic naming and suggestions share a single LLM call path, delegated to the shared implementation in @deepseek-ai/dsh-session-title-llm, so prompts, timeouts and normalisation match the built-in provider exactly. Only the length cap is this plugin's addition.
  • Suggestions are not logged. They do not write a session/title-llm-request event: that event is the one-shot audit record for automatic naming, and suggestions can be regenerated without limit, so logging them would bloat the session log.

License

MIT

Comments

Loading…

Similar plugins

dsh-session-namer

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 9Ashwin

DSH plugin: a model-facing rename_session tool, so the agent can retitle a session from inside the conversation.

Tools & CapabilitiesSessions & MessagesManifest valid

★ 0

MIT

JavaScript

Sep 13, 2026

dsh plugin --profile web add dsh-session-rename

by mikulo

DeepSeek Harness (DSH) plugin: pick a local .md prompt template with / when starting a new conversation; it binds the whole conversation with AGENTS.md-level authority.

Development & InfrastructureManifest valid

★ 1

MIT

JavaScript

Sep 30, 2026

dsh plugin --profile web add @mikulo/dsh-prompt-switcher

by Fishsb

DeepSeek Harness (DSH) 插件:✨ 提示词一键增强 + 💬 语音识别(说完自动停·云端/本地双引擎)· 附 🔁 服务异常一键重启

Tools & CapabilitiesManifest valid

★ 93

Unknown

JavaScript

Oct 16, 2026

dsh plugin --profile web add dsh-prompt-enhancer

by Frog755

Prompt Vault: 输入框上方的提示词库(DSH 插件)— 📚 按钮展开面板,点条目一键填入 prompt。DeepSeek Harness prompt library plugin.

UI & ExperienceDevelopment & InfrastructureTerminal & ClientsManifest valid

★ 5

↓ 315/wk

MIT

JavaScript

Sep 10, 2026

dsh plugin --profile web add @frog755/dsh-prompt-vault

by yaoshuo530

A prompt-enhancement plugin for DeepSeek Harness: an ✨ Enhance composer button that rewrites prompts with first-principles thinking using session context, and asks clarifying questions when key info i

UI & ExperienceSessions & MessagesManifest valid

★ 5

MIT

JavaScript

Aug 28, 2026

dsh plugin --profile web add dsh-prompt-enhancer