DSH Pace: Search and Wait Behavior Interception Plugin

Introduction

In DSH (DeepSeek Harness), the assistant frequently invokes bash or pwsh to execute foreground commands such as searches and waits. When these commands run for an extended period, users struggle to gauge current progress and are left to wait passively. The conventional approach is to manually check terminal output or switch to another window to view logs, which interrupts the workflow. Below we introduce a plugin specifically designed to address this issue.

What It Is

DSH Pace is a plugin for DeepSeek Harness, maintained by PowerFlow-AI and classified as a client-side plugin. It intercepts DSH’s bash and pwsh tool calls, inspects the execution patterns of simple commands, and provides suggestions or guidance to switch to more efficient commands when specific conditions are met. Its core value is making large-repository searches faster and eliminating blind foreground waiting.

Core Features

Pace’s interception rules cover four common scenarios:

  1. Broad recursive searches
    - Trigger condition: grep -Rn key ., a recursive grep targeting at least four targets, or PowerShell’s Get-ChildItem -Recurse | Select-String key.
    - Suggested next step: narrow the search to a specific directory, e.g., rg -n key src/.

  2. Slow search retry
    - Trigger condition: a simple foreground rg key . that takes ≥60 seconds or returns a structured timeout, followed by the same keyword being searched again within 15 minutes in the same session and working directory.
    - Supports Chinese keywords, e.g., rg -n -F -- "电价" ..
    - Suggested next step: search subdirectories or restrict file types with -t or a positive -g glob.

  3. Foreground idle waiting
    - Trigger condition: a command that begins with at least 60 seconds of sleep or PowerShell Start-Sleep.
    - Suggested next step: check logs or job status immediately.

  4. cat waiting on terminal input
    - Trigger condition: cat $(find …) in a simple foreground Bash command, where the file arguments come exclusively from an unquoted find command substitution.
    - Suggested next step: store the query results in a variable, confirm it is non-empty, then read the file with a quoted path.

Background jobs only receive a prompt suggesting the use of job_output(wait:false) to check progress first. Slow-search records are stored in session memory only. The rules cover common patterns and should not be used as a shell security boundary.

Installation and Activation

Pace requires Node.js 22.19+ (22.x) or ≥24. PowerShell interception requires Pace 0.1.1 or later.

Desktop installation:

  • Install from a local source directory: install the local source directory in the “Plugins” panel, enable it, and restart the client.
  • Install the npm package: enter @powerflow-ai/dsh-pace in “Install Third-Party Plugin”.

dsh-TUI, Web, or headless installation:

# Install from the current source directory
dsh plugin --profile dsh-tui add .

# Install the npm package
dsh plugin --profile dsh-tui add @powerflow-ai/dsh-pace

Verify the installation: in a new session, have the DSH assistant invoke pwsh to execute Start-Sleep -Seconds 60 (or sleep 60 in Bash). You should immediately see Pace’s interception prompt. Changing the duration to 0 should return normally.

Uninstall:

  • Desktop: remove it in the “Plugins” panel.
  • CLI users: run dsh plugin --profile dsh-tui remove @powerflow-ai/dsh-pace and restart the corresponding client.

When integrating Harness into a Node.js project, you can add the dependency via npm install @powerflow-ai/dsh-pace.

Typical Usage

  1. Run rg key . in a project directory. If it takes over 60 seconds, Pace will prompt you to retry or search subdirectories instead.
  2. When executing sleep 60 or Start-Sleep -Seconds 60, Pace will suggest checking logs or job status.
  3. When running cat $(find . -name "*.txt"), if the file arguments come from an unquoted find, Pace will suggest storing the results in a variable instead.

Applicable Scenarios and Notes

  • Suitable for developers and agent developers who frequently run search and wait commands in DSH.
  • The plugin runs with the current dsh process permissions. Review the source code and license before installing.
  • Slow-search records are stored in session memory only and are lost upon restart.
  • The rules cover common patterns and should not be used as a shell security boundary.

Closing

DSH Pace intercepts simple command execution patterns to make large-repository searches faster and eliminate blind foreground waiting. Its design is restrained and specific, focusing on common scenarios. It is well suited for developers who need to frequently perform search and wait operations in DSH. For more details, refer to the project directory page: https://www.skillhub.cn/plugins/PowerFlow-AI/dsh-pace. Source code: https://github.com/PowerFlow-AI/dsh-pace

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

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

Xiaoye