fix(agents): sound scripts exit silently on error conditions#146
Closed
homich1991 wants to merge 13 commits intocodemie-ai:mainfrom
Closed
fix(agents): sound scripts exit silently on error conditions#146homich1991 wants to merge 13 commits intocodemie-ai:mainfrom
homich1991 wants to merge 13 commits intocodemie-ai:mainfrom
Conversation
Introduces the /codemie:sound-hooks-add plugin command that installs audio feedback for Claude Code hooks. The system plays random sounds on key events (SessionStart, UserPromptSubmit, PermissionRequest, Stop). Features: - Cross-platform audio player detection (afplay, aplay, paplay, mpg123) - Automatic hook directory creation (~/.claude/hooks/) - play-random-sound.sh script installation - settings.json configuration with hooks - Documentation with sound download resources Generated with AI Co-Authored-By: codemie-ai <codemie.ai@gmail.com>
- Move play-random-sound.sh from plugin scripts to shared addons directory - Remove sound-hooks-add.md command in favor of programmatic installation - Create sounds-installer.ts utility for automated hook setup - Add hook configuration logic to setup command - Update plugin README to reflect new installation method - Integrate sound hooks into main setup flow for better UX - Update SSO plugin tests to reflect new installation flow Breaking Change: sound-hooks-add command removed, now part of setup flow Generated with AI Co-Authored-By: codemie-ai <codemie.ai@gmail.com>
Security & Cross-platform: - Replace process.env.HOME with os.homedir() for Windows compatibility - Add Windows installation instructions (mpg123 via Chocolatey) - Fix misleading "Cross-platform" label on Linux-only command Error Handling: - Add logging to script path fallback catch block - Use createErrorContext() for all error logging (3 locations) - Add structured error metadata (operation, paths, etc.) Type Safety: - Replace 'any' type with ClaudeSettings interface - Add validation for settings.json structure (object vs array) - Log warnings for invalid settings structure Performance: - Use Promise.all() for parallel directory creation (4 dirs) Documentation: - Add JSDoc explaining UI exception in utils layer - Update error message to reference correct command (setup --sounds) Generated with AI Co-Authored-By: codemie-ai <codemie.ai@gmail.com>
Security & Cross-platform: - Replace process.env.HOME with os.homedir() for Windows compatibility - Add Windows installation instructions (mpg123 via Chocolatey) - Fix misleading "Cross-platform" label on Linux-only command Error Handling: - Add logging to script path fallback catch block - Use createErrorContext() for all error logging (3 locations) - Add structured error metadata (operation, paths, etc.) Type Safety: - Replace 'any' type with ClaudeSettings interface - Add validation for settings.json structure (object vs array) - Log warnings for invalid settings structure Performance: - Use Promise.all() for parallel directory creation (4 dirs) Documentation: - Add JSDoc explaining UI exception in utils layer - Update error message to reference correct command (setup --sounds) Generated with AI Co-Authored-By: codemie-ai <codemie.ai@gmail.com>
# Conflicts: # src/cli/commands/setup.ts
# Conflicts: # src/cli/commands/setup.ts
- Move sounds-installer from utils to agents/plugins/claude for better organization - Add play-random-sound.ps1 script for Windows compatibility - Relocate play-random-sound.sh to plugin/sounds directory - Add Windows-specific instructions in installation output and README - Update hooks configuration to support sound playback on multiple events - Enhance BaseAgentAdapter with sounds installation hooks Co-Authored-By: codemie-ai <codemie.ai@gmail.com>"
- Directory not found now exits with code 0 instead of error - No audio files found exits silently - No audio player found exits silently - Prevents unwanted error messages in CLI output when sounds are optional
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
Updates the Claude plugin sound scripts (bash and PowerShell) to exit
silently (with code 0) instead of displaying error messages when optional
conditions fail. This prevents unwanted error output in the CLI when
sound functionality is not available or configured.
Changes
play-random-sound.shandplay-random-sound.ps1toexit with code 0 instead of code 1 for all error conditions
Impact
Before: When sound directory doesn't exist or audio player is not
installed, users see error messages in CLI output even though sounds are
optional features.
After: Scripts exit gracefully without any error output, providing
cleaner CLI experience when sounds are not configured.
Checklist