rea
morluto
Reverse engineer anything with agents, from app behavior down to native binaries.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:Andyqwe44/dsh-notify-win
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
DeepSeek Harness (DSH) Windows notification plugin — native toast, an unread badge on DSH's own tray icon, and an optional taskbar flash when a task finishes or your input is needed. Every event chooses its own reminders on the plugin page (插件 → dsh-notify-win).
English | 中文





Screenshots are from Windows 11. The default reminder after an ignored toast is the red unread badge on DSH's own notification-area icon (chat-app style); the warm taskbar pulse is opt-in per event, and the notification matrix, its timing and the badge limit are all edited on the plugin's page — nothing is added to Settings.
^ overflow the dot moves to the taskbar buttonFlashWindowEx) — off by default, can be enabled per event; the OS stops it as soon as DSH comes to the foregroundidle)turn/end reason instead of always claiming success: normal finish, output-token ceiling (max-tokens), blocked pre-step, LLM failure (provider-neutral code + retry count), or cancellation. See Stop conditions.compaction/end with error)ask_user_question)问题 i/n + 上一题 / 下一题 / 提交 / 取消); every page keeps its dropdown choice and custom text when you page back, and a 已答:… line keeps the other answers visible.dsh-toast-question.exe is started when the plugin is applied and reused for every question. Disabling the plugin or quitting DSH shuts it down (stdio EOF when DSH exits), so no per-question process spawn and no orphan process.… when it is longer (no “已提交” / “已送达” / “已收到并回应” stages, no title line). Text that can only exist if the whole round trip really happened. If the model produces no visible text, nothing is shown (no invented receipt). Cancelling says “没有向 DSH 提交任何答案”; a card that could not be filled says “请在 DSH 窗口中手动回答”.ask_user_question call returns immediatelydsh plugin --profile web add github:Andyqwe44/dsh-notify-win
Requires
pnpmon PATH (corepack enableif missing). See Install for details.The npm package still sits at
0.1.1(the old PowerShell implementation);0.8.5is not published yet because the account's 2FA device is lost. Install from GitHub — the repository is the current version.
Prerequisite: pnpm
corepack enable
Or without admin, put a user-level shim in a PATH directory:
Set-Content -Path "$env:LOCALAPPDATA\Microsoft\WindowsApps\pnpm.cmd" -Value "@echo off`r`ncorepack pnpm %*`r`n"
corepack pnpm --version
Install the plugin
# From GitHub (recommended while the npm release is behind)
dsh plugin --profile web add github:Andyqwe44/dsh-notify-win
# If github: is blocked, use SSH:
dsh plugin --profile web add git+ssh://git@github.com/Andyqwe44/dsh-notify-win.git
# The desktop app accepts the same address in Plugins -> Add plugin:
# github:Andyqwe44/dsh-notify-win
Verify
dsh --profile web --dump-config # look for: # == dsh-notify-win / - id: dsh-notify-win
Restart and test
dsh web
Complete any task. The first notification self-registers the branded toast identity (Start Menu shortcut + AppUserModelID, one-time). If the toast header still shows DeepSeekHarness without an icon, restart Explorer once:
Stop-Process -Name explorer -Force; Start-Process explorer
web recommended)winget install Microsoft.DotNet.DesktopRuntime.10 or from https://dotnet.microsoft.com/download/dotnet/10.0. No PowerShell script is used.Edit $env:USERPROFILE\.dsh\profiles\web\cordis.patch.yml:
- id: dsh-notify-win
config:
doneTitle: 'DeepSeek Harness · Task complete'
doneBody: 'Your task has finished.'
compactTitle: 'DeepSeek Harness · Context compacted'
compactBody: 'Context compaction finished, you can continue.'
questionTitle: 'DeepSeek Harness · Action needed'
questionBody: 'An approval or decision is waiting.'
askTitle: 'DeepSeek Harness · Question for you'
askBody: 'The assistant asked you something.'
dedupMs: 1500 # suppress duplicate notifications within this window
questionToastDuration: 'short' # 'short' (~5s) or 'long' (~25s) for ask_user_question toasts
doneToastDuration: 'short' # 'short' (~5s) or 'long' (~25s) for done/compact/alert/notice toasts
approvalToastDuration: 'long' # 'short' or 'long' for interactive approval requests
helperLog: '' # optional file for helper protocol/toast diagnostics
answerPendingTimeoutMs: 30000 # how long a parked answer waits for the browser half before warning
answerSpeechTimeoutMs: 90000 # how long to wait for the model's first line after delivery
showProject: true # prefix body with project label
# Notification behavior. The plugin page (插件 → dsh-notify-win) edits these live.
eventPolicy:
done: { toast: true, blink: true, flash: false }
compact: { toast: true, blink: false, flash: false }
receipt: { toast: true, blink: false, flash: false }
question: { toast: true, blink: true, flash: false } # toast is always on
approval: { toast: true, blink: true, flash: false } # toast is always on
error: { toast: true, blink: true, flash: false }
cancelled: { toast: true, blink: false, flash: false }
file: { toast: false, blink: false, flash: false }
attention:
timing: 'after-timeout' # 'after-timeout' (when an ignored toast expires) or 'immediate'
blinkMaxMinutes: 30 # 0 = blink until you come back
blinkIntervalMs: 600
fileChangeTitle: 'DeepSeek Harness · File changed'
fileChangeBody: 'Updated {path}'
# Stop-reason notifications (defaults are Chinese; shown here in English)
notifyOnCancel: true # notice when the user cancels a running turn
notifyOnError: true # alert on max-tokens / blocked / LLM failure / failed compaction
includeErrorCode: true # append the machine-readable failure code to an error body
cancelledTitle: 'DeepSeek Harness · Cancelled'
cancelledBody: 'The task was cancelled.'
hookCancelledBody: 'Blocked by a hook: {message}'
maxTokensTitle: 'DeepSeek Harness · Output ceiling reached'
maxTokensBody: 'The response hit the output limit and was truncated. Send "continue" to resume.'
blockedTitle: 'DeepSeek Harness · Turn blocked'
blockedBody: 'A pre-step check rejected this turn.'
errorTitle: 'DeepSeek Harness · Task interrupted'
errorBody: 'The task stopped abnormally: {hint}' # {hint} = built-in code hint or provider message
retrySuffix: ' (retried {retry}/{retryMax} times)'
compactionFailedTitle: 'DeepSeek Harness · Compaction failed'
compactionFailedBody: 'Context compaction failed: {message}'
Templates support {message}, {code}, {hint}, {reason}, {retry}, {retryMax}.
The same matrix is available as switches in DSH: 插件 → dsh-notify-win, i.e. a
settings section on the plugin's own detail page (the client half registers it into
plugins.bundle.config). Each row is one event; the three columns are the toast, the
tray badge and the taskbar flash, and the same page carries the reminder timing and the
badge's blink limit. eventPolicy and attention are declared .volatile(), so a
switch writes through DSH's settings transport and the running plugin picks the new
value up on the next event — no restart.
The section lives on the plugin's page rather than in Settings so the global settings list stays short: one entry per installed plugin turns that list into noise.
The tray badge note: DSH's tray icon belongs to the Electron main process; replacing its bitmap from another process is undocumented and can leave a broken icon behind, so nothing is replaced. The helper instead places a click-through layered window (WS_EX_LAYERED | WS_EX_TRANSPARENT | WS_EX_NOACTIVATE) over the icon's cell and paints the dot there. The cell comes from the documented Shell_NotifyIconGetRect (Electron hosts its icon on Electron_NotifyIconHostWindow), and because the window belongs to the helper it disappears with it. When Windows 11 files the icon under the ^ overflow the rectangle is unavailable, so the dot falls back to a taskbar-button overlay (ITaskbarList3::SetOverlayIcon).
The reminder is event-driven, with no polling thread: while idle the badge thread blocks in its message loop (measured 0.0 ms CPU over 10 s), and while blinking each frame is one WM_TIMER plus one Shell_NotifyIconGetRect (the window/id pair is cached, so the steady state is a single shell call). Taskbar moves and DPI/theme changes arrive as WM_DISPLAYCHANGE / WM_SETTINGCHANGE on the overlay window, and returning to DSH is caught by the existing foreground hook. The per-frame position read stays because Windows emits no event when an icon is filed into the ^ overflow or the tray re-lays out — the shell query is the only documented way to notice.
To disable:
- id: dsh-notify-win
disabled: true
Restart after install/disable changes (web profile HMR is disabled by default).
agent/status only says idle; it does not say why. The plugin therefore caches the
turn/end reason (which is always appended immediately before the idle transition)
and turns it into the notification:
turn/end reason |
Notification | Notes |
|---|---|---|
completed |
done | normal finish |
max-tokens |
alert | output-token ceiling; the turn was truncated |
blocked |
alert | a pre-step hook/plugin rejected the turn |
error |
alert | LLM failure; body carries the code hint + retry count |
aborted (user, parent, legacy) |
notice | lightweight "cancelled" |
aborted (hook) |
notice | body names the hook reason |
aborted (disposed) |
silent | disposal cancels the driver right before teardown |
interrupted, forked |
silent | durable history markers (resume / fork seeds), never live stops |
| unknown (future reason) | alert | rendered from unknownStopBody (default text is Chinese) |
A failed context compaction (compaction/end with error) raises its own alert; a
successful one still shows the "context compacted" toast.
error notification details come from the provider-neutral LlmFailure.code
(RATE_LIMIT, SERVER, TIMEOUT, TRANSPORT, EMPTY_RESPONSE,
CONTEXT_WINDOW_EXCEEDED, QUOTA, AUTH, MISSING_CREDENTIAL,
INVALID_CREDENTIAL, ACCOUNT_TOKEN_INVALID, STREAM_CLOSED, NO_ADAPTER,
UNKNOWN_MODEL, INVALID_CONFIG, UNSUPPORTED_OPTION, ABORTED, UNKNOWN, …).
Unlisted codes fall back to the provider message. Retry counts come from the
durable llm/retry events — the framework has no distinct "retries exhausted"
reason, so the plugin reports the retry count from the last retry record
(retrySuffix, default Chinese).
| Concern | Implementation |
|---|---|
| Trigger "done"/alert/notice | session/event → turn/end reason cache + agent/status idle (root agents only) |
| Trigger "compact" / compaction failure | session/event → compaction/end |
| Trigger "question" | approval/request waterfall (toast + DSH panel) + tools/execute for ask_user_question |
| Trigger "file changed" | tools/execute for write / edit / apply_patch / str_replace_editor returning a successful result (root agents only) |
| Done/compact/alert/notice toast | Resident .NET helper notify op; WinRT Windows.UI.Notifications; a refused toast falls back to the attention effects (no tray icon). No per-notification process |
| Effect policy | lib/config.js resolves one {toast, blink, flash, timing} row per event; the host sends it with notify/question and the helper applies it on show (immediate) or on the toast's timed-out dismissal (after-timeout) |
| Tray badge | The helper places a click-through layered window over DSH's tray icon (located with Shell_NotifyIconGetRect) and blinks a red dot on it; it clears on a DSH foreground window, an answer/resolve, or the configured limit, and never registers a tray icon or touches the icon bitmap |
| Badge fallback | When the tray icon cannot be located (filed under ^), the dot is drawn as an ITaskbarList3 overlay on the taskbar button |
| Interactive approval toast | DSH's own approval panel still shows; the toast is a remote control using the same question op: one fixed-choice card (允许一次 / 拒绝, no free-text input). Its answer is parked for the browser half, which switches to the owning session and clicks the panel; the panel remains the authority. Cancelling the toast leaves the decision to the panel, and an aborted turn retires the toast |
| Interactive question toast | Resident .NET helper question op, spoken to over the child's stdin/stdout (newline-delimited JSON). One question = one card; several questions = one paged card (问题 i/n, 上一题/下一题/提交), with each page's draft restored through the toast defaultInput attribute |
| Background answer | The official card stays the only answerer: the host parks the toast choice and the page waits on a hanging request (/dsh-notify/v2/wait-answer). A response reaches a hidden renderer like any other event, and the card-driving waits use MutationObserver instead of polling, so the page clicks its card in the background — no timer, no window move, no focus change. The request has no timeout: it lives until an answer is parked, the page goes away, or the plugin unloads |
| Manual wake diagnostic | The helper keeps the wake / restore ops and --wake-test <ms> so the restore can be eyeballed by hand. The normal answer path never calls them: a restore without activation does not wake the renderer (measured), so it is not a usable automatic fallback |
| Question answer receipt | The helper reports the selection and dismisses the question toast; the host parks it for the browser half, checks the ask_user_question tool result, then shows exactly one toast — spoken with the model's first line (filled to the toast width, cut with …). No pending, delivered or title toast |
| Toast identity / protocol / focus | Helper startup registers the branded AUMID, Start Menu shortcut and dsh-notify:// handler; clicking a toast focuses DSH in-process (or via --focus on the cold path) |
| Helper lifetime | Plugin apply starts it → ctx.effect disposal sends shutdown; DSH exit closes stdin (EOF) and the helper exits; a crashed host leaves no orphan |
| Taskbar flash | EnumWindows + FlashWindowEx (FLASHW_TRAY \| FLASHW_TIMERNOFG = 2 \| 12 = 14); the OS stops it when DSH is foreground, with no periodic re-pulse |
| Execution | Every notification, question and toast click goes through the resident .NET helper; there is no PowerShell path |
The host half registers no DSH service and no tool; it exports a Config schema (the settings page form) and consumes lifecycle events. The settings section itself is registered by the client half into the plugin page (plugins.bundle.config).
| Event | What happens |
|---|---|
| Plugin applied (DSH start, reload) | The host probes --check once, then spawns dsh-toast-question.exe --serve and waits for its ready line (5 s). The helper registers the toast identity and protocol on the way up. |
| Non-interactive notification | One JSON notify line on the helper's stdin — no new process. The helper shows the toast and watches Dismissed/Activated. |
| Question asked | One JSON question line on the helper's stdin — no new process. |
| User answers | The helper emits answer and removes the question toast; the host parks it for the browser half. |
| Tool result returns | The host compares the returned answers with the toast's (a mismatch is reported), then waits for the model's first line and shows it as the only receipt, cut to the toast width. |
| Question answered in the DSH card | The host sends resolved; the helper stops the flash and removes the question toast. |
| Plugin disabled / profile row removed | ctx.effect disposal sends shutdown; the helper exits within 1.5 s (force-terminated otherwise). |
| DSH quits or crashes | The helper's stdin reaches EOF and it exits on its own; the managed subprocess range is also reaped by DSH. |
FlashWindowEx uses the system's warm-pulse highlight; custom colors are not possible.^ overflow the cell cannot be read: the reminder starts on the taskbar button instead, and an icon moved there mid-blink is retargeted within about a second; attention.blinkMaxMinutes decides how long it stays (0 = until you come back).notifyOnCancel: false to silence it, or notifyOnError: false to silence abnormal-stop alerts.dedupMs (default 1500 ms). A second idle for an already-reported turn stays quiet.已答 line carries the context across it. Multi-question cards always use the long duration (about 25 s).No toast appears
DeepSeekHarness without an icon, restart Explorer once: Stop-Process -Name explorer -Force; Start-Process explorerdotnet --list-runtimes should list Microsoft.WindowsDesktop.App 10.x.No badge appears
What happens when Windows files the icon under the ^ overflow
The overlay misses twice (about 1.2 s) and then paints the taskbar button's overlay badge instead, so the reminder is never silently lost.
Why is dsh-toast-question.exe in Task Manager
It is the plugin's resident helper (toasts, badge, flash). It creates no tray icon; when DSH exits, its stdin reaches EOF and it exits on its own.
How to remove it completely
%APPDATA%\Microsoft\Windows\Start Menu\Programs\DeepSeek Harness Notify.lnk (the one-time branded identity shortcut);npm run build # publish the helper to artifacts/ and stage it into lib/
npm run check # syntax check
npm test # policy + attention guard + smoke + proof-pipeline + helper protocol tests
npm run build requires the .NET 10 SDK (the runtime is enough to run the
published exe). It publishes into artifacts/publish/ and copies only the final
dsh-toast-question.exe into lib/, which is the directory npm ships. The
helper is locked while a helper is running, so quit DSH (or stop
dsh-toast-question.exe) before rebuilding. If dotnet is not on PATH, set
DOTNET to the full path of the SDK's dotnet.exe.
npm test runs six suites: test/policy.mjs (Config schema ↔ defaults,
per-event effect resolution, settings-page event keys), test/flash-policy.mjs
(the attention policy guard and the absence of the old scripts),
test/smoke.mjs (notification logic with a fake helper), test/proof.mjs
(question → parked answer → tool result → first line, using a fake helper that
speaks the real protocol), test/helper-protocol.mjs (the real exe: --check,
ready, ping, config/attention, wake/restore, shutdown, and exit on
stdin EOF), and test/background-answer.mjs (answering while minimized: the
answer is parked, the helper is asked to wake, and the host never settles the
question itself).
To see what "answer while minimized" does, run
lib\dsh-toast-question.exe --wake-test 1500: it restores the DSH window
without taking focus, holds it for 1.5 s and puts it back — the same path a
toast answer uses.
dsh-notify-win/
├── Directory.Build.props # all generated output goes to artifacts/
├── artifacts/ # build output (gitignored)
│ ├── bin/ # compiled assemblies
│ └── publish/ # single-file helper before staging
├── scripts/
│ └── build-helper.mjs # dotnet publish + stage exe into lib/
├── src/DshToastQuestion/ # C# source only (no bin/obj)
│ ├── DshToastQuestion.csproj
│ ├── Program.cs # entry point, CLI modes, stdin dispatch
│ ├── State.cs # shared state, constants, JSON options
│ ├── GlobalUsings.cs # project-wide usings
│ ├── Protocol/
│ │ ├── WireModels.cs # JSON messages and question models
│ │ └── HelperOutput.cs # stdout protocol + XML escaping
│ ├── Notifications/
│ │ └── Notifications.cs # notify op, toast delivery, tracking
│ ├── Questions/
│ │ ├── QuestionFlow.cs # flow state, start/finish
│ │ ├── QuestionRendering.cs # toast XML, paging, drafts
│ │ ├── QuestionInteraction.cs # activated actions, submit, answers
│ │ └── QuestionStatus.cs # host status -> receipt toasts
│ ├── Platform/
│ │ ├── ToastIdentity.cs # AUMID, Start Menu shortcut, protocol
│ │ ├── DshWindow.cs # find/focus/launch DSH
│ │ ├── Attention.cs # one StartAttention/StopAttention entry point
│ │ ├── TrayBadge.cs # tray unread dot: click-through overlay, placement, timer
│ │ ├── TaskbarBadge.cs # fallback: taskbar-button overlay (ITaskbarList3)
│ │ └── TaskbarFlash.cs # FLASHW_TIMERNOFG / FLASHW_STOP
│ ├── Interop/
│ │ ├── TaskbarList3.cs # ITaskbarList3 overlay-icon interface
│ │ └── NativeMethods.cs # P/Invoke, structs
│ └── Logging/
│ └── HelperLog.cs # optional --log file
├── lib/ # npm package: JS, assets, staged exe
│ ├── config.js # DEFAULTS, Config schema, effect policy
│ ├── index.js # host half: events, helper lifecycle, proofs
│ ├── client.js # browser half: click-to-focus, card driver, settings page
│ ├── dsh-toast-question.exe # staged by npm run build (gitignored)
│ └── dsh-*.png / dsh-*.ico # branding assets
├── test/ # fake helper + five test suites
├── docs/ # landing page and screenshots
├── cordis.patch.yml # DSH bundle patch
├── package.json # dsh.bundle declaration + scripts
├── README.md
└── README.zh.md
.ps1 path; every toast flashes only after it times out.Shell_NotifyIconGetRect), with a taskbar-button fallback; the helper's own tray icon, the Win11 overflow pinning and the trayIcon setting are gone.CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: deepseek。