feat(voice): Add VOICE_STRICT_MODE for conditional voice notifications #324
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Adds
VOICE_STRICT_MODEenvironment variable to control voice notification behavior in the stop-hook-voice system. When enabled, voice notifications only trigger when an explicitCOMPLETEDmessage is detected in the assistant's response—eliminating unwanted "Completed task" fallback notifications.Problem
The current implementation falls back to speaking "Completed task" whenever no
COMPLETEDpattern is found in the response. This creates unwanted voice notifications for:Solution
Introduce
VOICE_STRICT_MODEenvironment variable with the following behavior:Changes
Code (
Packs/kai-voice-system/src/hooks/stop-hook-voice.ts)isStrictModeconstant readingVOICE_STRICT_MODEenv var (supportstrueand1)extractCompletion()return type fromstringtostring | nullnullinstead of fallback when strict mode enabled and no COMPLETED foundif (completion)guard inmain()to skip notification when nullDocumentation (
Packs/kai-hook-system/README.md)VOICE_STRICT_MODEto environment variables tableConfiguration
Enable in your environment or
$PAI_DIR/.env:Test Plan
Backward Compatibility
✅ Fully backward compatible - Existing behavior unchanged when VOICE_STRICT_MODE is unset or false.
🤖 Generated with https://claude.com/claude-code