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 therolesDirdirectory, where each role corresponds to aROLE.md. The file containsid,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 callrecompose(), so it does not reset the session’s tools, skills, or model configuration. Use/role noneto revert to the host’s default persona with one action. -
Host-Native Mechanisms
The plugin uses the host’spersona-switcher:personasection 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 thedefaultRoleconfiguration 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 therole_probediagnostic 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/rolein a session to view the current session role and the role list. -
Switch Role
Enter/role whale-girlto switch to the specified role (whale-girlis the role ID). -
Revert Switch
Enter/role noneto revert the role for this session and restore the host’s default persona. -
Set Default Role
Enter/role default whale-girlto 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, ormodelfields 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), andcordis.patch.ymlfor 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