Voice hook logs played lines as failed: it waits 10 s, but Pulse answers /notify only after playback ends

未关闭 适合新手
#2,985 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 5 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
78/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
bun, typescript

调研方向

阅读 hooks/handlers/VoiceNotification.ts 第 110 行附近,以及 LIFEOS/PULSE/VoiceServer/voice.ts 中 /notify 和等待播放的相关部分。先比较客户端超时时间与正常播放所需的时间;issue 报告称,40 秒超时是有效的临时解决办法。当已播放的行被记录为已发送,而不是因超时而失败时,工作即告完成;issue 没有指定要运行的测试。

由索引模型根据 Issue 内容生成。

描述

Version

LifeOS 8.761.0 · attestation: not run

What is broken

The voice hook waits 10 s for Pulse's /notify answer on a normal (non-interruptible) line. Pulse answers only after the line has finished playing: /notify awaits sendNotification, which awaits playback for a non-interruptible clip. A closing line takes Fish generation plus its playing time, usually over 10 s, so the hook aborts and logs the line as failed ("The operation timed out") although it played.

On one install, joining the hook's voice-events.jsonl with Pulse's played records: 383 of the 392 rows logged as timed out have a matching played record; median time from request to end of playback 12.9 s, longest 33 s. The log reports a voice outage that is not there. The comment at :108 sizes the wait for a server that answers in about a second.

Where (file:line)

hooks/handlers/VoiceNotification.ts:110 · LIFEOS/PULSE/VoiceServer/voice.ts:980 (/notify awaits sendNotification), :778-780 (non-interruptible playback awaited)

Repro on a clean tree
# Any 8.761.0 install with Pulse voice on (not platform-specific).
# 1. Static: the probe prints the client wait and the server lines that hold the /notify answer until
#    playback ends. It reads two release files and writes nothing.
cat > probe.js <<'EOF'
const { join } = await import("node:path");
const read = (p) => Bun.file(join(process.cwd(), "skills/LifeOS/install", p)).text();
const hook = await read("hooks/handlers/VoiceNotification.ts"), srv = await read("LIFEOS/PULSE/VoiceServer/voice.ts");
const at = (src, re) => { const L = src.split(String.fromCharCode(10)); const i = L.findIndex((l) => re.test(l)); return "  :" + (i + 1) + "  " + L[i].trim(); };
console.log("hooks/handlers/VoiceNotification.ts (client)");
console.log(at(hook, /AbortSignal\.timeout\(/));
console.log("LIFEOS/PULSE/VoiceServer/voice.ts (/notify)");
console.log(at(srv, /pathname === "\/notify"\)/));
console.log(at(srv, /const result = await sendNotification\(/));
console.log(at(srv, /const played = enqueuePlayback/));
console.log(at(srv, /else await played/));
const ms = Number(hook.match(/interruptible \? \d+ : (\d+)/)[1]);
const afterPlayback = /else await played/.test(srv);
console.log("normal line: client gives up after " + ms + " ms; server answers " + (afterPlayback ? "only after playback ends" : "before playback"));
process.exit(afterPlayback ? 1 : 0);
EOF
bun -e "$(cat probe.js)"   # exit 1
# 2. Live: let a session end with a closing line of normal length (spoken for more than ~9 s), then:
tail -n 3 LIFEOS/MEMORY/VOICE/voice-events.jsonl
#    -> event_type "failed", error "The operation timed out." for a line Pulse played to the end.
Negative control

Probe: bun -e 'const { join } = await import("node:path"); const read = (p) => Bun.file(join(process.cwd(), "skills/LifeOS/install", p)).text(); const hook = await read("hooks/handlers/VoiceNotification.ts"), srv = await read("LIFEOS/PULSE/VoiceServer/voice.ts"); const at = (src, re) => { const L = src.split(String.fromCharCode(10)); const i = L.findIndex((l) => re.test(l)); return " :" + (i + 1) + " " + L[i].trim(); }; console.log("hooks/handlers/VoiceNotification.ts (client)"); console.log(at(hook, /AbortSignal\.timeout\(/)); console.log("LIFEOS/PULSE/VoiceServer/voice.ts (/notify)"); console.log(at(srv, /pathname === "\/notify"\)/)); console.log(at(srv, /const result = await sendNotification\(/)); console.log(at(srv, /const played = enqueuePlayback/)); console.log(at(srv, /else await played/)); const ms = Number(hook.match(/interruptible \? \d+ : (\d+)/)[1]); const afterPlayback = /else await played/.test(srv); console.log("normal line: client gives up after " + ms + " ms; server answers " + (afterPlayback ? "only after playback ends" : "before playback")); process.exit(afterPlayback ? 1 : 0);' · exit 1 · captured 2026-11-27T01:34:03.149Z

Red looks like: client gives up after 10000 ms; server answers only after playback ends

hooks/handlers/VoiceNotification.ts (client)
  :110  signal: AbortSignal.timeout(payload.interruptible ? 20000 : 10000),
LIFEOS/PULSE/VoiceServer/voice.ts (/notify)
  :964  if (pathname === "/notify") {
  :980  const result = await sendNotification(title, message, voiceEnabled, voiceId, volume, false, data.interruptible === true)
  :778  const played = enqueuePlayback(() => playAudio(fishAudio, callerVolume ?? fishEntry.volume ?? FALLBACK_VOLUME, "mp3", { interruptible, bypassMute }), gen)
  :780  else await played
normal line: client gives up after 10000 ms; server answers only after playback ends
Suggested fix

Applied on one install: raise the normal-line wait at VoiceNotification.ts:110 from 10000 to 40000 ms (interruptible clips keep 20000). The hook runs async, so nothing waits on it; its process lives up to 40 s. Since the change, lines that played log sent, including ones that took up to 19 s from request to end of playback. A line longer than 40 s would still log as failed.

The fuller fix, not tried here: have /notify answer once the clip is generated and queued, as it already does for interruptible clips, and report playback failures some other way.

Environment
  • OS: Windows (x64)
  • Harness: claude-code
  • bun: 1.4.2 · git: 2.56.1.
  • Doctor broken: none
主要语言
TypeScript
星标
20k
派生
2.5k
PR 合并指标
30 天内没有已合并 PR

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

danielmiessler/LifeOS 的其他 Issue

查看 danielmiessler/LifeOS 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。