dsh-tool-doctor: Mechanical Error Correction and Local Observability for DSH Tool Invocations

Preface

When running coding workflows in DeepSeek Harness (DSH), the model often understands the task but stumbles on tool requests: line numbers exceeding file length, limit written as a string, newline inconsistencies causing patch match failures, or handing directory paths to interfaces meant for read-only files. Most of these errors are “identifiable mechanical issues” and do not mean the task itself is impossible; if you rely on the model to deduce and fix them every time, the conversation will be slowed down by repeated failures and retries.

The community plugin dsh-tool-doctor (GitHub: DeepNeuralNerd/dsh-tool-doctor) hooks into the DSH tool invocation chain, performing pre-correction for parameter errors within supported ranges, bounded retries for recoverable errors, and recording results to a local dashboard. Below is an introduction to what it is, what it does, how to install and use it, and its applicable boundaries.

What is it

dsh-tool-doctor (package name dsh-tool-doctor, current release version 1.1.0, license MIT) is released by maintainer DeepNeuralNerd and categorized as a workflow plugin in the SkillHub directory.

One-sentence positioning: A self-healing tool invocation plugin for DSH—fixes identified parameter mistakes, retries recoverable errors, and records every result locally.

DSH itself follows a “everything is a plugin” philosophy; SkillHub (skillhub.cn) is a plugin directory site for Chinese users and has no official affiliation with DeepSeek / Huanfang. Please refer to the GitHub source code and license before installation.

Core Features

According to the project README, plugin capabilities are divided into four categories.

Pre-dispatch Parameter Correction

Before the tool actually executes, process a batch of mechanical issues with clear judgment rules, for example:

  • Parameters wrapped as strings, one extra layer of {"arguments": …}, or sandwiched between Markdown code fences;
  • Inconsistencies between numerical values and types declared by the tool schema (string vs. number, boolean, array, etc.);
  • Changing common erroneous parameter names to standard names, given that the tool schema confirms this;
  • Path issues like quoted paths, mixed separators, or ~ expansion;
  • Some out-of-bound ranges and common run_code format errors.

The plugin does not guess the model’s intent; parameters requiring inference to be changed will remain as-is and fail.

Post-dispatch Recovery from Selected Errors

When the tool returns a specific error, perform a limited number of remedies while the host still holds the final verdict, for example:

  • If the tool error indicates the limit maximum is 2000, change limit: 5000 to limit: 2000 and retry; if the retry still fails, the original error remains available for the model;
  • Retry range requests at the boundaries given by the tool;
  • When the edit tool cannot find old_string due to whitespace differences, retry once based on whitespace-equivalent variants;
  • Read the file and retry when the file is not observed or the version is stale;
  • Correct name drift when the tool name has a unique match;
  • Redirect when a directory is mistakenly sent to a file reading tool, provided there is a list tool in scope.

Identifying In-text Tool Calls

Sometimes the model flows supported calls out as plain text; the plugin can promote recognizable parts of them to structured tool calls. Success or failure of promotion is recorded separately from execution success; being recognized only in text does not count as a successful “fix”.

Diagnosis and Control

In the DSH Plugin Manager dashboard, you can view recent calls, fix results, repeated failure patterns, individual rule switches, and editable model guidance copy. A circuit breaker will temporarily pause a type of recovery if that type repeatedly fails. Shadow mode (shadowMode) will evaluate “how a pre-dispatch rule will modify” but still sends the original parameters, facilitating observation of coverage before trusting the rules.

Token savings in the dashboard are estimates and do not represent bill-level actual reductions. Calls successful after parameter rewriting are recorded as fix results, and do not prove that the original call would definitely fail without rewriting.

Rule Switches (Dashboard)

Each rule corresponds to a card and a configuration switch in the dashboard; by default all are enabled, and they can be turned off individually in the dashboard without a restart. The design principle of rules is: enable only when there is a published failure category or a confirmed host contract, and when the fix can be mechanically proven.

The main switches listed in the README include (configuration flag in parentheses):

