Introduction

DeepSeek Harness (DSH) supports plugin extension, but it often lacks a unified management and persistence mechanism for prompt injection. winrngs/dsh-session-prompt-standalone aims to provide DSH with global default prompts and workspace-level persistent injection capabilities. While preserving DSH’s native Harness Identity, Agent Preset, and tool instructions, it adds configurable and sortable prompt layers to solve the problem of disorganized rule management across multiple scenarios.

Feature Overview

This plugin provides the following core capabilities:

  • Dual-level support: Global default prompts and current workspace prompts can be enabled at the same time.
  • Identity selection: Each layer can use either System or User Context identity.
  • Independent control: Each layer can independently configure its enabled state and sort value; smaller values appear first.
  • Persistent storage: Settings are stored long-term in the DSH data directory and are reassembled after restart or context compression.
  • Visual preview: The settings UI can preview the current session’s paragraph order, source, and final text.
  • Security approval: Modifications initiated by the model must go through native DSH approval and cannot silently rewrite settings.
  • Concurrency and compatibility: Supports multi-profile concurrency protection, revision conflict detection, and hot reloading of external files.
  • Data protection: Provides versioned settings migration, protection against corrupted data, and default restoration support.

Installation and Enabling

Install the plugin into the specified profile (defaults to web) with the following command:

dsh plugin --profile web add "github:WinRNGS/dsh-session-prompt-standalone#main"

After installation, restart that DSH profile to apply the changes. The plugin automatically creates a configuration file under the DSH data directory.

Usage Steps

On the right side of the session input field, click Prompt Injection:

  1. Select a level: Choose “Global Default” or “Current Workspace”.
  2. Select an identity: Choose either System or User Context identity.
  3. Configure parameters: Set the sort value, enabled state, and prompt body content.
  4. Save to apply: After saving, the next model request will apply the new prompt layer.
  5. Check the preview: Expand the assembly preview to check paragraph order, source, and final text.

Identity and Sorting Mechanism

  • Identity types:
    • System: Reassembled into the actual system prompt for every model request; it remains after session recovery or context compression.
    • User Context: Generates a user-role runtime-context snapshot with source information; a new snapshot is projected only when the content changes.
  • Sorting rules: Smaller values appear first. The typical reference order is Harness Identity (-100), Agent Preset (0), plugin global layer (10), plugin workspace layer (20), and DSH tool instructions (100–199).
  • Concurrency protection: Writes use temporary files and atomic replacement, protected by cross-profile file locks. The API uses revision and If-Match to detect stale drafts; conflicts return 409.

Data Limits and Security

  • Storage limits: A single prompt body is limited to 256 KiB, the request body to 1 MiB, and the settings file to 4 MiB. A maximum of 512 workspace layers can be stored.
  • Data protection: If the entire JSON file is corrupted, a timestamped backup is generated before the next save. A single invalid layer retains its recoverable body content but is automatically disabled, without affecting other valid layers.
  • Environment security: The plugin runs with the permissions of the current DSH process. Check the source code and license before installing.
  • Variable handling: DSH interprets double-brace template variables, but this plugin is designed for plain-text injection and rejects such structures to avoid subsequent request failures.

Summary

winrngs/dsh-session-prompt-standalone provides DSH with a structured prompt management solution. By separating global and workspace layers, supporting both System and User Context identities, and enforcing strict approval controls, it helps developers achieve more precise prompt control without breaking the existing session logic.

Project URL: https://github.com/WinRNGS/dsh-session-prompt-standalone