AI Agent Hub
Back to plugins
🖥️

dsh-tool-result-guard

Client Updated 2026.08.22

Run the following command in DeepSeek Harness:

dsh plugin install may3rr/dsh-tool-result-guard

Paste the following prompt into your AI chat to install this plugin:

In DeepSeek Harness, run the command dsh plugin install may3rr/dsh-tool-result-guard to install the plugin. The full source is available at https://github.com/may3rr/dsh-tool-result-guard . Restart DSH after installation and it applies to every agent preset in the profile.

About this plugin

DeepSeek Harness ships two built-in mechanisms for oversized tool results, yet a gap remains: plain-text outputs between roughly 8K characters and 50K bytes that survive until compaction are pruned with no locator, no offsets, and no path for the model to recover the middle. dsh-tool-result-guard closes that gap by intervening earlier at the tools/post-execute stage. It spills the full text to a durable file first, then replaces the middle with a bounded head-and-tail preview whose position-0 marker names the exact elided span and the spill file, so the model can always pull the full content back via read, grep, or sed.

The plugin follows a strict fail-open contract: if the spill write fails, the replacement would not actually shrink the result, the output contains non-text blocks, or the tool is on the exclusion list, the original inline result is returned byte-identical. A prune never hides output and never turns a successful call into an error. It is idempotent, composable as a prepended waterfall listener, and leaves all non-text content such as images completely untouched.

Built for developers whose DSH agents routinely emit large plain-text tool outputs—log tails, search-result dumps, subagent transcripts—and who need the model to reliably recover the full text on demand. Once installed, every agent preset in the profile inherits the behavior with zero extra configuration, delivering lossless pruning and a guaranteed recovery path out of the box.

Use Cases

  • Agent tool outputs routinely exceed 8K characters and the context budget must stay lean without sacrificing recoverability
  • The built-in compaction pruner irreversibly drops the middle of 8K–50K results; an earlier zero-loss guard is needed as a safety net
  • Multi-turn sessions with subagent transcripts or log dumps require the model to pull back full text on demand

Best For

  • Developers building agents on DSH whose tools routinely emit long plain-text results
  • Teams that require a guaranteed, model-facing recovery path whenever large tool output is trimmed
  • Engineering teams running multi-agent or subagent pipelines where verbose tool output must never be irreversibly lost