feat(voice): Add VOICE_STRICT_MODE for conditional voice notifications#324
Closed
sti0 wants to merge 1 commit into
Closed
feat(voice): Add VOICE_STRICT_MODE for conditional voice notifications#324sti0 wants to merge 1 commit into
sti0 wants to merge 1 commit into
Conversation
…found Add environment variable to control voice notification behavior: - When unset/false: Current behavior (fallback to "Completed task") - When true/1: Skip voice notification silently if no COMPLETED found Changes: - Add isStrictMode constant checking VOICE_STRICT_MODE env var - Change extractCompletion() return type to string | null - Add null guard in main() to skip notification when completion is null - Document VOICE_STRICT_MODE in kai-voice-system README - Bump kai-voice-system version to 1.4.0 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
sti0
force-pushed
the
feature/voice-strict-mode
branch
from
January 6, 2026 09:38
8a07ea8 to
8a06bcb
Compare
Owner
|
Thank you @sti0 for the VOICE_STRICT_MODE concept! 🙏 Your voice system contributions have been fantastic. PAI v2.1 restructured everything ( See the release: https://github.com/danielmiessler/PAI/releases/tag/v2.1.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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