Introduction

The DeepSeek Harness (DSH) web plugin aims to address poor long-text input experience and unclear prompt structure. Maintained by wangyuanchuan2022. It adds an “Optimize” button to the input toolbar, fixes a rendering defect in the Composer component when handling long text, and supports Tab-key indentation for easier editing of structured content.

Core Features

One-Click Prompt Optimization

Adds an “Optimize” button to the input toolbar (left of the send button). When clicked, the plugin reads the current draft and triggers a helper LLM call via the host-side /optimize command. The optimization result is written directly back to the input box, rewriting the draft into a clearer structured prompt.

This feature is designed for DSH coding agent scenarios. During optimization, context details such as file paths and identifiers are preserved verbatim, and U+FFFC attachment/reference placeholders are passed through in place (to avoid breaking host-side bindings). Structural conventions follow the drafter’s language, and instructions are required to include verifiable completion criteria for the agent.

The optimization call uses a low thinking effort by default (reasoningEffort: low) for speed. It can be set to off (no thinking, fastest) or high / max in the configuration for more thorough rewrite quality.

Model routing is resolved by priority: the model currently selected in the session → the routing of the most recent request in session logs (request/header) → the first available provider. You can also explicitly pin provider + model in cordis.patch.yml.

In addition to the toolbar button, you can manually optimize by entering /optimize <draft text> in the command line.

Long Text Support (Input Box Architecture Fix)

Fixed display defects in the Composer component under long text. The original framework’s <textarea> used height:100%, but as a replaced element, it fell back to its intrinsic height (about 52px) inside an auto-height parent container, causing long text to be editable only in the top two lines.

The plugin uses ResizeObserver to synchronize the textarea’s explicit pixel height to the height of a hidden mirror element, restoring the intended architecture of “textarea fills the full text → scroll container crops/scrolls.” At the same time, the maximum height of the input text area is increased from 336px to min(55vh, 600px).

In editing experience, the input box supports inserting or deleting two-space indentation via Tab / Shift+Tab, and supports block-level indent/outdent for multi-line selections.

Configuration

The plugin is configured via cordis.patch.yml. Main parameters:

Key Default Description
provider / model Not set Explicitly fixes model routing for optimize call (must be provided as a pair)
reasoningEffort low Thinking level for optimize call: off (no thinking, fastest) / low / high / max
maxInputChars 200000 Maximum draft character count
maxOutputTokens 8192 Output limit for rewrite result
timeoutMs 120000 Timeout per optimize call (milliseconds)

Installation and Enablement

Install via GitHub repo URL. Run the following command to add the plugin to the web profile bundles list:

dsh plugin --profile web add github:wangyuanchuan2022/dsh-prompt-optimizer

After installation, restart dsh web and refresh the page to use it.

Full Git URL: dsh plugin --profile web add https://github.com/wangyuanchuan2022/dsh-prompt-optimizer.git.
Later updates: dsh plugin --profile web update dsh-prompt-optimizer.

Limitations

  • If the draft contains attachment or reference placeholders (U+FFFC chip), the “Optimize” button is disabled, because rewriting breaks the correspondence between chips and the occurrence table.
  • The optimization result replaces the entire draft via inputActions.setDraft; rollback requires the input field’s undo feature.

Conclusion

The plugin follows the MIT license. The DSH philosophy is “everything is a plugin,” and the community catalog (SkillHub) has no official affiliation with DeepSeek. To view the catalog or source code, visit Plugin Catalog or GitHub repository.