dsh-autofix
Fix common DSH failures automatically and keep the task moving.
Install it once, then use DeepSeek Harness exactly as before. Supported failures get one clear recovery action; unknown failures stay unchanged.
- Transient web or API error: retry once
- File changed during an edit: refresh the current context
- Command missing on this OS: use an installed equivalent
- Known DSH error: give the agent an executable next action
Install
npx -y dsh-autofix install
Done. Use DSH normally.
Before and after
A web tool returns 502
Before: HTTP 502 → task pauses → user says "continue"
After: HTTP 502 → AutoFix requests one retry → task continues
A file changes during an edit
Before: old text not found → user relays the error → agent reads again
After: old text not found → AutoFix refreshes a bounded excerpt → agent edits again
A command differs across platforms
Before: rg not found → task stops
After: rg not found → AutoFix finds an installed equivalent → agent continues
Recovery recipes
| Recipe | Recognizes | Action |
|---|---|---|
| Transient tool error | Rate limits, selected 408/5xx responses, timeouts, transport resets | Ask the agent to retry the same operation once, then change approach |
| Stale file context | Exact stale-edit and replacement-miss errors | Attach a bounded current excerpt when DSH's filesystem service is available |
| Command alternative | Command-not-found errors from shell tools | Recommend the first equivalent that actually exists on the current PATH |
| DSH Error Atlas | A controlled, versioned set of common DSH errors | Attach a short next action without rewriting profile or session data |
The public catalog is in recipes/catalog.json. New recipes are welcome through the recipe request form.
Zero-interruption contract
dsh-autofix works only after a tool has already failed. It does not add approval prompts, change tool arguments, alter successful results, install system commands, require another service, or add a UI.
Each matching failure receives at most one recovery intervention in a short window. A second identical failure remains visible so the agent can change approach. Cancellation stops pending recovery work, and uninstall removes the plugin and bundled Skill.
Unknown failures are preserved unchanged.
Compatibility
The current release is verified against the real @deepseek-ai/dsh-tools 0.1.0-rc.6 runtime. Node.js 24.19.0 on Linux/WSL and Node.js 22.19.0 on Windows both pass strict typechecking, build, and the full test suite. The Windows CLI path also passed install, repeat-install, effective-config, and uninstall checks against an isolated real DSH profile through WSL interoperability. A standalone Windows client run and native macOS installation still need release-candidate verification.
See the compatibility matrix for exact evidence and limits.
Advanced Test Kit
Maintainers can run one bundled deterministic recovery check:
dsh-autofix test --scenario transient-tool-error --json
Available scenarios are transient-tool-error, stale-file, command-alternative, and error-atlas.
Plugin authors can import the stable Recipe interface:
import { applyRecipes } from 'dsh-autofix'
import type { AutoFixRecipe } from 'dsh-autofix/recipes'
const recipes: AutoFixRecipe[] = [myRecipe]
applyRecipes(ctx, recipes)
Use this advanced entry point in one custom bundle instead of mounting the default bundle alongside it. Recipes run by descending priority and duplicate IDs fail immediately.
The previous deterministic fault engine remains available for advanced regression tests:
import { ChaosEngine } from 'dsh-autofix/testkit'
The Test Kit is not part of the normal user workflow.
Development and contributing
npm ci --ignore-scripts
npm run check
A recovery contribution is intentionally small: one Recipe, one deterministic regression test, and one concise catalog entry. Read CONTRIBUTING.md before submitting a change.
No comments yet
Be the first to share your take.