Preface¶
When DeepSeek Harness (DSH) is running a task, it’s inconvenient to keep watching the window if you need to switch to something else. By the time you come back, the task may have already finished, but you have no idea what the result was. The in-page bubble notifications aren’t prominent enough, and they’re easily blocked or ignored by the browser.
The plugin dsh-bell-notify adds a bell icon to the bottom-left corner of the DSH sidebar (next to the account section). Once enabled, every time the model finishes a task, a system notification pops up in the Windows Notification Center—not an in-page bubble, but the kind that lands in the OS-level notification center.
What It Is¶
dsh-bell-notify is a DSH client plugin maintained by HitMargin. It listens for task-completion events and triggers Windows system notifications so developers can be promptly informed of the model’s results.
Core capabilities:
- Displays a bell icon in the bottom-left corner of the DSH sidebar
- Pops up a Windows system notification when a model task completes
- Notification title is taken from the session title
- Notification body is taken from the last non-interrupted text in the model’s output
- Body text exceeding 180 characters is truncated with an ellipsis
- Toggleable on/off, disabled by default
- Uses the SSE mechanism; no polling dependency
Installation & Enabling¶
Install via the DSH plugin directory:
dsh plugin add github:HitMargin/dsh-bell-notify
After installation, the bell icon will appear in the bottom-left corner of the sidebar.
How to enable:
- Click the bell icon once: turn on (highlighted, no slash)—notifications will fire when a task completes
- Click again: turn off (gray, with a slash)—no more notifications
- Red dot in the top-right: indicates a task just finished but the notification couldn’t be delivered (a fallback signal when permission is denied or sending fails)
When you click the bell to turn it on, a test notification fires immediately—this is the only “seeing is believing” moment in this flow.
Typical Usage¶
Notification Content Format¶
Notification title = session title; notification body = the last text output by the model in this turn.
Example: In a session titled “Refactor Login Module,” you ask it to modify code. When it finishes, the notification reads:
Refactor Login Module
Done: extracted session validation into a standalone function and added unit tests.
The title is read from the session title (prioritized from the api-session/added cache, falling back to sessionQuery.readTitle if unavailable). The body is the last non-interrupted assistant/message text from the model’s surface layer as returned by readSurface() (skipping any fragments with interrupted: true).
Body text exceeding 180 characters is truncated with an ellipsis: cramming a full answer into a system notification serves no purpose.
Why the Body May Not Be the “Conclusion”¶
Before this version, the body was taken from the last assistant/message text in readSurface(), which seems logical on the surface but has two pitfalls in practice:
Reading too early: api-session/status fires when the agent transitions to idle, but the last assistant/message may not yet be committed to the surface layer. At that point, you’d be reading the previous turn’s intermediate text.
Silent read failures: readSurface must replay and validate the entire log, which can take several seconds for large histories, and it doesn’t accept an AbortSignal. The old implementation would silently fall back to a generic message on read failure.
The current approach:
- Reads multiple times within a 900ms grace period, keeping the one with the most events
- Each individual read has a 1.2-second cap
- Skips messages with
interrupted: true - If nothing is obtained after the grace period, it uses the best version available—a notification with a slightly stale conclusion is preferable to no notification at all
Event Structure¶
When reading surface events, the message is not at the top level of the event; it’s nested inside data:
{ type: 'assistant/message', seq, time,
data: { turn, step, message: { role, content: [...] }, stream, interrupted? } }
Note that event.message === undefined; the field lives at event.data.message.
How It Determines “Task Complete”¶
The host listens on api-session/status(sessionId, running) and records a state change only on the single transition from running: true → false.
Requiring a prior true is to avoid false-positives at startup, where a session that was already idle might be misreported as having just finished.
How the Notification Is Delivered¶
Two paths, in priority order:
- Electron native
Notification: used when the host runs in the Electron main process—most canonical, displays “DeepSeek Harness” at the top of the notification. - WinRT toast (PowerShell 5.1): fallback, using DSH’s AppID
electron.app.DeepSeek Harness.
If both fail, the event carries delivered: failed, and the client fires an in-page notification as a last resort.
Why SSE Instead of Polling¶
When the window is minimized, Chromium throttles setInterval (as slow as 1 tick/minute after 5 minutes in the background). Yet that’s precisely when you’re away from the window and most need the notification—polling is least reliable exactly when it matters most.
SSE is network-driven and unaffected by timer throttling. EventSource reconnects automatically on disconnect; events may be lost during reconnection, so a catch-up fetch using since is issued on mount and every time the window becomes visible again (idempotent; the client deduplicates by seq).
Applicable Scenarios & Cautions¶
Suitable for: tasks that run for a few minutes, where you switch to something else and don’t want to keep watching the window for the result.
Note: The plugin runs with the current dsh process’s permissions. Review the source code and license before installing.
Development & Testing¶
node --check index.js && node --check client.js
node test/smoke.mjs # Client: module shell, slot registration, toggle rendering
node test/host.test.mjs # Host: transition detection, four routes, toggle, since cursor, cross-site blocking
node test/content.test.mjs # Notification content: title=session title, body=model conclusion, retry on early read, fragment skipping, truncation
node test/toast-live.mjs # Manual: actually fires a notification (will appear on screen)
Tests set DSH_BELL_DISABLE_TOAST=1 by default, so no real notifications are shown; toast-live.mjs is the exception.
DSH_BELL_DISABLE_TOAST=1 is also suitable for headless servers—where notifications shouldn’t be firing in the first place.
Changes to the host half (index.js) require an application restart to take effect.
Disabling¶
- Click the bell to turn it off (no more notifications, but the plugin remains installed)
- Or disable
dsh-bell-notifyon the plugins page
Ecosystem Context¶
DSH’s philosophy is “everything is a plugin.” The community directory is a standalone site with no official affiliation to DeepSeek or High-Flyer.