@laraveladmin/dsh-stay-awake 0.3.1 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/README.en.md +1 -1
- package/README.md +1 -1
- package/docs/VERIFICATION.md +16 -0
- package/index.js +17 -8
- package/market/index.json +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# 变更记录 · Changelog
|
|
2
2
|
|
|
3
|
+
## 0.3.2 — 2026-12-03
|
|
4
|
+
|
|
5
|
+
### 修复
|
|
6
|
+
|
|
7
|
+
- **失败提示音误判**:之前把 `error` / `aborted` / `interrupted` / `blocked` 都当成失败。实际上 DSH 自己的
|
|
8
|
+
聊天视图只对 `error`(以及重启补写的 `interrupted`)显示失败行,`aborted`(用户停止、父轮次收尾)、
|
|
9
|
+
`blocked`(守卫拒绝一步)、`max-tokens`、`forked` 都不算失败。所以成功完成也偶尔响 `Basso`。
|
|
10
|
+
- 现在只把 `error` 当作失败;一次工作段里有多个回合时以**最后一个普通会话回合**为准(重试成功不会再响失败音)。
|
|
11
|
+
- **子代理会话不再参与音效判断**:父轮次结束时会收尾子代理,那是一条 `aborted`,之前被当成失败;子代理内部的
|
|
12
|
+
prompt 也不再算作「用户发起的任务」(`soundOnlyUserTasks`)。
|
|
13
|
+
- 新增 4 项回归测试:子代理失败不污染父轮次成功、非失败结束不响、最后回合决定、子代理 prompt 不算用户任务。
|
|
14
|
+
单测 109 → 113。
|
|
15
|
+
|
|
16
|
+
|
|
3
17
|
## 0.3.1 — 2026-12-03
|
|
4
18
|
|
|
5
19
|
### 修复
|
package/README.en.md
CHANGED
|
@@ -36,7 +36,7 @@ The rule is a pure function: `wanted = enabled && (agents + maintenance + jobs >
|
|
|
36
36
|
Three moments each get one cue, played on the machine that runs the DSH host — they reach you even when the window is minimised.
|
|
37
37
|
|
|
38
38
|
- **Done**: one chime per work segment (from work starting to everything finishing), including background jobs and multiple sessions. `Glass` by default.
|
|
39
|
-
- **Failed**: the turn
|
|
39
|
+
- **Failed**: only when the turn **really errored** (`error`). A stop you pressed, a rejected approval, a subagent wound down by its parent, `max-tokens` or `forked` do not count; when a work segment contains several turns, the **last ordinary-session turn** decides, so a retried success no longer rings the failure cue.
|
|
40
40
|
- **Your turn**: the agent asked a question (`ask_user_question`) or a tool call waits for approval — rings immediately. `Ping` by default. This is the only cue that can fire while the turn is still open; without it the agent would wait for you in silence.
|
|
41
41
|
- Segments shorter than 20 seconds stay silent; autonomous goal/scheduled rounds stay silent (questions and approvals still ring).
|
|
42
42
|
- The panel's **Sounds** master switch covers all three; three small buttons (Done / Error / Alert) audition each cue.
|
package/README.md
CHANGED
|
@@ -36,7 +36,7 @@ DSH 跑长任务时你离开电脑,系统按空闲策略休眠:进程被挂
|
|
|
36
36
|
三种时机各响一声,不用盯着屏幕——声音在**运行 DSH 的这台机器**上播放,窗口最小化也听得到。
|
|
37
37
|
|
|
38
38
|
- **完成**:一次「工作段」(从有工作到全部结束)结束时响一次,含后台任务与多会话。默认 `Glass`。
|
|
39
|
-
-
|
|
39
|
+
- **失败**:只有这一轮**真的报错**(`error`)才响,默认 `Basso`。你主动按停止、审批被拒、子代理被父轮次收尾、`max-tokens`/`forked` 这类结束都不算失败;一个工作段里有多个回合时,以**最后一个普通会话回合**的结果为准,重试成功不会还响失败音。
|
|
40
40
|
- **需要你回答**:agent 用 `ask_user_question` 提问、或工具调用等审批时立刻响,默认 `Ping`——这是唯一一个「回合还没结束也响」的情况,否则它会一直安静地等你。
|
|
41
41
|
- 短于 20 秒的任务不响;goal/定时任务等自主轮次不响,避免连响(但提问/审批仍然会提醒你)。
|
|
42
42
|
- 弹层「提示音」总开关控制全部三种;旁边三个小按钮「完成 / 失败 / 提醒」可分别试听。
|
package/docs/VERIFICATION.md
CHANGED
|
@@ -224,6 +224,22 @@
|
|
|
224
224
|
- 自动化:纯前端改动,109 项测试保持全绿;`node --check` 通过。
|
|
225
225
|
- 未验证:窄窗口、反复缩放、滚动后的观感需要刷新页面后目视确认(本会话无浏览器控制权)。
|
|
226
226
|
|
|
227
|
+
## 0.3.2 失败提示音误判修复(2026-12-03)
|
|
228
|
+
|
|
229
|
+
- **问题**:成功完成的回合偶尔响失败音。根因是判定过宽:`SOUND_ERROR_KINDS` 把
|
|
230
|
+
`error / aborted / interrupted / blocked` 全算失败,而且是「本工作段内任意一次失败就定调」,且不看会话类型。
|
|
231
|
+
- **依据**(读的是当前安装的 DSH 源码 `dsh-client-ui-chat/src/client/conversation-nodes/turn-error.ts`):
|
|
232
|
+
宿主自己的聊天视图只对 `error` 与重启补写的 `interrupted` 显示失败行;`aborted`(用户/父级取消)、
|
|
233
|
+
`blocked`、`max-tokens`、`forked` 明确没有失败行。本插件只对 `error` 响失败音——
|
|
234
|
+
`interrupted` 是恢复时补写的闭包事件(那一刻进程已经退出,本来也听不到),为避免恢复旧会话时误响也排除。
|
|
235
|
+
- **子代理**:父轮次结束会 `drainDescendants` 收尾子代理,子会话落一条 `aborted`;之前它把全局标记设成
|
|
236
|
+
失败。现在子代理会话(`header.parentSession` 或 `origin: 'subagent'`)完全不参与音效判断,其内部 prompt
|
|
237
|
+
也不计为「用户发起的任务」。
|
|
238
|
+
- **最后一次回合决定**:同一工作段内多次 `turn/end` 时以最后一个普通会话回合为准,失败后重试成功不再响失败音。
|
|
239
|
+
- 自动化:新增 4 项接线测试(子代理失败不污染、五类非失败结束不响、最后回合决定、子代理 prompt 不算用户任务),
|
|
240
|
+
109 → **113 项全绿**;`node --check` 通过。
|
|
241
|
+
- 未验证:真实多代理会话里「成功完成却响失败音」的复现场景需要重启宿主后实测。
|
|
242
|
+
|
|
227
243
|
## 未验证(明确记录,不代替验证)
|
|
228
244
|
|
|
229
245
|
| ID / 项 | 原因 | 何时可验 |
|
package/index.js
CHANGED
|
@@ -100,7 +100,12 @@ export function start(ctx, rawConfig, deps = {}) {
|
|
|
100
100
|
let workStartedAt = 0
|
|
101
101
|
let pendingUserSound = false
|
|
102
102
|
let lastOutcome = 'ok'
|
|
103
|
-
|
|
103
|
+
// Only a real failure is a failure for the person listening. DSH's own chat
|
|
104
|
+
// view shows no failure row for `aborted` (user stop, parent cleanup),
|
|
105
|
+
// `blocked` (a guard rejected a step), `max-tokens` or `forked`; those are
|
|
106
|
+
// routine endings, and treating them as errors made successful work ring the
|
|
107
|
+
// failure cue.
|
|
108
|
+
const SOUND_ERROR_KINDS = new Set(['error'])
|
|
104
109
|
|
|
105
110
|
function maybeRing(durationMs) {
|
|
106
111
|
try {
|
|
@@ -213,17 +218,21 @@ export function start(ctx, rawConfig, deps = {}) {
|
|
|
213
218
|
sync()
|
|
214
219
|
}),
|
|
215
220
|
ctx.on('session/event', (session, event) => {
|
|
216
|
-
// Subagent sessions are not resumed automatically
|
|
217
|
-
// the
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
+
// Subagent sessions are not resumed automatically (their parent owns
|
|
222
|
+
// the work) and are not part of the sound decision: their turns are
|
|
223
|
+
// routinely closed by the parent, which used to look like a failure.
|
|
224
|
+
const ordinary = session?.header?.parentSession === undefined && session?.header?.origin !== 'subagent'
|
|
225
|
+
if (ordinary) resumeTracker.observe(session.id, event)
|
|
221
226
|
if (event?.type === 'user/message') {
|
|
222
|
-
|
|
227
|
+
// A subagent's internal prompt is not a task the user started, so it
|
|
228
|
+
// must not make a background completion audible.
|
|
229
|
+
if (ordinary) pendingUserSound = true
|
|
223
230
|
return
|
|
224
231
|
}
|
|
225
232
|
if (event?.type === 'turn/end') {
|
|
226
|
-
|
|
233
|
+
// The *last* ordinary turn decides the cue: a failure the user then
|
|
234
|
+
// retried into a success must not keep the failure sound.
|
|
235
|
+
if (ordinary) lastOutcome = SOUND_ERROR_KINDS.has(event.data?.reason?.kind) ? 'error' : 'ok'
|
|
227
236
|
return
|
|
228
237
|
}
|
|
229
238
|
if (config.includeMaintenance !== true) return
|
package/market/index.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@laraveladmin/dsh-stay-awake",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"description": "DeepSeek Harness plugin that keeps the machine awake only while unattended work runs, and retries the turn that died with the network once it is back.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"dsh-plugin",
|