Introduction

In DeepSeek Harness (DSH), if an agent step emits text output without invoking a tool, the current loop logic treats that turn as “completed.” This can cause a common problem: the model narrates the next action (for example, “now reapply the changes”) but forgets to actually execute the tool call, so the work is closed prematurely before it is finished.

The dsh-loop-continue plugin resolves this issue. It listens to the agent/turn-stopping event and intervenes before the turn ends by replaying the current turn’s session log and using a judgment model to confirm whether unfinished work remains. If the model merely described an action without invoking a tool, the plugin steers the model to continue execution.

This plugin is maintained by yunxiyang, is licensed under MIT, and belongs to the workflow plugin category.

Core Features

  • Automatic interruption detection: Listens to the agent/turn-stopping event and triggers when a turn ends with only text steps and at least one tool call has already occurred.
  • Replay and judgment: Replays the current turn’s session log and uses a separate “judgment model” to decide whether the turn should continue.
  • Single-word decision: The judgment model answers only true (continue) or false (stop), with output capped at 64 tokens.
  • Controllable limits: Provides three core configuration options to prevent infinite loops or excessive resource consumption: maxContinuations (maximum steering attempts per turn, default 10), maxSteps (number of most recent steps provided to the judgment model, default 6), and maxTailChars (tail text budget, default 1500).
  • Deterministic gating: The judgment logic starts only when the turn ends on a text step and at least one tool call has already occurred, avoiding extra overhead for ordinary completed turns.

Installation and Enablement

Install it to a specified Profile using the DSH CLI:

dsh plugin --profile <profile> add dsh-loop-continue

After installation, the Profile’s package.json will gain a new dependency, and cordis.patch.yml will automatically insert the interceptor into the layer stack. Note: Source changes under the lib/ directory require a Profile restart to take effect.

Typical Usage and Configuration

After installation, the plugin operates according to its default behavior. You can adjust the parameters in the following ways:

  1. Set the steering limit: Configure maxContinuations in ~/.dsh/settings.yaml (default 10) to limit the maximum number of steering attempts per turn.
  2. Adjust the judgment context: Set maxSteps (default 6) and maxTailChars (default 1500) to control how many recent steps and how much tail text the judgment model sees.
  3. Customize prompts:
    • judgePrompt: Defines how the judgment model determines whether the turn is unfinished.
    • steerText: The instruction text injected into the model when the plugin decides to steer it.

Configuration supports the following two methods:
* UI configuration: Find the plugin card in Settings > Plugins > plugin config. Note: Prompt content is saved on blur, not on every keystroke.
* YAML file: Add a loop-continue namespace to ~/.dsh/settings.yaml.

Example YAML configuration:

loop-continue:
  maxContinuations: 10
  maxSteps: 6
  maxTailChars: 1500
  judgePrompt: "You inspect one coding-agent turn that just ended. Reply with exactly one word: true if the trailing text promises work that no tool call performed, false otherwise."
  steerText: "You described an action but did not call any tool. Emit the tool call now."

Applicable Scenarios and Notes

  • Applicable scenarios: Suitable for conversations where the model frequently describes actions without executing them, especially in code generation or complex toolchain operations.
  • Resource consumption: Each steering attempt consumes one judgment-model round trip and one additional agent step. Therefore, the plugin includes maxContinuations to prevent wasting budget on ineffective steering.
  • Debug mode: Enabling debug mode requires restarting the DSH process to take effect; this mode logs every judgment result.
  • Headless environments: The plugin supports headless operation, with configuration managed through YAML files.

Summary

The dsh-loop-continue plugin introduces a lightweight judgment mechanism to resolve the common issue of models omitting tool calls in narrative output. By using a concise context summary and single-word decisions, it controls token consumption while maintaining judgment accuracy. If you frequently encounter models that “only talk” in DeepSeek Harness, this plugin is an essential complement.