DeepSeek Harness Plugin: dsh-work-done-bell

Introduction

During DeepSeek Harness (DSH) development, the agent’s status is often displayed as idle. However, this usually only indicates that the scheduler is idle, while background tasks or sub-agents may still be running. If an alert sound is triggered when the status is idle, a single task might ring multiple times. dsh-work-done-bell solves this problem by waiting for “true completion.”

Plugin Positioning

This is a DeepSeek Harness client plugin maintained by FunctionHookTJU. It plays a Windows system alert sound and pops up a Toast notification in the bottom right corner after a DSH session truly completes all work (i.e., enters a silent state). The plugin persistently stores the state of completion alerts and supports a toggle switch.

Core Features

The plugin determines whether a session has ended through a “Silence Detection” mechanism to avoid false positives.

  1. Silence Detection Conditions: For a session to be considered truly complete, it must simultaneously satisfy the following conditions:
    • Status is idle.
    • There are no running or stopping tasks belonging to this session.
    • There are no running agents belonging to this session.
  2. Timeout Protection: There is a 90-second deadline for silence detection. If silence is not detected within 90 seconds, the alert sound will not be triggered for that session.
  3. Deduplication: Multiple completions within a 2.5-second window are merged into a single alert sound to prevent sound stacking caused by concurrent tasks.
  4. Alert Sound Logic: The sound source is based on the turn/end reason in the DSH log, rather than guesswork:
    • completed / blocked / max-tokens: Plays Asterisk (default notification sound).
    • error: Plays Hand (stop sound).
    • aborted / interrupted (including manual stop): Silent.
  5. UI Interaction: A persistent toggle is provided in the bottom right corner to control the alert sounds and Toast display.

Installation and Activation

Use the file: protocol for installation to ensure dependencies are resolved correctly.

  1. Clone the repository:
git clone https://github.com/FunctionHookTJU/dsh-work-done-bell
  1. Execute the installation command in the directory:
dsh plugin --profile web add file:/absolute/path/to/dsh-work-done-bell
  1. Restart the DSH backend; no manual editing of other content in the config file is required.

Diagnostics and Status Query

The plugin provides an HTTP interface for debugging. The browser side polls this interface every second to obtain the status.

Check the current status using the following command (enable verbose=1 to view detailed reasons and policies):

curl "http://127.0.0.1:3080/dsh-work-done-bell/state?verbose=1"

Platform Limitations and Notes

  • Sound Limitations: The sound playback function is only supported on the Windows platform, executed via System.Media.SystemSounds. On other platforms, the plugin loads and displays the Toast but remains silent. To port it, you need to modify the command in the play() function to afplay or paplay.
  • Sandbox Policy: The command to play the sound must carry a resolved sandbox policy. If the host shell service rejects the command, the sound will fail to play. In verbose=1 mode, the lastError and lastPolicy fields will record the reason.
  • Toast Display: Toast notifications require an open browser page to be visible, whereas sound playback does not depend on a page being open.
  • Naming Convention: The Toast notification displays the session’s Short ID, not the title.

Summary

dsh-work-done-bell is a practical DSH client plugin that solves the false positive issue caused by background tasks through precise “Silence Detection” and timeout mechanisms. For complex tasks requiring long-running operations or containing sub-agents, it provides clear auditory feedback.

  • Plugin Directory: https://www.skillhub.cn/plugins/FunctionHookTJU/dsh-work-done-bell
  • GitHub Repository: https://github.com/FunctionHookTJU/dsh-work-done-bell
羽毛球分组比赛记分
小程序二维码

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

Xiaoye