dsh-chat-preset: Pure Chat Mode for DeepSeek Harness

Introduction

DeepSeek Harness (DSH) Agents typically come bundled with multiple tools: file read/write, command execution, sub-agents, to-do lists, research tools, and more. In a pure conversational context, these capabilities are often misused or consume a large number of tokens due to excessively long context. What we really need is simply a “Chat mode”: chat directly like a web-based chat interface, with only the web search tool exposed and everything else completely locked down.

dsh-chat-preset is a DeepSeek Harness agent preset whose core purpose is to provide such a Chat mode — it disables all globally registered tools coming from profile-level plugins and retains only web_search.

What It Does

This preset declares four lines of configuration via cordis.patch.yml to control persona and tool registration:

Line Package Purpose
persona @deepseek-ai/dsh-persona complete: true — the persona IS the entire system prompt; tool guidance, runtime context, and prompt segments from other plugins are not injected
tool-web @deepseek-ai/dsh-tool-web search: true, fetch: false: registers only web_search, does not register web_fetch
tool-lock This repo’s index.js Masks all globally registered tools from profile-level plugins wholesale, with a guard that only allows web_search through
compaction @deepseek-ai/dsh-compaction-basic + /compact Automatic compaction for long conversations

Why tool-lock is Needed

A preset can only decide “what to mount itself”; it cannot control “what exists globally.” The tool registry resolves by scope: tools registered by profile-level plugins (e.g., dsh-zotero, dsh-ai4scholar, agentero-dsh) belong to the global layer and are inherited by every Agent. Simply stating in the persona “you have no tools” won’t help — the request will still carry dozens of tool schemas, and they can genuinely be invoked. persona.complete only clears the system prompt; it does not remove the tools field.

index.js therefore does two things:

  • ctx.tools.restrict({ deny: [...] }): Lists global registry tool names into a deny list, removing them from the visible tool set in Chat mode (schemas are no longer sent, saving tokens). Since restrict only matches exact names, it subscribes to tools/change and recomputes the deny list whenever the registry changes.
  • ctx.tools.guard(...): A monotonic veto that does not inspect names. It allows only web_search through and rejects all other invocations, serving as a fallback when the mask cannot reach a tool.

The preset’s own scoped registrations are unaffected by restrictions (that’s how web_search is retained), so simply include its name in the whitelist.

Why Not web_fetch

It’s a second tool, and the dsh-tool-web documentation explicitly states that fetch does not request approval and HTTP providers do not restrict target addresses — meaning the model can access loopback and intranet addresses. A pure chat mode should not carry this capability, hence fetch: false.

Installation & Activation

Requirements: DSH Desktop (or a profile with a Web UI) whose tool registry provides ctx.tools.restrict, ctx.tools.guard, and tools/change, and whose persona supports complete — this repo was developed and validated on DSH 0.2.2-rc.3.

Choose one of the following:

  1. Command-based: In a DSH conversation, instruct the agent to use plugin_manager (action: install_bundle, target pointing to this directory);
  2. GUI: Plugins → Add Plugin, then select this directory.

Installation writes it into the profile as a link: dependency. Do not move or delete this directory afterwards, or the mode will break.

After installation, fully quit and restart DeepSeek Harness. The mode list in new sessions will show Chat Mode (listed last, order: 6). Existing sessions retain the mode active at their start time and are unaffected.

Usage

New session → select Chat Mode → just chat. For time-sensitive questions (news, version numbers, prices, someone’s current role) or explicit requests like “look it up,” it will call web_search and cite sources with Markdown links. When you need file read/write or command execution, switch back to Standard / PTC / Minimal / Creator.

Is Search Available?

web_search availability is determined per step by provider readiness. When unavailable, it is silently withdrawn (no error surfaced; the model simply never sees this tool) rather than showing an error card. Chat Mode does not specify a provider; it follows the backend already mounted in the profile and selected under “Settings → Web Search & Fetch” (dsh-web-search-deepseek for DeepSeek native search, or dsh-web-deepseek-api’s Search API). A DeepSeek account login or a configured DEEPSEEK_API_KEY is sufficient to make it ready.

Customization

  • Modify persona / adjust when search triggers: Edit persona.config.prefix in cordis.patch.yml. Note that complete: true suppresses prompt segments from other plugins, so dsh-tool-web’s built-in “external content is untrusted, cite links” segment won’t appear in the prompt. This repo writes those rules directly into the persona — don’t lose them when editing.
  • Tune search budget: tool-web.config supports searchMaxResults (default 10), searchMaxQueries (default 10), searchSummaryMaxChars (default 800), searchTimeoutMs (set to 60000 in this repo, since DeepSeek native search runs within a single full model turn). Setting fetch: true enables web_fetch, but then you’d have more than one tool and would need to relax the whitelist in index.js accordingly.
  • Change display name: config.name (currently Chat Mode); config.id: chat is the stable identity for session records — changing it will break mode bindings on existing sessions.

File Structure

dsh-chat-preset/
├── cordis.patch.yml   # bundle patch layer: inserts the preset-chat preset declaration line
├── index.js           # tool-lock: restriction + guard (ESM, no dependencies)
├── package.json       # dsh.bundle.patch points to cordis.patch.yml
├── locale/{en,zh}.json# title / description / detail for the plugin page
├── docs/DETAIL.md     # plugin detail page body
├── icon.svg           # plugin icon (36×36 chat bubble)
└── README.md

Debugging tip: Changes to cordis.patch.yml or index.js both require a DSH restart to take effect (the profile’s patch layer is only synthesized at startup). The activation diagnostics for @local/dsh-chat-preset on the plugin page are more reliable than logs.

Known Limitations

  • Only one tool: cannot read the workspace, cannot execute commands, cannot retrieve full page content (only search result summaries are available), and has no runtime context (doesn’t know the current date, working directory, or file contents unless you paste them in).
  • Because the persona is complete, any future plugin that ships its own prompt segment won’t be able to inject into this mode — this is the cost of “pure chat.” Capability changes can only be expressed by modifying this preset.
  • tool-lock covers tools in the global registry and rebuilds when the registry changes. If a plugin registers tools only in its own private scope, the mask cannot reach them by design (scoped registrations stay visible); in that case, the guard blocks execution — the model may see a tool card it can’t use.

Use Cases & Cautions

This preset is suited for conversational scenarios that only need web search and do not rely on file read/write or command execution. It runs with the current DSH process’s permissions — review the source code and license before installing. When you need file operations or command execution, switch back to Standard / PTC / Minimal / Creator mode.

Brief Closing

dsh-chat-preset provides DSH with a clean, controllable pure chat mode, exposing only web_search and locking down all other capabilities. If you’re looking for a “search-only, no random actions” conversational preset, give it a try.

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

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

Xiaoye