jjjjjjjjnnjnn/dsh-remedy--packages-plugin ↗★ 3
dsh-remedy
DeepSeek Harness patch set that intercepts MALFORMED_RESPONSE streams, splits fused tool-call arguments, re-throws unprovable buffers, and names the deterministic refusals it does not retry.
설치
npx -p @deepseek-ai/dsh dsh plugin --profile web add 'github:jjjjjjjjnnjnn/dsh-remedy#97d84983992c0569ff5aa751e85192dec24ec353&path:packages/plugin'dsh-remedy (plugin)
Stop losing a whole turn to one fused tool call. The model occasionally glues two tool calls into one JSON blob, the adapter cannot parse it, and the turn dies. This plugin splits the blob at the stream seam into two calls that can run; what it cannot prove — a truncated tail, a single object, a fragment that does not fit the tool — keeps its original error instead of being dressed up as a repair. It also names the deterministic refusals it will not retry, and says nothing when there is nothing to repair.
Installing this package also installs dsh-remedy-core: the plugin pins the
exact version of that engine, so one install resolves both. The split is
deliberate rather than packaging noise — the engine does no I/O and takes no
host, so it can be embedded and tested on its own, while this package owns the
seam, the configuration and the command line. Because the pin is exact, the two
versions always ship together; a version skew is refused before anything is
published.
Installing this package also installs dsh-remedy-core: the plugin pins the
exact version of that engine, so one install resolves both. The split is
deliberate rather than packaging noise — the engine does no I/O and takes no
host, so it can be embedded and tested on its own, while this package owns the
seam, the configuration and the command line. Because the pin is exact, the two
versions always ship together; a version skew is refused before anything is
published.
Mount
cordis.patch.yml adds one row through insert::
- insert:
- id: remedy-stream
name: dsh-remedy
config:
repair: true
retryOnMalformed: 0
maxCalls: 8
dsh-remedy must be the bare package specifier: the loader resolves
dist/index.js from it.
Config
| Key | Default | Meaning |
|---|---|---|
repair | true | Wrap llm/stream |
retryOnMalformed | 0 | Retries per step after MALFORMED_RESPONSE; a stop-gap, not the fix |
maxCalls | 8 | Ceiling on calls synthesized from one fused block |
journalPath | unset | Append redacted repair events as JSONL; no writes when unset |
log | true | One mount line through ctx.logger |
CLI
dsh-remedy status [--json] [--journal ]
dsh-remedy repair [] [--name ] [--id ] [--max-calls ] [--truncated] [--json]
dsh-remedy scan [--since ] [--max-files ] [--json] [--out ]
dsh-remedy explain [--sessions ] [--profile-file ]
dsh-remedy seams [--profile ] [--dir
] [--json]
dsh-remedy verify [--json]
scan takes one plain .jsonl file, a multi-frame session.v4.jsonl.zstd log,
or a directory of them; --since drops older events and reports how many it
dropped, --max-files caps the walk. It also prints the turn census and the
error codes it counted, and how many of the truncated turns produced no text and
no tool call — that counter is reported, never promoted. repair reads
stdin when no file is given, and a .json
fixture through its arguments field. explain prints, per failure class this
machine actually hit, how often, which patch covers it, and whether that patch is
switched on in the profile named by --profile-file. Three answers are possible
in that last column: the coverers, (no) for a profile that switches them off,
and unknown when no profile was named — an unread profile is not a finding, so
explain exits 0 in that case and 1 only when a profile it read switches
every coverer of a class the host hits off.
seams reads a DSH profile without loading any plugin and prints which installed
packages register on the same seam, in waterfall order (outermost first; a
prepend registration unshifts). A shared seam is a finding and exits 1;
--json carries the same inventory. It cannot see a listener registered
dynamically or through an indirection.
Exit codes: 0 ok · 1 finding · 2 usage · 3 unavailable.
scan --out writes the report and a .sha256 sidecar. A report that finds
fusion exits 1, because a dead turn is a finding even when the file is valid.
What the wrapper emits
On a proven fusion it replaces the terminal error with:
block-end(index=0, id=)
block-end(index=, id=#remedy-1)
...
finish{kind:'stop'}
When a fused text glues two calls of different tools, the stream carries one
tool name for that index. A fragment whose arguments do not satisfy the named
tool's declared required fields is sent out under remedy_unattributed;
the runtime answers UNKNOWN_TOOL and the turn continues, so the wrong tool is
never called. The repair event records how many fragments that happened to.
Everything else passes through unchanged.