dsh-notify-context: A Context-Aware Desktop Notification Plugin

Preface

The DeepSeek Harness (DSH) official client cannot display “authorization required” approval cards or “turn completed” notifications to the user when it is minimized or obscured by other windows. When an agent is working in the browser or in ComfyUI, these critical states are completely hidden. This plugin fills that gap with system notifications, popping up a Toast at the moments when your action is needed and including a task summary in the body, so you can see what’s required without switching windows.

What It Is

dsh-notify-context is a DSH plugin maintained by LeeRolling. It adds context-aware notification capabilities to the desktop client: it emits system notifications when authorization is needed, when a question awaits your answer, and when a turn ends, while avoiding interruptions when you are in the foreground.

What Problem It Solves

  • When the client is minimized or obscured, the “authorization required” approval card is invisible;
  • When a turn finishes, there is no way to know it has ended, making it hard to check results in time;
  • When the model asks a question, you cannot respond promptly if you are not in the foreground;
  • Repeated events can cause a flood of notifications.

Core Features

1. Notification Types & Summaries

Depending on the scenario, the notification title and body change accordingly:

Scenario Notification Title Body Example
Authorization needed to execute a command (pwsh / bash, etc.) Task needs authorization Tool name + purpose of the operation (approval reason, with the escalate sandbox to <mode>: machine prefix stripped)
Authorization needed to modify files (write / edit, etc.) File modification needed Tool name + purpose of the operation
Other tools need confirmation Task needs your confirmation Tool name + approval reason
Model asks a question awaiting your reply Question needs your answer Original question text
Turn completed Task completed Session name + reminder to check results in the client

2. Foreground Suppression

  • When the client is in the foreground (window focused, page visible), no notifications are shown at all; UI-only display is used;
  • Turn completion for subagent sessions does not trigger a notification; only the main session’s completion triggers one;
  • On cold start, idle sessions do not trigger notifications; only the observed running: true -> false edge triggers one;
  • If the same event is delivered repeatedly within 1.5 seconds, only one notification is shown.

3. Diagnostics Channel

The browser side and the host side communicate over two dedicated channels for debugging:

  • POST /api/desktop-notify/report: The browser reports each decision to the host (whether the event arrived, which gate blocked it, whether new Notification() threw an exception, environment snapshot, etc.).
  • GET /api/desktop-notify/selftest: The browser returns self-test toggle status, trace, and the actual path of the toggle to the host.

The trace file is located at <DSH_HOME|~/.dsh>/desktop-notify/trace.jsonl by default and can be redirected via the environment variable DSH_DESKTOP_NOTIFY_TRACE. Setting the environment variable to off, 0, false, none, or no disables writing entirely, but the endpoints and self-test remain available.

Trace is automatically rotated: when it exceeds 512 KB, the first half is trimmed, keeping only the most recent 256 KB (trimmed at line boundaries to ensure the JSONL remains parseable).

4. Self-Test

Place a marker file at <DSH_HOME|~/.dsh>/desktop-notify/selftest.flag. Two seconds after the page loads, a Toast titled “Notification Self-Test” is forcibly shown regardless of foreground/background. This is used to distinguish “code is not running” from “the system is not displaying it.” Remember to delete the file after the self-test, otherwise a Toast will appear on every page load.

5. Testing

The plugin includes smoke tests with a fake DOM, fake Notification, and fake fetch, covering three event types, classification, foreground suppression, deduplication, subagent silence, cold-start edge detection, click handling, and self-test forced popup. Running the tests does not require starting DSH:

npm test

Installation & Enablement

dsh plugin --profile desktop add link:<this directory>
# Or install from the repo:
dsh plugin --profile desktop add github:LeeRolling/dsh-notify-context

This directory already declares dsh.bundle.patch + dsh.client; after installation, restart the client to take effect. Since it is installed via link:, you can simply restart after modifying lib/client.js—no reinstall needed.

Uninstallation

dsh plugin --profile desktop remove dsh-notify-context

Usage Tips

Send a message in the client first, then immediately switch away. A turn starts when you hit send; only after you switch away will events occur while you are absent. The reverse (switching away first, then coming back to type) will bring you back to the foreground, and by design, no notification will be shown.

Applicable Scenarios & Cautions

This plugin is suited for DSH usage scenarios involving long-running tasks where you occasionally step away from the desktop—for example, handling approvals, answering questions, or checking turn results via system notifications while browsing other content.

This plugin runs with the current DSH process privileges. It is recommended to review the source code and license (MIT) before installing.

Ecosystem Context

DSH’s philosophy is “everything is a plugin.” Community directories (such as SkillHub) are independent sites with no official affiliation to DeepSeek / High-Flyer.

Acknowledgments & References

This plugin references the following projects in terms of API conventions, event contracts, and certain engineering patterns:

  • DeepSeek Harness (MIT) — The host platform and the plugin specification itself.
  • DSH built-in packages @deepseek-ai/dsh-client-ui-approval / -user-questions / -session (MIT) — The three client event names and semantics it subscribes to.
  • AwesomeHou/dsh-plugin-marketplace (MIT) — Reference for the HTTP utilities and cordis.patch.yml format.

Similar prior work (this plugin did not reference their code):

  • Directory page: https://www.skillhub.cn/plugins/LeeRolling/dsh-notify-context
  • GitHub: https://github.com/LeeRolling/dsh-notify-context
羽毛球分组比赛记分
小程序二维码

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

Xiaoye