Rhymer-Lcy/dsh-plugin-loud-failure

插件 ⭐ 1 MIT tools

DeepSeek Harness 插件,将无声的工具失败转变为响亮警示:一种工具后执行策略,用于匹配成功工具输出中的警告特征,并阻止结果或附加通知

catalog 简介:DeepSeek Harness plugin that turns silent tool failures into loud ones: a tools/post-execute policy that matches warning signatures in successful tool output and blocks the result or attaches a notice

安装

1. At load, the plugin merges the built-in rules with the configured ones (a user rule with a built-in id replaces it) and compiles every pattern. An unusable table (invalid regular expression, duplicate id, stateful flag, empty message) rejects the plugin load with the offending rule id, so a broken config fails at boot, not at the first tool call.
2. On every `tools/post-execute`, the text blocks of the result (optionally also the JSON of a successful canonical value) are matched against the rules whose `when` and `tools` filters apply. A result counts as failed for the `when` filter when it is `isError` **or** its text carries a failure marker the shipped shell tools append themselves: a `[exit code: N]` line with N != 0, a `[status: ...]` trailer with a non-zero exit code, or a `[sandbox: file access denied ...]` notice. The model already sees those; they are not silent, so `when: success` rules stay quiet.
3. If any matching rule has `action: error`, the listener returns `{ kind: 'block' }` with feedback that begins with a header naming every matched rule and its message, followed by the original content blocks unchanged; context the tool body deferred is carried on the decision so a block does not drop it. The registry turns that into an `isError` result: the canonical value is gone, so a Code Mode program cannot consume a poisoned value either.
4. Otherwise (only `context` matches) the listener delegates with `next()` and appends one `UserMessage` to the decision's `additionalContexts`. Its source is `{ kind: 'plugin', plugin: 'loud-failure', form: 'notice', summary }`, so the Web UI shows a collapsed one-line row and the session log records exactly what the model was told.
5. No match: `next()`. Rules with `action: off` never run.

Because the listener is registered through `ctx.on`, it is torn down with the plugin; a config change reloads the plugin and registers a fresh listener.

## Install

Requires DeepSeek Harness `0.1.0-rc.6` (`@deepseek-ai/dsh-tools` and `@deepseek-ai/dsh-llm` at `0.1.0-rc.6`) and Node.js 20+. That is the only version this plugin has been tested against; the harness is a developer preview that may break compatibility, so the peer ranges are pinned and bumped per release. `dsh plugin add` prints peer-dependency warnings for `@deepseek-ai/*`: expected, because the profile resolves those packages from the harness installation rather than installing them next to the plugin.

**From a release tarball (no build step, no build authorization):**

Rhymer-Lcy/dsh-plugin-loud-failure 加入你的 DSH 配置(web profile)即可启用。

README

展开完整 README 收起

README 内容为空。