Introduction¶
When running multiple sessions simultaneously in DeepSeek Harness (DSH), approvals, plan confirmations, questions, and reply completions often occur in a “conversation you are not currently viewing.” If the notification policy only recognizes “whether the page is visible,” on macOS, when the window is covered by another application, document.hidden may still be false, easily misinterpreting “the user is actually in Edge or an IM app” as “staring at DSH,” thereby missing operations that require a click.
The following introduces the community client plugin dsh-focus-notify (maintainer: sqzw-x; SkillHub directory entry: sqzw-x/dsh-alerts). It treats approvals, questions, plan confirmations, and reply completions uniformly as desktop notifications, using window keyboard focus (document.hasFocus()) to distinguish between the “current session” and background sessions, rather than relying solely on page visibility.
What is this¶
dsh-focus-notify is a Cordis client bundle plugin running inside the DSH Web / DSH Desktop page: it subscribes to the host’s existing uiSession.sessionStatus and sessions.list, sends system notifications when rules permit, and removes notifications for a session when you return to it or the window regains focus.
- Maintainer: sqzw-x
- License: MIT (see repository README)
- Current package version (snapshot): 0.3.1
- Source code and documentation: github.com/sqzw-x/dsh-focus-notify
The DSH ecosystem emphasizes “everything is a plugin”; directory sites like SkillHub are community aggregations, with no official affiliation with DeepSeek / High-Flyer. Before installing, it is recommended to review the source code and license yourself — the plugin runs with the same permissions as the current DSH process.
Three notification rules¶
The README consolidates the behavior into three rules, with the decision logic centralized in allows() in src/engine.ts (pure logic, unit-testable):
- View the session: The “current session” derived from
retainedBy.mainViewon screen only pops notifications when the window loses keyboard focus; other sessions will also pop notifications when the DSH window is still in the foreground. Sub-agent sessions do not participate by default (ignoreSubagentdefaults totrue, can be turned off). - View the event: Both turn completion (reply done) and “waiting for your action” (
pendingInteraction: approval / plan confirmation / question) will pop notifications; the same pending request is deduplicated bykey, only reminding once. - Return to the session and clear: When focused on that session, the notification disappears — clicking into the notification, the window regaining focus, or manually switching to that session all count; losing focus while only switching sessions does not clear notifications.
Completion detection uses the edge where running falls from true to false, and no pending interaction follows immediately after stopping; it deliberately does not use the SDK’s completionUnread as a completion signal, to avoid background session completion reminders being incorrectly cleared by sidebar unread logic. The tradeoff is that replies where “the client hasn’t yet observed running === true before ending” may not notify (e.g., spanning a page reload).
Installation and activation¶
Plugin manager: Install the directory entry corresponding to this package in DSH Settings → Plugins, then restart DSH Desktop after enabling (the client bundle is read at page load).
Command line (from original documentation, Desktop profile):
# Install from GitHub
dsh plugin --profile desktop add github:sqzw-x/dsh-focus-notify
Once the npm package is published, you can switch to:
dsh plugin --profile desktop add dsh-focus-notify
After installation, restart DSH Desktop is also required. If you only want to disable without uninstalling, add to the profile’s cordis.patch.yml:
- id: dsh-focus-notify
disabled: true
The engines.dsh field in package.json declares the compatible DSH version range; the actual gate mainly comes from the @deepseek-ai/dsh* prefix packages in peerDependencies.
Configuration and debugging¶
It works with default values. You can temporarily change behavior from the page console (configuration persists in localStorage under dshFocusNotify.config):
__dshFocusNotify.configure({ sound: true }) // Turn on notification sound (WebAudio, requires prior interaction with the page)
__dshFocusNotify.configure({ enabled: false }) // Temporarily turn everything off (still tracks state)
__dshFocusNotify.debug() // Current session, undelivered waits, counters, permissions, focus, navigation path
__dshFocusNotify.test() // Bypass rules to send one, verify the notification channel
__dshFocusNotify.open('session-id') // Switch session by id, verify the click path
| Field | Default | Description |
|---|---|---|
enabled |
true |
Master switch |
ignoreSubagent |
true |
Don’t notify for sub-agent sessions |
language |
'auto' |
Follow DSH interface, or 'zh' / 'en' |
sound |
false |
Additional notification sound beyond the system notification |
When troubleshooting “clicked the notification but didn’t switch sessions,” the navigation in debug() indicates the session-switching API that will be used (uiWorkspace.openSession / sessions.open / none); counters.failed is the number of navigation failures. Each notification also dispatches dsh-focus-notify:alert on window (event.detail contains kind / sessionId / title / body / tag), facilitating custom taskbar flashing, custom sounds, or logging.
When clicking a notification, the desktop client raises the window via the dsh://open deep link, while the browser branch uses window.focus(); then calls the host’s session switching. If permission is denied, no notification is sent, and debug().permission will be denied.
Use cases and limitations¶
Suitable for: Mainly using DSH Desktop for multi-session parallel work, wanting “only bother me when the current conversation loses focus, background sessions can bother me anytime, sub-agents are silent by default.” The README states it has only been tested on DSH Desktop; whether the Web version can properly raise the window and go through the permission flow is unverified.
Notes:
- If the host lacks
uiWorkspace.openSessionandsessions.open, clicking a notification may only raise the window without switching sessions. - If the host lacks
retainedBy.mainView, all sessions are treated as “non-current,” meaning all will notify. - Notification style and duration are determined by the system (macOS: System Settings → Notifications → DeepSeek Harness).
- Only works within DSH Web / Desktop pages;
dsh-app://pages cannot register a Service Worker, and this plugin does not depend on the notification button.
Conclusion¶
dsh-focus-notify uses focus rather than “page visibility” to distinguish between current and background sessions, and unifies approvals, questions, plan confirmations, and reply completions into a single type of reminder, reducing missed operations during multi-session use. Installation commands should follow the README; the directory and discussions can be accessed via SkillHub and GitHub respectively.
- Directory page: https://www.skillhub.cn/plugins/sqzw-x/dsh-alerts
- Repository: https://github.com/sqzw-x/dsh-focus-notify