The instrumental review UI was built but never integrated into the
local CLI (karaoke-gen) workflow. This fix:
1. Adds run_instrumental_review() function to gen_cli.py that:
- Analyzes backing vocals using AudioAnalyzer
- Generates waveform visualization
- Starts InstrumentalReviewServer and opens browser
- Returns the user's selected instrumental file path
2. Integrates the review into the finalization loop:
- Runs before KaraokeFinalise for each track
- Passes selected_instrumental_file to KaraokeFinalise
- Skips review if --skip_instrumental_review flag is set
3. Adds --skip_instrumental_review CLI flag for backwards compatibility
4. Adds comprehensive tests in test_cli_feature_parity.py that verify:
- gen_cli.py has run_instrumental_review function
- The function uses AudioAnalyzer, WaveformGenerator, and InstrumentalReviewServer
- The --skip_instrumental_review flag works correctly
These tests would have caught this integration gap and will prevent
similar regressions in the future.
Version bump: 0.71.40 → 0.71.41
CodeRabbit fixes:
- Chain exceptions with 'from e' in jobs.py for proper tracebacks
- Use logger.exception() for automatic stack traces
- Add end_seconds validation warning in audio_editing_service.py
- Handle recommended_selection='with_backing' explicitly in frontend
- Sync audio player state with actual audio element via event listeners
- Fix muted duration stats overcounting by clamping to audio duration
- Add num_points validation (1-10000) in server waveform endpoint
- Improve exception handling in server endpoints
Test coverage improvements:
- Add comprehensive tests for InstrumentalReviewServer
- Test request/response models
- Test server initialization and configuration
- Test FastAPI endpoints with TestClient
- Coverage: karaoke_gen 73.05% (above 70% minimum)
Version bump: 0.71.39 → 0.71.40
- Replace http.server with FastAPI for better async/CORS support
- Add complete standalone HTML/CSS/JS frontend with all features:
- Dark theme matching React frontend
- Interactive waveform display with Canvas rendering
- Audio playback with source selection
- Region selection via click/drag or quick-add from segments
- Custom instrumental creation
- Final selection submission with success feedback
- API endpoints now match cloud backend for true feature parity
- Update CLI parity tests for new FastAPI-based server structure
- Add test-instrumental-review.py script for local testing
This enables the same user experience for instrumental review
whether running locally (karaoke-gen) or remotely (karaoke-gen-remote).
Version bump: 0.71.38 → 0.71.39
Adds a comprehensive instrumental selection workflow with:
- Audio analysis to detect backing vocals (>-40dB threshold)
- Waveform visualization with segment highlighting
- Interactive web UI for audio playback and region selection
- Custom instrumental creation by muting selected regions
- Smart recommendations based on analysis results
- Feature parity between local (karaoke-gen) and remote (karaoke-gen-remote) CLIs
Key components:
- Shared core module (karaoke_gen/instrumental_review/) with AudioAnalyzer,
AudioEditor, WaveformGenerator, and InstrumentalReviewServer
- Backend services wrapping core module with GCS integration
- New API endpoints for analysis, audio streaming, and custom creation
- React frontend components for waveform display, audio playback, region selection
- Local HTTP server for browser-based review in local CLI workflow
- 1280 tests passing with comprehensive coverage
Closes the need for manual Audacity editing when selecting instrumentals.
Add comprehensive tests for:
- style_loader.py - new test file covering all loading, saving, and helper functions
- file_handler.py - tests for download_video, extract_metadata_from_url, backup_existing_outputs
- remote executor - tests for run_pipeline, _submit_job, _monitor_job
This brings test coverage above the required 70% CI threshold.
Add --existing_instrumental parameter to remote CLI to allow users to upload
and use their own pre-made instrumental file instead of AI-separated audio.
Key changes:
- remote_cli.py: Add existing_instrumental parameter to submit_job()
- file_upload.py: Add existing_instrumental file type with duration validation (±0.5s)
- job.py: Add existing_instrumental_gcs_path field to Job and JobCreate models
- video_worker.py: Download and use user-provided instrumental for final video encoding
Backend still runs AI separation for stems (to provide consistent download outputs),
but uses the user-provided instrumental for the final karaoke video.
Includes 20+ unit tests and maintains >70% coverage.
The remote CLI was hitting Cloud Run's 32MB request body limit when
uploading large FLAC files with 4K PNG style assets. This implements
a two-step signed URL upload flow that bypasses the limit entirely:
1. CLI calls POST /api/jobs/create-with-upload-urls with job metadata
2. Backend returns signed GCS upload URLs for each file
3. CLI uploads files directly to GCS (no size limit)
4. CLI calls POST /api/jobs/{job_id}/uploads-complete to start processing
Benefits:
- No file size limits (GCS supports up to 5TB)
- Faster uploads (direct to storage, no proxy)
- Works with any HTTP client (no HTTP/2 required)
- Future-proof for web UI uploads
Changes:
- backend/services/storage_service.py: Add generate_signed_upload_url()
- backend/api/routes/file_upload.py: Add two new endpoints + models
- karaoke_gen/utils/remote_cli.py: Refactor submit_job() for signed URLs
- Add 21 new tests for the signed URL upload flow
- Bump version to 0.71.25
Also includes: Download spaCy model at Docker build time (not runtime)
- Fix Discord webhook URL validation to strip trailing whitespace/newlines
that can be introduced from environment variables or secrets (fixes %0A error)
- Make Discord notification failures non-fatal - log error and continue
- Add --retry CLI command to retry failed jobs from last checkpoint
- Add POST /api/jobs/{job_id}/retry endpoint for retrying failed jobs
- Bump version to 0.71.17
The root cause was environment variables or secrets containing trailing
newline characters (\n) which get URL-encoded as %0A, breaking Discord
API authentication.
Update remaining test cases to include the new bulk_delete,
filter_environment, filter_client_id, environment, and client_id
mock attributes needed for the job tracking feature.
Bump version to 0.71.2.
New job management commands for karaoke-gen-remote:
- --list / --list-jobs: List all jobs with ID, status, artist, and title
- --cancel <job_id>: Cancel a running job (stops processing, keeps record)
- --delete <job_id>: Permanently delete a job and all its files
Usage:
karaoke-gen-remote --list
karaoke-gen-remote --cancel abc12345
karaoke-gen-remote --delete abc12345 [-y]
The delete command prompts for confirmation unless -y flag is passed.
Bump version to 0.70.36
- Change DEFAULT_DISCORD_WEBHOOK_URL to use discord-releases-webhook instead
of discord-alert-webhook (alerts channel was for errors, not releases)
- Created discord-releases-webhook secret in GCP with correct webhook URL
- Add better error handling for YouTube thumbnail upload:
- Check if file exists before attempting upload
- Catch and log exceptions instead of failing silently
- Warn user if thumbnail upload fails but video succeeded
- Update tests to mock os.path.isfile for thumbnail upload tests
- Bump version to 0.70.34
- Enable YouTube upload when pre-stored credentials are provided (server-side mode)
Previously, youtube_upload_enabled was only set when youtube_client_secrets_file was
provided. Now also enables when user_youtube_credentials is provided.
- Move Discord notification outside YouTube upload block so it runs independently
Previously Discord notification was nested inside the youtube_upload_enabled condition,
meaning it would never run if YouTube wasn't enabled.
- Discord notification only posts when there's a YouTube URL (as requested)
- Add non_interactive check when YouTube upload fails to avoid hanging in server mode
- Update test to explicitly set non_interactive=False for interactive failure case
- Bump version to 0.70.32
- Add comprehensive tests for DropboxService methods (upload, shared links)
- Add comprehensive tests for GoogleDriveService methods (folder ops, uploads)
- Add tests for video worker native distribution handling
- Add tests for RemoteExecutor session and job status methods
- Add tests for PipelineContext cleanup and logging methods
- Fix test imports and mock paths
- Version bump to 0.70.23
Coverage now at 70.88% for karaoke_gen (required: 70%)
- Add unit tests for DropboxService (brand code calculation, configuration)
- Add unit tests for GoogleDriveService (configuration, singleton pattern)
- Add tests for Job model distribution fields (dropbox_path, gdrive_folder_id)
- Add tests for file upload endpoint distribution parameters
- Add pipeline tests for base classes, context, stages, and executors
- Add remote CLI tests for distribution parameter handling
- Version bump to 0.70.22