dsh-open-code-review: Running On-Demand OpenCodeReview in DSH

Preface

When modifying code in DSH (DeepSeek Harness), after the model writes a round of diffs, you often have to scan through them yourself: checking if rules are followed and if there are obvious omissions. While you can hand the review over to external CI, the local session lacks an entry point for “I want to review when I want to, with conclusions landing on specific files and line numbers.” Alibaba OpenCodeReview (ocr CLI) inherently provides review specifications composed of rules, file lists, and unified diffs, along with a conclusion format returned by file. dsh-open-code-review, developed by maintainer xinyangGL, integrates these capabilities into DSH: it registers model tools and slash commands, does not automatically interrupt by default, allows clicking a button or saying “run a review” at the end of a turn, and supports configuring automatic reviews or independent read-only review sub-agents.

What is this?

dsh-open-code-review is a code review plugin for DeepSeek Harness. The underlying specifications and diffs always come from the locally installed ocr executable; the plugin is not responsible for installing ocr for you, nor will it send your code anywhere other than the LLM you configured. Review conclusions are displayed item by item in the format “Path:Line [Severity] Description,” distinguishing between “truly no problem” and failure states like “output unparsable, timeout, incomplete” (it will not disguise half-finished work as “no problem”).

In terms of classification, it is categorized under “Model Inference” in the SkillHub directory: the default engine ocr uses the OCR’s built-in LLM pipeline (billed by token); you can also select delegate to have the current session model review the diff based on rules parsed by ocr (no extra review tokens), or enable reviewer.agent = spawn to spawn an independent read-only review sub-agent.

  • Directory Page: https://www.skillhub.cn/plugins/xinyangGL/dsh-open-code-review
  • Source Code & Docs: https://github.com/xinyangGL/dsh-open-code-review

Core Features

The following introduces the capabilities explicitly registered in the plugin’s documentation, facilitating self-verification against the README.

Model Tools & Commands

The plugin registers two model tools with DSH:

  • ocr_review: Execute a review
  • ocr_status: Diagnose executable path, version, LLM routing, and config source

It also provides the slash command /ocr-review. Clicking “Start code review” (Start 代码审核) at the end of a turn (appearing only when file changes are detected in the turn starting from v0.11.0; falling back to always showing if the host cannot provide this signal) sends instructions to the session: the model first runs ocr_status to check wiring, then runs ocr_review; progress appears in the session and Jobs panel.

Three Execution Modes (engine)

Review specifications (rules + file list + diff) always come from ocr; the difference lies in who executes:

Value Behavior Summary
ocr Factory default since v0.10.0; uses OCR’s built-in LLM pipeline. Documentation tests show approximately 176–600 seconds/file, billed by token (around $0.16 per single file scan); provides an estimate of reviewable files and time magnitude before running.
delegate Hands the rules, file list, and diff parsed by ocr to the current session model for review; ocr does not call LLM internally, no extra review tokens, returns specifications in seconds; no LLM post-filtering, coverage depends on whether receipt rules are followed.
auto Tries ocr first, falls back to delegate if no LLM endpoint is available; because “reviewed” and “half-result” may look the same, this is not the factory default and requires explicit selection.

Additionally: when reviewer.agent = spawn, an independent read-only review sub-agent (with its own context and model, only read / grep / glob) can be spawned each round, returning structured findings which the coding agent fixes or explains before moving to the next round.

On-demand, Automatic, and “Review before Test”

  • On-demand: No automatic review by default; a button appears at the end of the turn when files are changed, or manual /ocr-review.
  • Automatic: Can be configured to trigger automatically when a “turn that wrote files” ends (off by default).
  • preTest: preTest=remind/gate can hook the review into “before running tests” (reminder or gate), see design docs in the repo for details.

Conclusion Form and Verifiable Promises

