Skip to content

feat(voice): answering cuts the announcement short (0.39.0) - #50

Merged
DowLucas merged 1 commit into
mainfrom
feat/voice-cut-answered
Nov 10, 2026
Merged

DowLucas merged 1 commit into
mainfrom
feat/voice-cut-answered

Conversation

@DowLucas

@DowLucas DowLucas commented Nov 10, 2026 •

Copy link
Copy Markdown
Owner

When a permission prompt or question is answered while its announcement is still being spoken, the announcement now stops instead of playing to the end.

  • _ds_voice_speak_announcement speaks in a background job in its own process group (set -m) and polls the markers it is about every 0.2 s (the approved-Bash-command ps check once a second). Once none still carries the eventId it was armed with, it signals the group and every pid in the tree (GNU timeout around the player makes its own group).
  • Only the settled prompt's speech is cut: a batch sentence stops once all its sessions are answered; auto voice and explanations are untouched.
  • Speech gets TMPDIR=voice/ann/<timer-pid>, pruned when that pid is dead, so a cut leaves no WAV behind.
  • Log line: answered: announcement cut short.

Tests: two new cases in tests/voice/run.sh (cut on answer; another session's answer does not cut). Voice suite 183/183 with flock and DS_VOICE_NO_FLOCK=1; queue and hooks-consistency pass.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Permission and question announcements now stop speaking once the relevant prompt is answered. For announcements covering multiple sessions, playback continues until all included prompts are answered. Approved Bash commands count as answered when they start running.
  • Documentation
    • Added details about the announcement playback behavior.

An announcement still being spoken when its permission prompt or question
is answered now stops instead of playing to the end. The announcer speaks
in its own process group, watches the markers it is about, and kills the
speech tree once none still waits. Speech gets its own TMPDIR so a cut
leaves no WAV behind.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Prompt announcements now stop when their associated prompts are no longer waiting. The voice library monitors event markers and terminates speech processes. Tests cover same-session and other-session completions. Plugin version declarations advance to 0.39.0.

Changes: Prompt Announcement Interruption

Layer / File(s) Summary
Announcement monitoring and release update
scripts/voice/lib.sh, tests/voice/run.sh, CLAUDE.md, CHANGELOG.md, .claude-plugin/marketplace.json, .claude-plugin/plugin.json
Batch and individual announcements pass marker paths and event IDs to a monitoring helper. The helper checks whether prompts remain waiting and, when none do, terminates the speech process group and descendants. It removes temporary audio and falls back to unmonitored speech if temporary-directory creation fails. Tests cover same-session and other-session completions. Documentation describes the behavior, and plugin version declarations change to 0.39.0.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant Announcement as _ds_voice_speak_announcement
  participant Markers as Event marker files
  participant Speech as Speech process tree
  Announcement->>Speech: Start announcement speech
  loop While associated prompts are waiting
    Announcement->>Markers: Check marker event IDs
    Markers-->>Announcement: Current marker state
  end
  Announcement->>Speech: Terminate process group and descendants
Loading
Merge Risk: Minimal · up to 55274

The announcement change is mergeable after normal checks. Uncommon process-lifecycle edge cases can be addressed separately.

Pre-merge checks: Passed 5

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly summarizes the main change: announcements stop when their prompts or questions are answered.
Docstring Coverage Passed Docstring coverage is 80.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentati…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 80.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 5 functions across 2 files. (4 skipped: 4 unsupported.)

Finishing Touches

Generate docstrings

  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c7f358e9-f038-413d-a668-d76c6c85761b
Commits

Reviewing files that changed from the base of the PR and between 8f1934d and 55274a7.

Files selected for processing: 6

  • .claude-plugin/marketplace.json
  • .claude-plugin/plugin.json
  • CHANGELOG.md
  • CLAUDE.md
  • scripts/voice/lib.sh
  • tests/voice/run.sh

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@DowLucas
DowLucas merged commit cec136a into main Nov 10, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant