Introduction

DeepSeek Harness (DSH) uses a plugin-based architecture. When debugging prompts, frequently switching between DSH and an external editor disrupts the workflow. DSH Prompt Polisher is a plugin that adds a native “Polish” button next to the Send button in the DSH input box, directly optimizing prompts using the current session’s model configuration and reducing environment-switching costs.

What It Is

Project name: siyue-zo/dsh-prompt-polisher

Maintainer: SiYue-ZO

Summary: A secure, native prompt polishing plugin for DeepSeek Harness. It reuses the current session’s configuration for polishing and supports conflict detection, session isolation, and privacy protection.

Core Features

  • Native button: Adds a “Polish” button in the official conversation.input.right slot.
  • Configuration reuse: Automatically reads the current session’s provider, model, and reasoning effort, without requiring the API key to be configured again.
  • Interaction control: Supports loading, canceling, result preview, retrying on failure, applying, copying, and restoring the original text.
  • Conflict detection: Uses a draft + draftRev mechanism, so continued input during a request does not overwrite the result.
  • Session isolation: Each session has its own controller, AbortSignal, and generation guard, preventing stale responses from being written back across sessions.
  • Context control: Sends only the current draft by default; optional, limited recent conversation context is available.
  • Accessibility: Supports Chinese and English UI, keyboard accessibility, theme tokens, and reduced-motion.

Installation and Enablement

Environment requirements:
- Node.js >= 22.19.0
- DSH 0.1.0-rc.7

Installation command:

dsh plugin --profile web add github:SiYue-ZO/dsh-prompt-polisher#v0.1.0

After installation, a “Polish” button will appear next to the Send button in the Web UI input box.

Configuration

The plugin’s default configuration is located in the bundle’s cordis.patch.yml. To override it, provide a complete config under the same row id prompt-polisher in the profile’s cordis.patch.yml (note: DSH’s later config layer is a full replacement, not a deep merge).

Default configuration parameters:

Field Default Value Description
maxInputChars 20000 Character limit for the current draft
maxOutputChars 30000 Character limit for the result
maxOutputTokens 2048 Output token limit for the auxiliary LLM
timeoutMs 60000 Timeout for the full request
includeContext false Whether to send limited recent conversation plain text (privacy default)
contextMessages 6 Maximum number of context messages
contextMaxChars 8000 Total character budget for context
customInstructions '' Deployment-level polishing preferences

Configuration example:

- patch:
    id: prompt-polisher
    config:
      includeContext: false
      contextMessages: 6
      contextMaxChars: 8000
      customInstructions: '优先把验收标准整理为清晰列表。'

Usage Flow

  1. Input and trigger: Write your prompt in the DSH input box. The button is disabled if the draft is empty or the input state is not plain. After clicking “Polish”, the button enters a loading state, during which you can continue editing or click “Cancel”.
  2. Preview and processing: After the request completes, the result is previewed above, while the original text is retained. Click “Apply” to write it back to the input box; click “Copy” to copy only the result.
  3. Conflict and restoration:
    - If the draft has not changed, clicking “Apply” writes the result back directly.
    - If the draft has changed, the button explicitly becomes “Replace anyway” to prevent accidental overwriting.
    - If the draft still equals the just-applied result and the revision has not changed, the “Restore original” button is available; clicking it restores the state before applying.

Privacy and Security

  • No credential storage: The plugin does not receive or store API keys; model credentials are determined by the DSH adapter configuration.
  • Privacy by default: includeContext: false is the privacy default. When enabled, only recent user/model plain text is extracted; tool results, images, and plugin context are excluded.
  • Data-flow isolation: The draft only enters a one-time auxiliary LLM call in the DSH Host and is not written to the normal chat transcript.
  • Data destination: Final data is sent to the provider connected by the current DSH model adapter.

Notes

  • The plugin is not guaranteed to remain available in future DSH versions; installing with a pinned version is recommended.
  • In production environments, replacing #v0.1.0 in the installation command with a reviewed commit SHA is recommended.

Conclusion

By integrating a polishing feature into the native DSH interface, this plugin reduces the switching cost of prompt debugging and is suitable for developers who need to iterate on Prompts quickly locally.

Project address: https://github.com/SiYue-ZO/dsh-prompt-polisher