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

Đang mở Phù hợp với người mới
#2,985 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 5 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
78/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
bun, typescript
Lĩnh vực
backend, observability

Hướng nghiên cứu

Đọc hooks/handlers/VoiceNotification.ts quanh dòng 110 và LIFEOS/PULSE/VoiceServer/voice.ts ở phần /notify và phát lại được chờ hoàn tất. Bắt đầu bằng cách so sánh thời gian chờ của client với thời lượng phát lại bình thường; issue báo cáo rằng thời gian chờ 40 giây là một biện pháp khắc phục tạm thời có hiệu quả. Công việc hoàn tất khi các dòng đã phát được ghi nhận là đã gửi thay vì thất bại do hết thời gian chờ; issue không nêu bài kiểm thử nào cần chạy.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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
Ngôn ngữ chính
TypeScript
Star
20k
Fork
2.5k
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của danielmiessler/LifeOS

Tất cả issue của danielmiessler/LifeOS

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.