dsh-if: Add a /if command to DSH that checks conditions before sending commands.
dsh-if (tlewa/dsh-if, maintained by TLEWA, MIT license) adds a `/if` slash command to DeepSeek Harness: The judge is a forked sub-agent inheriting the current session's tools, system prompt, and history. It appends only a single judgment instruction and answers YES or NO. If true, the instruction below `/if` is sent as a regular user message to the main agent; otherwise, it is silently discarded. The `/if` command, conditions, instructions, and judgment results are not written to the main session. `command/run` and `command/done` are log-only events. The judgment request shares a byte-by-byte consistent tools → system → messages prefix with the main session's next request, allowing reuse of the provider's KV cache. The runtime guard only allows read-only tools such as `read`, `glob`, and `grep`, while strictly rejecting all writes, commands, and sub-agents. The plugin provides two modes: `message` (default, same queue as regular messages, judged before the round starts) and `background` (0.2.x old behavior, background judgment). The configuration option is `mode` in the profile's `cordis.patch.yml`. If a fork provider capable of inheriting context is unavailable, it falls back to a one-shot `ctx.llm.stream` plus a text record of approximately 24k characters. Requires DSH 0.2.1-rc.5 or higher and Node.js 20.3 or higher. npm installs `dsh-if@0.3.4`, but it can also be installed from GitHub tags or release attachments. Note that the plugin runs with the privileges of the current DSH process; please verify the source code and license before installation.
Read More