dsh-tool-error-hints: Adding actionable hints to failed tool results

Preface

DSH agents frequently encounter an issue where weak models repeatedly guess incorrect paths when handling tool failures. Error messages typically only state “does not exist” but fail to indicate “where it exists.” dsh-tool-error-hints aims to address this pain point by appending actionable hints after failed results, preventing the model from falling into an invalid path-guessing loop.

What It Does

The plugin runs at the tools/post-execute stage (at the end of the waterfall), identifies failed tools, and injects hints with source.kind='plugin' after the results. Its main capabilities include:

  1. Path Does Not Exist: Provides the nearest existing ancestor directory and its contents, assisting the model in correcting the path.
  2. Command Not Found: Indicates that the executable is missing in the container and suggests using command -v to probe for it.
  3. Insufficient Permissions: Indicates that the process is running as non-root, explaining that sudo, apt-get, or writing to /var will fail.
  4. Reading Directory as File: Suggests using the ls command instead.
  5. False Positive Protection: Distinguishes between STRONG (e.g., No such file or directory) and WEAK errors to avoid misjudging legitimate empty results.

Installation and Activation

Deploy via the provided installation script:

bash /nas/dsh/工具/dsh-tool-error-hints/install.sh
dsh-restart

Activation method: Configure an insert: entry in the ~/.dsh/profiles/web/cordis.patch.yml file.
Note: Do not write the configuration into dsh.profile.bundles in package.json, otherwise it will be reverted.

Verifying Loading

Configuration presence does not guarantee loading. The plugin writes a heartbeat log during apply():

tail -1 ~/.dsh-logs/tool-error-hints-loaded.log
# 2026-09-13T14:10:00.000Z pid=12345 roots=/nas/dsh maxEntries=24

Design Constraints

The plugin strictly adheres to the following constraints to ensure stability:

  • Read-Only: Only uses existsSync, readdirSync, statSync; never executes commands, never writes files.
  • Non-Overwriting: Appends content via additionalContexts without modifying original tool output.
  • Exception Swallowing: Plugin exceptions will not interrupt the normal tool flow.

Summary

This plugin solves the problem where weak models cannot obtain effective context when tools report errors. To learn more details, you can visit the plugin catalog: https://www.skillhub.cn/plugins/ikta2010/dsh-tool-error-hints or view the source code: https://github.com/ikta2010/dsh-tool-error-hints.

羽毛球分组比赛记分
小程序二维码

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

Xiaoye