DeepSeek Harness: Persona Routing Hub

Preface

When DeepSeek Harness (DSH) uses the same set of personas across its web client and multiple QQ bot subjects, a unified routing mechanism is needed to determine which persona each session should use. Manually maintaining these rules is prone to omissions or conflicts, and switching personas between different contexts lacks intuitiveness. The Persona Routing Hub (dsh-persona-hub) provides a hierarchical routing mechanism that centrally manages persona assignment within DSH.

Plugin Overview

dsh-persona-hub is a persona routing hub plugin for DeepSeek Harness, maintained by xkshct198570. It provides a unified persona asset set for the web client and all bot subjects, with routing rules determining the persona used in each session. The plugin only reads local text files, makes no network requests, and does not write to the memory store.

Core Features

Hierarchical Routing

Personas are resolved in the following order:

  1. Binding layer: bots.<id>.<channelType>.bindings[target_id]
  2. Channel default layer: bots.<id>.<channelType>.defaultPersona
  3. Null: returns null, and the caller handles the default

The routing logic follows subject → private/group channel → target_id, falling back through each layer. Disabled layers return null.

Unified Persona Management

  • A single configuration point determines which persona the web client, QQ private chats, and QQ groups each use
  • Switching personas requires only one click and takes effect immediately
  • The panel displays the full routing tree across three tabs

Localization & Isolation

  • Persona bodies are plain UTF-8 text files with no header metadata
  • Display names, avatars, and descriptions are stored in meta.json
  • No network calls, no memory writes, no interception of QQ message flow
  • Shares a single configuration mirror with the Python gateway to avoid dual editing

Security & Isolation

  • By default, the panel API only allows loopback access
  • When remote access is enabled, only a sanitized persona list is returned (excluding target IDs and file paths)
  • Configuration and asset bodies remain loopback-only

Installation & Activation

Marketplace Installation

Search for “Persona Routing Hub” in the DSH plugin marketplace, then install and enable it.

Install from Release

dsh plugin --profile <profile> add <dsh-persona-hub.tgz>

Or select the corresponding tarball file on the DSH plugins page.

Local Development Install

# Use in the plugin manager
link:<absolute_path>

# Install dependencies
pnpm install

# Restart DSH after code changes

After activation, a 🎭 entry appears in the sidebar. No API keys or external services are required.

Configuration & Usage

Switch Web Persona

  1. Go to the Personas & assets tab
  2. Set a persona as the DSH default persona (requires confirmation)
  3. Or edit the default persona on the DSH card and save
  4. On switch, a role prompt is sent to the memory store (if the memory store plugin is installed)

Configure Bot Subjects

  1. Go to the Subjects & channels tab
  2. Add a subject (bot ID + platform)
  3. Set default personas for private and group channels
  4. Or add persona bindings for specific target IDs
  5. Resolution order: binding[target_id] → channel default → null

Manage Assets

  • Persona bodies are headerless UTF-8 text
  • Display names, avatars, and descriptions are in meta.json
  • User copies can be imported/deleted via the panel
  • The bundled bigfish asset is read-only; it can only be overridden via a copy

Debugging & Hot Reload

  1. Go to the Debug & settings tab
  2. Resolve once performs a single resolution with the current configuration, showing the matched persona or one of 11 reason codes (e.g., missing source, unknown subject, platform mismatch, empty channel default, missing asset, etc.)
  3. Hot reload: enabled by default, watches the assets directory and meta.json (150 ms debounce)
  4. After disabling the watcher, use Reload in the panel header to clear the cache and re-read

Sub-Agent Sessions

Sub-agent sessions do not receive the web persona; the hook checks session metadata (origin='subagent'). The main session can still receive personas; if the check fails, the request is allowed through.

Configuration Fields

Field Default Description Effective Timing
dsh.enabled true Injects web persona; disabling it limits the plugin to asset management only Immediate
dsh.defaultPersona 'bigfish' Current web persona key Immediate
bots.<id>.enabled true Subject master switch Immediate
bots.<id>.platform 'qq' Must equal the queried source; dsh is reserved Immediate
bots.<id>.private.enabled true Private channel switch Immediate
bots.<id>.private.defaultPersona '' Private chat fallback; empty string means null Immediate
bots.<id>.private.bindings {} target_id → persona key Immediate
bots.<id>.group.enabled true Group channel switch Immediate
bots.<id>.group.defaultPersona '' Group chat fallback; empty string means null Immediate
bots.<id>.group.bindings {} target_id → persona key Immediate
assets.dir '' Persona body directory; empty defaults to $DSH_HOME/persona-hub/prompts Remount
assets.watch true Watch assets and meta.json; disabling limits refresh to panel-only Remount
panel.allowRemote false Allow non-loopback access to /persona-hub/api/* Immediate
panel.pollMs 60000 Panel refresh interval (5000–600000 ms) Immediate
panel.tab 'personas' Initial panel tab (personas / bots / debug) Immediate

Bot IDs allow letters, digits, . _ : - (numeric QQ IDs are supported), up to 128 characters. Binding values must be valid persona keys (^[a-z][a-z0-9_-]{0,31}$).

Use Cases & Caveats

Use Cases

  • Sharing the same persona asset set between the web client and multiple QQ bot subjects
  • Routing personas by target ID, private chat, or group chat
  • Centrally managing persona assignment through a panel to avoid manual maintenance

Caveats

  • The plugin runs with the current DSH process privileges; review the source code and license before installing
  • Supports DSH >=0.2.2-rc.5 <0.3.0-0 only; requires Node.js >=22.13.0
  • Persona bodies are limited to 200,000 characters; larger files will be rejected
  • Persona keys support only lowercase letters, digits, _, and -, up to 32 characters
  • The bundled bigfish asset is read-only; it can only be overridden via a copy
  • Uninstalling the plugin does not delete user data; removing $DSH_HOME/persona-hub/ will delete imported persona bodies, meta.json, and the cross-process config.json. The web client will fall back to no extra persona, and the Python gateway will revert to its original logic

Ecosystem Context

DeepSeek Harness is designed with the philosophy of “everything is a plugin.” The community catalog (skillhub.cn) is an independent site with no official affiliation to DeepSeek or 01.AI.

Summary

The Persona Routing Hub provides a hierarchical routing mechanism within DSH, allowing the web client and multiple bot subjects to share the same persona asset set while centrally managing them through a panel. It is implemented with local text files, makes no network calls, writes to no memory store, and offers debugging and hot-reload capabilities. It is well-suited for developers who need unified persona assignment across multiple contexts.

  • Catalog page: https://www.skillhub.cn/plugins/xkshct198570/dsh-persona-hub
  • GitHub: https://github.com/xkshct198570/dsh-persona-hub
羽毛球分组比赛记分
小程序二维码

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

Xiaoye