Introduction

When developing DeepSeek Harness (DSH) agents, agents often do not stop automatically after a tool call fails, and instead continue repeating the same call. The existing repeat-tool-reminder plugin only provides reminders and does not enforce blocking. dsh-repeat-stop is intended to solve this issue by using a hard-stop mechanism that directly rejects the next call once the consecutive-call count reaches the configured threshold.

What It Is

dsh-repeat-stop is a DeepSeek Harness plugin and part of the dsh-wsl-kit ecosystem. It detects “consecutive identical tool calls.” Here, “identical” is defined as the same tool name plus the same parameters. When the number of consecutive calls exceeds the configured threshold, the plugin blocks the next call.

Core Features

  1. Hard-Stop Mechanism: By default, 6 consecutive identical calls are allowed, and the 7th call is directly rejected.
  2. State Reset: When the parameters or tool name change, or when a genuine user message is received, the counter is automatically reset, avoiding false positives against normal rotating calls.
  3. Whitelist/Blacklist: Supports an exclude list to exclude specific tool names (such as job_output), and an include list to specify tracking only specific tools.

Installation and Activation

To install this plugin, use the official DSH plugin management command. After installation, the dsh web service must be restarted for the change to take effect.

dsh plugin --profile web add github:173787247/dsh-repeat-stop

After installation, in the Web UI Trajectory, if a call is blocked by this plugin, it typically displays dsh-repeat-stop: blocked.

Configuration

The plugin is controlled via a YAML configuration file. The default configuration is as follows:

- id: dsh-repeat-stop
  name: dsh-repeat-stop
  config:
    enabled: true
    threshold: 6
    exclude:
      - job_output
      - job_list
      - job_kill
Configuration Item Default Value Description
enabled true Master switch; when disabled, no blocking is performed
threshold 6 Maximum number of consecutive calls allowed, integer ≥ 2
exclude job_* List of tool names not counted
include [] If set, only track tool names in the list (wildcards supported)

Difference from dsh-tool-budget

These two plugins are complementary in functionality but differ in focus:

Plugin Name Blocking Target
dsh-repeat-stop Consecutive identical tool calls (short time window)
dsh-tool-budget Total tool calls within the entire session (global limit)

Notes

  1. Version Requirement: This plugin requires DeepSeek Harness version >= 0.1.2.
  2. Service Restart: After installing or modifying the configuration, the dsh web process must be restarted to load the new plugin.
  3. Ecosystem Positioning: This plugin works best in combination with dsh-tool-budget; the former prevents infinite loops, while the latter controls total cost.

Conclusion

dsh-repeat-stop uses a hard-stop mechanism to effectively prevent agents from falling into infinite loops when tool calls fail. Combined with dsh-tool-budget, it can help build more stable DSH agent workflows. For more details and source code, see its GitHub repository.