The documentation emphasizes four self-checkable promises: Under three trigger timings and three engines, the source and cost of conclusions are visible in ocr_status (engine, configSource, stats.byEntry, llm, etc.); only exit code 0 AND empty findings counts as clean; delegate specifications include a coverage-receipt, while the ocr side trusts its declared partial signals; the first message before ocr runs provides the scale and time magnitude for this run (missing if probe fails).

Failure code examples: OCR_NOT_FOUND, OCR_OUTPUT_UNPARSABLE, OCR_LLM_MISSING, OCR_TIMEOUT, etc., accompanied by “next step” guidance.

Installation & Activation

Environment requirements: Node ≥ 20, locally installed ocr CLI (Windows requires pointing to native opencodereview.exe; .cmd / .bat shims will report EINVAL due to spawning without shell), DSH with this plugin installed, and an available model (when llmMode = dsh is default, DSH can lend models, keys, and quota to ocr, no need to fill in endpoint separately).

1. Install OpenCodeReview CLI

node -v
npm i -g @alibaba-group/open-code-review
opencodereview --version

The first step confirms Node version is not lower than 20; after the second step of global installation, opencodereview --version should output a version number.

2. Install DSH Plugin and Restart

dsh plugin --profile <profile> add github:xinyangGL/dsh-open-code-review

Restart DSH after installation. Use the model to call ocr_status or view in settings: it should report ocr executable and version, LLM routing, and should not show no valid LLM endpoint configured (when llmMode = dsh and DSH model is available).

If OCR_NOT_FOUND appears, follow the platform-specific installation instructions printed by ocr_status, do not guess paths; set ocrPath in config if necessary.

Typical Usage

Manual Review Run

Execute /ocr-review in the session, or click Start code review / 启动代码审核 when “files have been changed in this turn.” The button subtitle will hint at the cost magnitude based on the current engine: ocr is token-based, minutes/file; delegate is no LLM call, seconds for specs.

Self-check with Tools

Ask the model to call ocr_status to confirm engine, config source, and LLM routing; then call ocr_review to execute the review. Conclusion layers include: verdict lines, scale and cost, findings grouped by [High][Medium][Low][Ungraded], next steps, tracing, etc. (based on 0.12.x behavior).

Cost Control

If you do not want to consume extra tokens for review, set engine = delegate in config. When OCR pipeline post-filtering and coverage convergence are needed, use the default engine = ocr, and read the first scale/time estimate before running, aborting if necessary; do not integrate ocr or auto into CI as-is without evaluating the time consumption.

See the repo config.example.json and README.zh.md for configuration examples and field descriptions.

Use Cases & Cautions

Suitable for: Teams already using models to modify code in DSH, wishing to align review specs with industry OCR rules, and accepting “local shell produces ocr, conclusions are auditable”; needing a repeatable check that points to file line numbers before committing or running tests.

Not suitable as: A substitute for finding more/better/all bugs, CI-level gates, security audits, or full repository scans; the documentation explicitly does not promise these.

Permissions & Security: The plugin runs with current dsh process privileges, calling local ocr and potentially passing diffs and rule context to the configured LLM. Read the source code and LICENSE before installation to ensure ocr and model endpoints meet your compliance requirements. The plugin does not run tests for you or replace CI.

External Dependencies: “No npm runtime dependencies” refers to the Node package level; every code path still shells to the ocr binary, including delegate (which only skips the LLM call inside ocr).

Conclusion

dsh-open-code-review connects OpenCodeReview’s review specifications with DSH sessions: low interruption by default, use /ocr-review or the end-of-turn button when needed; results land on “File:Line [severity] Issue”, with engines switching between cost, speed, and responsibility主体. Community Directory (no official affiliation with DeepSeek / High-Flyer):

  • https://www.skillhub.cn/plugins/xinyangGL/dsh-open-code-review

Source code, Chinese README, and changelog:

  • https://github.com/xinyangGL/dsh-open-code-review
羽毛球分组比赛记分
小程序二维码

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

Xiaoye