DeepSeek Harness Persona Switching Plugin

Introduction

The core of DeepSeek Harness (DSH) lies in pluggability and Agent flexibility. In practical use, developers often need to change only the tone and persona of the model’s speech mid-session, without resetting its existing tools, skills, or model selection. Some existing switching solutions require registering an Agent Preset or calling recompose() when performing a persona replacement. This also resets the entire session’s tool composition, causing tool loss or a cleared command table.

The dsh-persona-switcher plugin solves this problem. It uses the host’s native persona-switcher:persona section mechanism to inject the role body into the prompt, achieving “swapping only the speaker, without touching the tools in hand.”

Core Capabilities

  • Role Library Management
    The plugin supports maintaining role files in the rolesDir directory, where each role corresponds to a ROLE.md. The file contains id, name, description, and the persona body. Role files can use a directory structure or a flat file format.

  • Mid-Session Switching
    Use the /role <id> command to switch roles in the current session. The plugin does not call recompose(), so it does not reset the session’s tools, skills, or model configuration. Use /role none to revert to the host’s default persona with one action.

  • Host-Native Mechanisms
    The plugin uses the host’s persona-switcher:persona section mechanism to inject role content as a standalone prompt section. It does not mask the host’s deployment identity line (e.g., You are a coding agent...); it only appends a persona description afterward, ensuring the model always knows which model it is running on.

  • Persistence and Defaults
    Each time a session role is switched, the plugin records the selection in $DSH_HOME/persona-switcher/sessions.json. After restarting DSH, the first prompt for that session automatically applies the previously recorded role. It also supports setting the default role for new sessions through the defaultRole configuration item.

  • Visual Management and Diagnostics
    The settings page provides a visual role library management interface (including a dedicated navigation icon), supporting creating, editing, and deleting roles. It also provides the role_probe diagnostic tool to check the current binding state, system nodes, and tool list.

Installation and Enabling

Ensure DeepSeek Harness >= 0.2.0-rc.1 is installed.

dsh plugin add --profile desktop dsh-persona-switcher

After installation, fully exit and restart DSH for the changes to take effect.

Usage

  • View Current Status
    Enter /role in a session to view the current session role and the role list.

  • Switch Role
    Enter /role whale-girl to switch to the specified role (whale-girl is the role ID).

  • Revert Switch
    Enter /role none to revert the role for this session and restore the host’s default persona.

  • Set Default Role
    Enter /role default whale-girl to set the specified role as the default role for new sessions.

  • Settings Page Operations
    Directly manage roles visually in the “Persona Switching” section of the settings page.

Boundaries and Security

By design, the plugin strictly limits its permission scope. It writes only in-memory prompt sections and specific configuration files, and does not involve network requests or credential reads.

  • Capability Boundaries

    • It does not declare any role-level tools, skills, or models.
    • It does not read the tools, denyTools, skillsDir, or model fields in role files.
    • It does not register an agent preset or call recompose().
    • It does not mask the host’s identity line.
  • File Write Locations
    The plugin writes to only four locations: $DSH_HOME/persona-switcher/sessions.json (session records), role files under <rolesDir> (only when the user actively creates/edits/deletes them), and cordis.patch.yml for the host profile (indirectly written through the settings layer).

  • Network and Privacy
    The plugin does not access the network, does not upload role content, and does not read credential files. It exposes only a minimal set of endpoints through the host’s existing local webServer (such as listing roles) and does not start a standalone service.

Summary

dsh-persona-switcher is a lightweight plugin focused on “persona layer” switching. If you need to frequently switch the model’s tone without resetting the tool chain, it provides a more granular control solution than replacing an Agent Preset. After installation, role files are retained, and uninstalling thoroughly removes all traces.

  • GitHub repository: https://github.com/yupaoa/dsh-persona-switcher
  • Plugin catalog: https://www.skillhub.cn/plugins/yupaoa/dsh-persona-switcher
羽毛球分组比赛记分
小程序二维码

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

Xiaoye