dsh-auto-review-model-router: Route auto-review requests to the specified model

Introduction

In DeepSeek Harness (DSH), if the experimental @deepseek-ai/dsh-experimental-auto-review is enabled, every tool call that requires safety gating triggers an additional LLM review pass. The review implementation copies the provider and model from the current session’s request headers, meaning the review shares the same model routing as the main agent. If the main session selects a high-cost model like Claude Opus or GPT, every gated call will incur an additional full request charge at that model tier, layering costs on top of the agent itself.

The community plugin dsh-auto-review-model-router does exactly one thing: identify review requests emitted by auto-review and reroute them to your configured reviewModel, while leaving the main session’s agent model unchanged. The following sections cover its positioning, installation, and configuration options, based on the repository README and package information.

What is this

dsh-auto-review-model-router is a DSH plugin maintained by OldLigant. Its npm package name is dsh-auto-review-model-router, currently at version 0.2.1, with an MIT license. It falls under the category of model inference capabilities: it does not alter the review prompt, the strategy system prompt, temperature, or the {"risk":…,"decision":…} JSON protocol parsed by the gate; it only replaces the model that produces the verdict.

If you are using the standalone plugin dsh-auto-review, it comes with its own reviewerModel configuration and does not require this plugin. This plugin targets the specific case where the experimental auto-review bundle lacks a reviewModel field, forcing reviews to use the session routing.

Core Functions

Problem and Behavior

@deepseek-ai/dsh-experimental-auto-review conducts reviews via ctx.llm.stream(), with routing derived from the session snapshot (the README points to snapshotAutoReview()). Upon activation, this plugin wraps llm.stream (and, by default, llm.prepareCall) on the LlmRuntime, rerouting only requests that are “manually constructed” and whose system prompt begins with the fixed REVIEW_POLICY of auto-review.

During rerouting, it copies the reviewModel and, by default, discards reasoningEffort and maxTokens from the source routing to prevent review failures caused by the target model not supporting reasoning effort or having a smaller output limit. The review content and other parameters remain unchanged.

Transient Failure Retries

The gate calls llm.stream directly outside the agent loop, meaning harness-side agent retry plugins cannot detect review failures. This plugin handles retries independently for transient errors on individual reviews (default retryAttempts is 4, meaning up to 5 total attempts). It only retries codes considered transient by the harness: EMPTY_RESPONSE, RATE_LIMIT, SERVER, and TRANSPORT. It deliberately does not retry TIMEOUT (DeepSeek adapter idle watchdog), ABORTED, or AUTH, etc.

Implementation Trade-offs (Key points when reading the README)

The README explains that attempts to use the llm/stream listener or write to ctx.llm.stream directly were infeasible on the real runtime (due to deepFreeze on requests, Cordis waterfall semantics, traceable proxies, etc.). Therefore, the plugin installs the wrapper on the prototype owning the method (in practice, LlmRuntime.prototype) and removes it upon fiber disposal. The prepareCall path requires rerouting during the prepare phase; otherwise, INVALID_PREPARED_CALL errors will occur.

Installation and Activation

Install the npm package in the profile directory (do not use concatenated dsh plugin add github:… commands that do not appear in the documentation):

# in the profile directory
pnpm add dsh-auto-review-model-router

For local checkouts, you can link it in the profile’s package.json:

// <profile>/package.json
"dependencies": { "dsh-auto-review-model-router": "link:D:/path/to/dsh-auto-review-model-router" }

Insert the plugin entry into the profile’s patch layer; the README requires it to be placed after the auto-review bundle:

# <profile>/cordis.patch.yml
- insert:
    - id: auto-review-model-router
      name: dsh-auto-review-model-router
      config:
        reviewModel: deepseek-official/deepseek-flash

The application must be restarted after modifying the patch layer; changes take effect when the profile starts. The runtime environment requires Node ^22.19.0 || >=24.0.0 (see package.json engines).

Typical Usage and Configuration

The minimal configuration simply specifies the review model in the format <provider>/<model>, for example, deepseek-official/deepseek-flash as shown in the README example. Once configured, reviews use this route, while the agent can continue using session-selected models like claude-opus-4 or gpt-6-astra.

The full list of configuration fields is as follows (default values are based on the README table):

Field Default Description
reviewModel deepseek-official/deepseek-flash Provider/model used for each review; an empty string disables rerouting
systemPromptPatterns Built-in start with REVIEW_POLICY Matches substrings or /regex/u in the system prompt; only needs relaxation if the harness rewrites the review prompt
retryAttempts 4 Number of retries after the first failure, max 10; 0 disables it
retryDelayMs 500 Milliseconds to wait before retrying
wrapPrepareCall true Whether to reroute reviews sent via llm.prepareCall as well
dropReasoningEffort true Discard source routing reasoning effort on review requests
dropMaxTokens true Discard source routing max tokens on review requests
logRetargets true Whether to log each rerouting; retries always log a warning

Example runtime rerouting and retry logs (from README):

auto-review-model-router: review request re-routed anthropic/claude-opus-4 -> deepseek-official/deepseek-flash (stream)
auto-review-model-router: review attempt 1/5 failed with TRANSPORT; retrying in 500 ms

Repository tests: node test/router.test.js; in an environment where @deepseek-ai/dsh-llm can be resolved: DSH_PROFILE_DIR=<profile dir> node test/live.test.js.

Use Cases and Notes

Who it is for: DSH users who have enabled @deepseek-ai/dsh-experimental-auto-review in their profile, want reviews to be fixed to a cheaper or dedicated flash model, but do not wish to change the agent’s main routing.

Scope and Risk: Only requests identified as auto-review will be rerouted; if a request is falsely identified (false negative), the behavior is identical to not having the plugin installed. DSH’s public API is still pre-stable; if the REVIEW_POLICY prefix, LlmRuntime.prototype method names, or prepared-handle contracts change, you may need to upgrade the plugin or adjust detection via systemPromptPatterns. If required methods are missing, the plugin logs a warning rather than preventing the profile from starting.

Security and Trust: The plugin runs with the permissions of the current DSH process, patches LlmRuntime.prototype, and intercepts LLM streaming calls. Before installation, please read the source code and MIT license at the GitHub repository to decide whether to include it in your profile.

The DSH ecosystem emphasizes “everything is a plugin”; the SkillHub directory page is a community site with no official affiliation with DeepSeek or High-Flyer.

Conclusion

dsh-auto-review-model-router decouples review traffic from the expensive session model in experimental auto-review, using the reviewModel configuration and optional retries to reduce the cost of reviews for gated tool calls while keeping agent routing unchanged. For details and updates, refer to the GitHub README:

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye