Description
Command replacements configured in replacements.json are not being applied when generating TTS for Bash commands, resulting in incorrect pronunciation of commands like "gh", "uvx", etc.
Context
- Project Area: Core notification logic
- Complexity: 2/10 (Simple fix)
- User Impact: Commands are pronounced incorrectly in voice notifications
Current Behavior
When a Bash command like gh pr create is executed:
- The notification displays correctly
- The TTS says "gh" instead of "github CLI"
- Other configured replacements (uvx → "U V X", etc.) are also not applied
Technical Details
Affected File: src/ccnotify/notify.py
Root Cause: The apply_command_replacement() function exists (line 573) but is never called when processing Bash commands.
Location: Lines 762-885 in the PreToolUse handler for Bash commands
- Line 876:
audio_desc is generated for the command
- Line 885:
custom_tts is created using audio_desc
- Missing: Call to
apply_command_replacement() between these steps
Requirements
- Apply command replacements to the audio description before creating TTS message
- Ensure all command replacements from
replacements.json work correctly
- Maintain existing functionality for other notification types
Implementation Steps
Acceptance Criteria
Description
Command replacements configured in
replacements.jsonare not being applied when generating TTS for Bash commands, resulting in incorrect pronunciation of commands like "gh", "uvx", etc.Context
Current Behavior
When a Bash command like
gh pr createis executed:Technical Details
Affected File:
src/ccnotify/notify.pyRoot Cause: The
apply_command_replacement()function exists (line 573) but is never called when processing Bash commands.Location: Lines 762-885 in the PreToolUse handler for Bash commands
audio_descis generated for the commandcustom_ttsis created usingaudio_descapply_command_replacement()between these stepsRequirements
replacements.jsonwork correctlyImplementation Steps
apply_command_replacement(audio_desc, replacements)after line 876Acceptance Criteria