dsh-subagent-output-sanitizer: Sanitizing orphaned tool blocks in subagent messages

Preface

When running subagents in DSH, model replies sometimes leave behind “orphaned” tool call blocks: there’s no corresponding tool result in the context, or the structure is incomplete, yet it still occupies a place in the message stream. These fragments interfere with parsing, display, and debugging in subsequent turns. Manual deletion is slow and error-prone.

Below we introduce the community plugin dsh-subagent-output-sanitizer (maintainer vb2250158, category: workflow). It cleans up subagent output at the DSH configuration level, with the goal of removing these orphaned tool blocks to make the message chain cleaner. The plugin’s display name in the directory is English Subagent output cleanup and Chinese 子代理输出清理 (switching with the DSH interface language).

What is this

dsh-subagent-output-sanitizer is an open-source DSH plugin whose core capability in one sentence: cleaning up orphaned tool blocks in subagent messages.

This release requires DSH 0.2.1-alpha.1 or a compatible 0.2 series; for details see docs/dsh-0.2-compatibility.md in the repository.

Core functionality

According to the README, the plugin currently explicitly describes only one capability:

  1. Subagent output cleanup: process subagent messages, remove orphaned tool blocks, and prevent invalid tool fragments from remaining in the conversation structure.

The plugin is declared via dsh.bundle. After installation, it merges its configuration patch into the current profile, so there’s no need to keep the plugin source code in this repository long-term (in multi-machine sync scenarios, the profile side typically only keeps the repository address, pinned commit, enable/disable state, and configuration).

Installation and enablement

Before installation, read the repository source code and the MIT license yourself; the plugin runs with the current DSH process permissions, and should only be installed from trusted sources with pinned commits.

The steps given in the official README are: first lock a specific commit of the public repository, then install through the official DSH entry point (replace <commit> with the actual commit SHA):

pnpm dsh plugin --profile web add github:vb2250158/dsh-subagent-output-sanitizer#<commit>

After installation completes, the plugin package adds the configuration layer corresponding to cordis.patch.yml to that profile.

Configuration storage location

Plugin-related configuration is stored in the DSH profile’s cordis.patch.yml. If you use Git to sync the profile repository, you typically only sync the repository address, pinned commit, enable/disable state, and configuration content; you don’t need to put the plugin source code into the same repository.

Verification and development self-check

The local verification commands given by the maintainer in the README are as follows (execute in the plugin source directory):

npm test
npm pack --dry-run

npm test corresponds to node --test tests/*.test.mjs, used to run the package’s tests; npm pack --dry-run is used to check whether the published file list matches the files field in package.json.

Use cases and notes

Who it’s for

  • Those who frequently enable subagents in DSH workflows and have encountered invalid tool blocks remaining in messages.
  • Those already using or planning to use DSH 0.2.x and willing to extend behavior through profile plugins.

Notes when using

  1. Version: must satisfy DSH 0.2.1-alpha.1 or a compatible 0.2; check the repository’s compatibility documentation before upgrading DSH.
  2. Installation method: use the README’s pnpm dsh plugin --profile web add github:...#<commit>; do not omit commit pinning.
  3. Permissions and security: the plugin runs in the same process as DSH; check the source code and license before installation. The directory page (SkillHub) is a community index with no official affiliation with DeepSeek / High-Flyer.
  4. Capability boundaries: the README only describes cleaning up orphaned tool blocks and doesn’t list additional configurable options; specific behavior is governed by cordis.patch.yml and lib/index.js.

Conclusion

dsh-subagent-output-sanitizer has a clear positioning: automatically clean up orphaned tool blocks in subagent output at the workflow side, reducing the cost of manually fixing messages. It requires installation with a pinned commit, configuration managed in the profile’s cordis.patch.yml, and ensuring the DSH version is within the 0.2 compatibility range.

  • Directory page: https://www.skillhub.cn/plugins/vb2250158/dsh-subagent-output-sanitizer
  • GitHub: https://github.com/vb2250158/dsh-subagent-output-sanitizer
羽毛球分组比赛记分
小程序二维码

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

Xiaoye