MintMilk777/dsh-review-format-guard ↗★ 0

dsh-review-format-guard

提供自动审查JSON格式校验与边界重试 适合因第三方API网关返回非标准JSON导致自动审查频繁失败的用户。

包名
dsh-review-format-guard
兼容性
待验证
版本
0.1.0
许可证
MIT
最近更新
2026年10月25日

安装

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:MintMilk777/dsh-review-format-guard

DSH Review Format Guard

中文 · Install and uninstall · Troubleshooting · Compatibility and tests

A small plugin for DeepSeek Harness (DSH) that checks auto-review responses and retries malformed results.

Some third-party API gateways return prose, Markdown, tool-call markup, or incomplete JSON when DSH expects a review decision. This can make auto-review fail before a tool runs. This plugin is designed for that failure.

When to use it

Consider it if a tool has not run and DSH reports errors such as:

Auto review of tool "working_directory" failed; its body was not executed
Unexpected token ... is not valid JSON
REVIEW_JSON_INVALID
Review response is not one complete JSON object

The plugin checks the whole response, removes a few clearly defined formatting wrappers, and retries invalid results. A valid denial is returned immediately. If all attempts fail, the review still fails; the plugin does not invent an approval.

Install

  1. Open Releases and download dsh-review-format-guard-0.1.0.tgz.
  2. Follow the installation guide. Desktop users can use DSH's plugin page or its bundled command; installing a separate Node.js runtime is not required for the bundled-command route.
  3. Restart DSH if prompted, check that the plugin is enabled, and keep the conversation in Auto review mode. Try a simple read-only request, such as “Show the current working directory without changing any files.”

The .tgz file is the installable plugin. The ZIP files and GitHub's “Source code” downloads are for reading or developing the source.

What it changes

  • Handles requests that match the known native review policy and message structure, without a provider or model-name allowlist by default.
  • Keeps the original policy and pending-action data, then repeats that same policy after the data to help services that mishandle the system message.
  • Buffers the response before returning it to DSH. It accepts only a complete decision that follows the native field rules.
  • Can remove a JSON code fence, surrounding whitespace, or a leading byte-order mark. It also handles a checked whitespace-only difference in reasoning snapshots. It never searches prose, reasoning, or tool-call markup for an approval to extract.
  • Makes at most three attempts by default, including retries for some temporary service errors. Each attempt has a default 60-second limit; some failures stop sooner.

It uses DSH's plugin interface without replacing the built-in reviewer or changing provider URLs and permissions.

Compatibility

Tested: DSH 0.2.1-rc.3 on Windows.

May also work: 0.2.1-alpha.2, alpha.3, alpha.4, alpha.5, rc.1, and rc.2. Their auto-review source file is identical to 0.2.1-rc.3. These are source-based candidates, not additional installation tests.

There is no DSH version-range installation block. Unrecognized review policies and request structures pass through unchanged, so the plugin has no effect on them.

See compatibility and test results for the tested scope and upstream source references.

Limits and feedback

Valid JSON does not guarantee a correct authorization decision. Retries may add latency and API charges, and cannot restore an unavailable service. Authentication failures, valid denials, and errors after tool execution need to be investigated separately.

This plugin's logs contain diagnostic codes and counts rather than raw conversations, credentials, or model replies. DSH and your provider control their own logs.

To stop using it, disable it in DSH or follow the uninstall instructions. Report reproducible problems in Issues, with secrets and private content removed.

Development

Run npm test from the source checkout with a supported Node.js version. The 51 offline tests use only Node.js built-ins and need no API key, DSH installation, or model requests. Optional host integration checks are described in CONTRIBUTING.en.md. See the implementation notes for the request and stream handling.

Initiated and maintained by MintMilk777, with development and testing assistance from OpenAI Codex.

MIT. The test snapshot retains DeepSeek's MIT notice.