Introduction¶
When developing Web profiles for DeepSeek Harness (DSH), relying only on Persona- or System-level rules to constrain the model is often unreliable in long conversations: the model may gradually forget these rules, and even explicitly written rules (for example, “refresh the code graph before coding every time” or “check the Wiki first for factual questions”) can silently stop being followed in later turns.
dsh-prompt-injector solves this problem. It reuses the memory recall mechanism from dsh-mem0-plugins and generalizes it: you can maintain a list of prompts in the settings page, and the plugin injects these prompts into the front of the model context as a “Context injection” notice line during each dialogue turn. This ensures that key rules or reminders are visible to the model in every turn, improving execution consistency.
Plugin Positioning¶
- Name:
runfali/dsh-prompt-injector - Maintainer:
runfali - License: MIT
- Core capability: Provides a generic per-turn context injection mechanism for DSH Web profiles, supports managing injection content through the UI, and does not modify DSH source code.
Core Features¶
This plugin mainly provides the following capabilities:
- Per-turn injection: In the
agent/pre-stepstage, when new input is detected, all enabled prompts are appended to the current context as a collapsed “Context injection” notice line. - Trigger modes:
everyTurn(default): Injects on every dialogue turn.postCompaction: Injects once after context compaction or summarization.
- Global switch: Controlled by the
enabledconfiguration item. - Trivial-turn filtering:
skipTrivialis enabled by default and automatically skips brief confirmation messages such as “okay / um / got it / continue / ok / thanks”, avoiding interference with substantive dialogue. - Prompt management UI: Supports adding, deleting, and editing prompts directly in the DSH settings page, with independent enable/disable control for each entry.
- Reminder only, no execution: The plugin does not call any tools and does not perform any checks; it only injects text into the context, while the model retains full decision authority.
- Zero intrusion: It does not modify DSH source code and depends only on two relatively small runtime packages.
Installation and Configuration¶
The plugin is published as a standard DSH Bundle plugin.
Install command:
dsh plugin add
Configuration:
After installation, you can find the plugin’s configuration card in the DSH settings page. From there, you can manage the prompt list:
* Title: The entry title used for UI display.
* Content: The actual prompt text to be injected.
* Switch: Each entry can be enabled or disabled independently.
* Trigger mode: Select everyTurn or postCompaction.
* Filtering: Confirm whether skipTrivial is enabled.
How It Works¶
The plugin runs at the agent/pre-step mount point and appends messages to decision.messages. The injected message format is as follows:
- Role:
user - Source:
kind:plugin:dsh-prompt-injector(uses the plugin’s own namespace, in line with the V4 message specification)form:noticesummary: The plugin entry title
The DSH UI renders this type of message as a collapsed “Context injection” notice line, making the information visible to the model early in the context when planning its reply.
Security and Dependencies¶
- Runtime dependencies: The plugin declares only three
peerDependencies, all provided by the DSH host:@deepseek-ai/dsh-settings@deepseek-ai/schemasteryreact
- Permission boundaries:
- No network access permission.
- No subprocess creation permission.
- No file system write permission.
- Injection errors are isolated and do not cause the entire dialogue turn to crash.
- Requirements:
- DSH version:
>=0.1.2-alpha.3 - Node.js version:
^22.19.0 || >=24.0.0
- DSH version:
Use Cases¶
This plugin is suitable for developers who need to repeatedly emphasize specific constraints or rules in every dialogue turn. For example:
* In coding tasks, repeatedly remind the model to “check the graph before writing code”.
* In complex Q&A scenarios, repeatedly remind the model to “follow the safety red-line checklist”.
* In long conversations, forcibly refresh a specific context summary.
The design philosophy of the plugin is “remind rather than execute”: it embeds rules into the context and lets the model decide when to act when generating the final reply.
Conclusion¶
By integrating a generalized context injection mechanism into the DSH workflow, dsh-prompt-injector addresses the problem of rule forgetting in long conversations. Its zero-intrusion design and UI-based management make it easy to maintain and debug.
- GitHub repository: https://github.com/runfali/dsh-prompt-injector
- Plugin directory: https://www.skillhub.cn/plugins/runfali/dsh-prompt-injector