Introduction¶
DSH (DeepSeek Harness) Agent presets determine a session’s tool catalog, system prompt, and capabilities. Under the official mechanism, presets are usually determined at session startup (turn/start) and cannot be changed afterward. This design ensures logical consistency between conversation history and tool calls. However, in real development or debugging, you may sometimes need to switch work modes mid-session. This plugin reuses the official AgentPresets.recompose mechanism to allow hot switching at session step boundaries.
Feature Overview¶
This plugin provides DSH sessions with the ability to switch Agent presets at runtime.
* Slash commands: Supports /mode list and /mode <preset-id>.
* Applied at step boundaries: Switching does not interrupt an in-progress model request; it takes effect after the current step completes and before the next request is assembled.
* Reuses mechanisms: The underlying implementation reuses the official AgentPresets.recompose logic, including singleton mounting and scope rebinding.
Installation and Enablement¶
Install the plugin package with the dsh plugin command.
dsh plugin --profile web add "git+https://github.com/aefuimn/dsh-agent-preset-switcher.git"
After installation, restart the dsh web process and refresh the page to load the plugin.
To verify the installation, run:
dsh plugin --profile web ls
The output list should contain dsh-agent-preset-switcher.
Typical Usage¶
After installation and restart, you can use slash commands in DSH sessions.
-
View the current preset and all presets:
Enter/mode list. The system returns the preset ID currently in use and lists all available presets. -
Request a preset switch:
Enter/mode <preset-id>. The system records the request and prepares to apply the change at the next step boundary.
Applicable Scenarios and Notes¶
This plugin is suitable for scenarios where you need to dynamically test different Agent presets during debugging or interaction.
- Concurrency and interruption: Switching is asynchronous and does not interrupt an in-progress model request. The maximum wait time is the time required to complete the current step.
- Sub-agent limitation: Sub-agent sessions cannot use the switching functionality provided by this plugin; their presets follow the parent session.
- Error handling: If the underlying
recomposemechanism throws an exception, the switch operation is treated as failed and the session remains unchanged. - License: MIT license.
Conclusion¶
By introducing step-boundary rebinding, this plugin increases the flexibility of DSH sessions without breaking the official architecture. Developers can try different Agent work modes mid-conversation.