@laraveladmin/dsh-stay-awake 0.3.4 → 0.3.5

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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # 变更记录 · Changelog
2
2
 
3
+ ## 0.3.5 — 2026-12-03
4
+
5
+ ### 修复
6
+
7
+ - **提问/审批提醒音依然不响**:0.3.4 改用 `sessionController.state()` 轮询,但漏了它的第二个参数
8
+ `AbortSignal`——宿主实现第一行就是 `signal.throwIfAborted()`,所以每次读取都抛 TypeError,又被
9
+ `catch {}` 吞掉,结果永远是「没有待回答」。现在传入 `AbortSignal.timeout(3000)`,并对读取失败记一条
10
+ warning(每次轮询最多一条),不再静默失败。
11
+ - 接线测试的 fake `state()` 现在强制要求 signal,防止同类遗漏再次悄悄回归。
12
+ - 单测保持 **120 全绿**。
13
+
14
+
3
15
  ## 0.3.4 — 2026-12-03
4
16
 
5
17
  ### 修复
@@ -271,6 +271,17 @@
271
271
  115 → **120 全绿**。
272
272
  - 未验证:真实 UI 上「提问时能听到 Ping、回答后停止」与真实 goal 结束那一声,需要重启宿主后实测。
273
273
 
274
+ ## 0.3.5 补上 state() 必需的 AbortSignal(2026-12-03)
275
+
276
+ - **现场**:0.3.4 装上后重启,提问时仍然没有声音。
277
+ - **根因**:`dsh-api-session-controller` 的 `state(request, signal)` 最终进入 `readState(sessionId, signal)`,
278
+ 第一行就是 `signal.throwIfAborted()`;0.3.4 的轮询只传了 `{ sessionId }`,于是每次读取都抛
279
+ `TypeError`,而 `catch {}` 把它当成「会话读不到」,`pending` 永远为假。
280
+ - **改法**:每次读取传 `AbortSignal.timeout(3_000)`;失败时记一条 warning(每次轮询最多一条),
281
+ 不再静默吞掉错误。接线测试的 fake `state()` 也改为对缺失 signal 抛错,锁死这个回归点。
282
+ - 自动化:120 项保持全绿。
283
+ - 未验证:真实提问时是否听到 Ping,需再次重启宿主后实测。
284
+
274
285
  ## 未验证(明确记录,不代替验证)
275
286
 
276
287
  | ID / 项 | 原因 | 何时可验 |
package/index.js CHANGED
@@ -245,18 +245,28 @@ export function start(ctx, rawConfig, deps = {}) {
245
245
  agents = []
246
246
  }
247
247
  let pending = false
248
+ let warned = false
248
249
  for (const agent of agents) {
249
250
  const session = agent?.session
250
251
  if (session === undefined || session === null) continue
251
252
  try {
252
- const state = await sessionController.state({ sessionId: session.id })
253
+ // The read cancels through this signal (`signal.throwIfAborted()` is the
254
+ // first statement of the Host implementation) — omitting it made every
255
+ // read throw, and the old catch swallowed that into "nothing pending".
256
+ const state = await sessionController.state({ sessionId: session.id }, AbortSignal.timeout(3_000))
253
257
  const input = Array.isArray(state?.pendingInput) ? state.pendingInput : []
254
258
  if (input.includes('question') || input.includes('approval') || input.includes('other')) {
255
259
  pending = true
256
260
  break
257
261
  }
258
- } catch {
259
- // A cold or disposed session answers nothing; keep looking at the rest.
262
+ } catch (error) {
263
+ // A cold or disposed session answers nothing; keep looking at the rest,
264
+ // but leave a trace so a systematic failure is not silent — once per
265
+ // poll, not once per session.
266
+ if (!warned) {
267
+ warned = true
268
+ log.warn(`stay-awake: pending-input read failed: ${describe(error)}`)
269
+ }
260
270
  }
261
271
  }
262
272
  setAttention(pending)
package/market/index.json CHANGED
@@ -51,8 +51,8 @@
51
51
  },
52
52
  "versions": [
53
53
  {
54
- "version": "0.3.4",
55
- "publishTimestamp": 1796366608,
54
+ "version": "0.3.5",
55
+ "publishTimestamp": 1796367207,
56
56
  "source": {
57
57
  "type": "npm"
58
58
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@laraveladmin/dsh-stay-awake",
3
- "version": "0.3.4",
3
+ "version": "0.3.5",
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",