Switch Summary
Schema-shaped arguments (autoSchemaArgs) Stringified JSON, type drift, one-layer wrapper nesting, etc.
Path separator normalization (autoNormalizePaths) Path separators, ~, quoted paths (POSIX quoted filenames are not forcibly split)
Whitespace-tolerant edit retry (autoFuzzyEdit) Edit anchor whitespace-equivalent retry
Range & path normalization (autoClampRanges) Clipping ranges based on tool error boundaries, etc.
Observe-then-retry (autoObserveFiles) Read file then retry after FS_NOT_OBSERVED / FS_STALE_VERSION
Unknown-tool recovery (autoBridgeDirectTools) Redirect mistyped tools with unique matches
Directory kind correction (autoKindFixes) Switch to list tool when directory is sent to read-file tool
run_code argument repair (autoWrapRunCode) run_code parameter shape correction
In-text tool-call promotion (healResponseTools) Promote in-text call markers to structured calls
Prompt guidance injection (injectPrompt) Inject brief best practices into system context
Failure hints (errorHints) Attach executable hints to unrecovered errors
Passthrough trace persistence (persistPassthrough) Optional recording of unchanged successful calls
Shadow mode (shadowMode) Log potential fixes only, do not rewrite dispatch parameters

For a more complete design basis, see docs/RESEARCH-tool-call-failures-2026-11.md and docs/REVIEW-recommendations-2026-11.md in the repository.

Installation and Enablement

The official README provides the installation method of adding the GitHub release source to the web configuration:

dsh plugin --profile web add github:DeepNeuralNerd/dsh-tool-doctor

After installation, restart DSH for the host to load the plugin.

Rule coverage is saved in the DSH home directory; model guidance modified at runtime takes effect immediately, but plugin restarts restore factory guidance.

Diagnostic data is written locally, with the default directory being DSH_HOME (or ~/.dsh if not set):

  • tool-doctor-events.jsonl: detailed events;
  • tool-doctor-summary.json: count summary.

Parameter previews are bounded and common key forms are masked; please check manually before exporting records, as error messages and paths may still be sensitive. The plugin does not come with an independent telemetry service.

Typical Usage

Viewing and Adjusting Parameters in the Interface

  1. Complete installation and restart DSH.
  2. Open Settings → Plugins → Installed → Tool doctor.
  3. View recent activity and toggle rules as needed; if you want to evaluate pre-dispatch rules without changing real arguments, enable Shadow mode.

Understanding Fix Examples in README

If the tool rejects limit: 5000 and indicates the maximum is 2000, the plugin can automatically retry with limit: 2000; if it fails, the original error is retained for the assistant to continue processing. The dashboard distinguishes between: successfully fixed, attempted but unsuccessful, normal failure, and only recognized in text.

HTTP Dashboard API (Optional Integration)

The plugin registers routes under /plugin-api/tool-doctor/ on the host, for example:

Route Method Purpose
stats GET Count, classification, and recent records
candidates GET Repeatedly unresolved error patterns
config GET, POST Read or update rule switches
guidance GET, PUT Read or update model guidance
guidance/reset POST Reset factory guidance
reset POST Clear diagnostic records and counts

Applicable Scenarios and Notes

Who is it for:

  • Those just getting started with DSH and wanting to reduce avoidable tool interruptions;
  • Those orchestrating longer coding workflows who need schema-aware fixes, bounded retries, and local diagnostics to pinpoint where tool call failures concentrate.

Boundaries:

  • The plugin only handles mechanical modes; it cannot infer intent, cannot create non-existent files, and cannot solve all permission issues, missing tools, or command failures.
  • The plugin runs with the current DSH process permissions; please read the source code and MIT license before installation to confirm the behavior is acceptable.
  • Development and self-checking can be done by running npm run check (TypeScript, tests, and build) in the cloned repository; before relying on a specific fix in a production workflow, verify behavior against the installed DSH version.

Conclusion

dsh-tool-doctor moves a batch of provable mechanical errors from the foreground conversation to the plugin layer for processing and leaves an auditable trail in a local dashboard. If you are often tripped up by parameter shapes, boundary errors, or edit anchors in DSH, you can install it to the web configuration via the official command and toggle and observe rules by granularity in the Tool doctor panel.

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

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

Xiaoye