Introduction

In the plugin scenario of DSH, some rules do not require model understanding, only mechanical processing between user messages and AI replies. dsh-plugin-8r is a plugin designed for such scenarios: when a user message triggers 8R, the AI reply automatically includes a bolded “Eh!…” prefix, with the judgment process completed locally.

What is this

dsh-plugin-8r is a local judgment plugin for the 8R rule in DeepSeek Harness (DSH), maintained by SensenMeng, under the MIT license.

Its one-sentence positioning is: when a user message triggers 8R, the AI reply automatically includes a bolded “Eh!…” prefix (pure local JS judgment, model unaware).

Core Features

The following introduces capabilities explicitly stated or confirmable from facts:

  • Judgment is completed entirely locally; the model is unaware throughout the process.
  • Judgment is performed via agent/pre-step, and the prefix is injected before text-delta and block-end in llm/stream.
  • After a single match, applied=true; subsequent streams in the same turn will not re-inject; failed retries will re-inject.
  • Effective only for the main conversation; sub-agent messages are not judged, and the sub-agent stream’s sessionId is naturally excluded.
  • The object of judgment is the full text of the user message (concatenated multi-text blocks); attachment/image blocks do not participate.
  • Provides a diagnostic interface: http://127.0.0.1:3081/8r-status.
  • The README claims it does not interrupt thinking, does not pollute context, and does not occupy tokens; performance overhead is negligible.

The plugin’s core judgment logic is embedded; there are no third-party dependencies.

Installation and Activation

Execute in the DSH profile directory, for example, the web profile:

dsh plugin --profile web add https://github.com/SensenMeng/dsh-plugin-8r

The plugin takes effect after restarting DSH.

Requirements for peerDependencies in package metadata:

{
  "peerDependencies": {
    "@deepseek-ai/cordis": "^4.0.1"
  }
}

If installed via a profile, the plugin stays resident with DSH; dynamic definitions of cordis_define do not persist across process restarts.

Typical Usage

After restarting DSH, send a trigger sentence, for example:

早八

The beginning of the reply should appear as:

**诶!「早八」**

You can also visit the diagnostic interface:

http://127.0.0.1:3081/8r-status

Applicable Scenarios and Notes

Suitable for scenarios where mechanical prefix injection is needed for 8R triggers within the DSH main conversation, especially when the judgment logic should not enter the model context and does not rely on the model to judge itself.

Notes:

  • The plugin runs with the permissions of the current dsh process; the source code and license should be checked before installation.
  • The prefix will be written into the session record (stream injection) and will still be present after refreshing; it is mechanical text and has nothing to do with the model.
  • After session compression (compaction) rewrites history, it might fail to match the original text, resulting in no injection (rare).
  • Dynamic definitions do not persist across process restarts, whereas profile installations stay resident with DSH.

Conclusion

The value of dsh-plugin-8r lies in placing the 8R judgment and reply prefix injection within local stream processing, avoiding model awareness and context overhead. See the GitHub repository:

https://github.com/SensenMeng/dsh-plugin-8r