Foreword¶
When using SillyTavern-style presets in DSH Tavern, the common practice is: splice the front section into the single system message, stuff the middle section into the foreground-frame, and force the back section into user while merging it with adjacent user messages. If the preset itself defines a division of labor between system, user, and assistant (e.g., using assistant for prefill in the middle section, or user for instructions in the back section), the default assembly will flatten these roles, resulting in behavior inconsistent with the author’s design in ST.
The dsh-tavern-preset-roles introduced below (maintained by Lindemellis) does exactly one thing: before the play request is sent, it rewrites the message structure and positions based on the role inherent in each preset entry. The import, toggles, front/middle/back ordering, and application to the current session still rely entirely on DSH Tavern’s built-in “Preset Library”.
What is this¶
- Name:
dsh-tavern-preset-roles(Community Catalog: SkillHub Plugin Page) - Source Code: GitHub - Lindemellis/dsh-tavern-preset-roles
- Category: Network Tool (Community entry in the DSH plugin ecosystem; the directory site has no official affiliation with DeepSeek / High-Flyer)
- Version (package.json): 0.1.0, MIT License
The plugin mounts as a DSH bundle via cordis.patch.yml. It does not modify dsh-tavern source code, but relies on its internal markers and modules in the request chain. If a major version change in dsh-tavern causes structural mismatches, the plugin will attempt to pass requests through unchanged to avoid breaking the Tavern itself.
Core Behavior: Differences from DSH Default Assembly¶
| Section | DSH Original Behavior | This Plugin |
|---|---|---|
| Front | Spliced into the single system message | Each entry becomes a separate message using its role; DSH’s own character card / world info system materials are placed after them (controlled by systemPosition) |
| Middle | Stuffed into the writing rules of the current foreground-frame | Sniped out of the frame, inserted into the conversation according to the entry’s injection_depth, using the entry’s role |
| Back | Forced to user and merged with adjacent user messages |
Sniped out and appended at the end in order, using the entry’s role (assistant means prefill) |
Configuration (cordis.patch.yml)¶
Adjustable in the bundle’s patch configuration:
front/middle/back: If a section is set tofalse, that section retains the original DSH behavior.systemPosition:after-front(default) orfirst.debug: Prints the number of rewritten messages to the DSH log each time.
You need to restart DSH Tavern after changing plugin code or cordis.patch.yml; if only changing the frontend (lib/client.js), a Ctrl+R refresh is sufficient.
Cases where no rewriting occurs (passed through as-is)¶
- Non-play requests (requests with
purposesuch as summaries, background settlements, etc.), silly conversations, card workbench. - Conversations in old storage formats (
chats/<id>/snapshots/). - Text mismatches (e.g., DSH upgraded and changed assembly methods): The log will show a prompt, and the request will be sent normally.
Installation and Enablement¶
The README states it has been tested on DSH Tavern 2.5.0 (DSH 0.1.5-rc.2, Windows desktop version). Below, <DSH Tavern> refers to the installation directory (containing DSH Tavern.exe and the data folder). It is recommended to place the plugin directory outside the installation directory so it is not cleared during upgrades.
- Place this repository in any location outside the DSH Tavern installation directory, for example:
D:\dsh-plugins\dsh-tavern-preset-roles(README example path). - Close DSH Tavern, edit
<DSH Tavern>\data\harness\profiles\tavern\package.json:- Add a line to
dependencies(change the path to yours, using forward slashes):
- Add a line to
"dsh-tavern-preset-roles": "link:D:/dsh-plugins/dsh-tavern-preset-roles"
- Add `"dsh-tavern-preset-roles"` to the end of the `dsh.profile.bundles` array.
- Create a directory junction (PowerShell):
New-Item -ItemType Junction -Path "<DSH Tavern>\data\harness\profiles\tavern\node_modules\dsh-tavern-preset-roles" -Target "D:\dsh-plugins\dsh-tavern-preset-roles"
- Start DSH Tavern.
DSH Tavern preserves user-added bundles and dependencies during upgrades. Uninstallation: Remove the two entries mentioned above from package.json and delete the junction, then restart.
This task requires not substituting the above process with commands like dsh plugin add github:owner/repo; please refer to the README.
Typical Usage¶
- Use the “Preset Library” in DSH Tavern as usual: import SillyTavern presets, check entries, sort front/middle/back sections, and apply to the current session.
- After enabling this bundle, send a play request: the plugin will rewrite roles and insertion depths according to the rules in the table before sending; if a section is set to
falsein the configuration, that section still follows DSH’s default logic. - To verify if it is working, turn on
debugand check the DSH log to see how many messages were rewritten each time.
No separate API is needed; the behavior is entirely hooked onto the existing Tavern presets and conversation flow.
Scenarios and Notes¶
Who is it for: Developers or heavy users who are already using ST presets in DSH Tavern and rely on entries’ role, injection_depth, or back-section assistant prefill; who wish to align with SillyTavern-side design without switching to a different set of preset management workflows.
Interface and Adapter Limitations (README known limitations):
- DeepSeek interfaces preserve system messages in the middle position as-is.
- Service providers going through pi-ai (Gemini, Claude, OpenAI, etc.) usually only recognize the first system message; subsequent system messages will be converted to
userby the adapter.
Dependencies and Risks: The plugin relies on dsh-tavern internal structures, including but not limited to the request marker dsh-tavern.request-handled, @deepseek-ai/dsh-system-prompt, foreground-frame, as well as lib/domain/runtime-presets.js, native-conversation-storage.js. Before installation, you should read the source code and MIT license on GitHub; the plugin runs with the current DSH process permissions, so only install from sources you trust.
If you encounter issues, you can open an issue on the repository, noting the DSH Tavern version.
Conclusion¶
dsh-tavern-preset-roles leaves the management of the “Preset Library” to DSH Tavern and only reorganizes the front/middle/back three sections based on entry roles before the play request is sent, aligning with SillyTavern preset semantics. Catalog page: https://www.skillhub.cn/plugins/Lindemellis/dsh-tavern-preset-roles; Source code and installation details: https://github.com/Lindemellis/dsh-tavern-preset-roles.