feat: AI providers + crash reporter + media pause + CI#62
Conversation
- Upgrade whisper-rs 0.14.3 → 0.15.1 (ARM64 improvements, Windows fixes) - Disable Vulkan GPU on Windows ARM64 (unstable on Qualcomm Snapdragon) - Limit threads to 4 on ARM64 big.LITTLE (perf cores only) - Fix PTT race condition with swap() debounce for duplicate key releases - Update whisper-rs API usage for v0.15.1 segment iteration Fixes crashes reported by Windows ARM64 trial user.
P1-A: AI Formatting Language-Aware - Add language parameter to build_enhancement_prompt() - Add ISO 639-1 language code to name mapping (70+ languages) - Pass user's selected language from settings to AI enhancement - Prompt now outputs in user's selected language instead of forcing English - Update all providers (OpenAI, Gemini, Groq) to pass language - Add comprehensive tests for language-aware prompts P1-B: Stale Microphone Selection Fix - Add validate_microphone_selection command to backend - Checks if stored microphone still exists on device list - Auto-resets to default if stored mic is unavailable - Frontend calls validation on MicrophoneSelection mount - Fixes Windows issue where disconnected mics stayed selected - Shows toast notification when stale mic is reset
…mini) P2-A: Major Providers UI - Add new provider types and configuration (src/types/providers.ts) - Create ProviderCard component with API key management and model dropdown - Redesign EnhancementsSection with provider cards instead of model cards - Support OpenAI (gpt-5-nano, gpt-5-mini, gpt-4o-mini) - Support Anthropic (claude-haiku-4-5, claude-sonnet-4-5) - Support Google Gemini (gemini-2.0-flash, gemini-2.5-flash-lite, gemini-3-flash) - Keep Custom Provider option for OpenAI-compatible endpoints Backend changes: - Add Anthropic provider (src-tauri/src/ai/anthropic.rs) - Register anthropic in AIProviderFactory - Add anthropic to ALLOWED_PROVIDERS - Expand Gemini supported models Tests: - Update EnhancementsSection tests for new provider-based UI - All 139 tests pass
P2-C: Indicator Offset Setting - Add pill_indicator_offset setting (10-100px, default 10) - Backend: Update Settings struct, get/save, window positioning - Frontend: Add slider in General Settings (Edge Offset) - Reposition pill window when offset changes - Update tests with new setting field All 139 frontend tests + 171 backend tests pass
- Remove gpt-4o-mini from OpenAI models - Move Custom Provider into the same AI Providers list - ProviderCard now handles custom providers (Configure button vs Add Key) - Track custom provider config separately from standard providers - Show configured model name for custom providers All 139 tests pass
Major changes: - Add list_provider_models command to fetch models from OpenAI/Anthropic/Gemini APIs - Remove Groq provider entirely (no longer supported) - Models are fetched on demand when user opens dropdown (no auto-fetch) - Add refresh button in model dropdown to re-fetch models - Show ⭐ star icon for recommended models - Remove all hardcoded model lists from frontend UI improvements: - Replace native range input with shadcn Slider component - Change max offset from 100px to 50px - Add named constants for offset values (MIN=10, MAX=50, DEFAULT=10) Backend: - Add ProviderModel struct with id, name, recommended fields - Add is_recommended_model() logic for each provider - Add model_id_to_display_name() for nice model names - Export offset constants from settings module Frontend: - Create useProviderModels and useAllProviderModels hooks - Update ProviderCard to accept models, loading, error props - Update EnhancementsSection to use dynamic model fetching Tests: - Update all test fixtures for new API - Mock list_provider_models command - All 139 frontend + 172 backend tests passing
- Test initial empty state - Test successful model fetching - Test error handling - Test loading state transitions - Test clearModels functionality - Test custom provider skip behavior - Test useAllProviderModels multi-provider management - Test per-provider loading/error tracking Total: 151 frontend tests passing
- Fix Slider component _values fallback from [min, max] to [min] - This prevents creating a range slider when value is briefly undefined - Fix test file TypeScript errors (unused args parameter)
- Replace API-fetched model lists with curated static lists for faster load - OpenAI: gpt-5-nano, gpt-5-mini with reasoning_effort: minimal - Anthropic: claude-haiku-4-5-latest, claude-sonnet-4-5-latest (thinking disabled) - Gemini: gemini-3-flash-preview, gemini-2.5-flash, gemini-2.5-flash-lite - Add thinkingLevel/thinkingBudget config for Gemini models - Fix pill offset change detection (read before set) - Fix custom provider validation (map 'custom' to 'openai' for backend) - Update provider list from groq to anthropic - Add model ID fallback display in ProviderCard - Pre-fetch models for providers with API keys on settings load
- Add media-remote crate for macOS (uses Perl adapter for macOS 15.4+) - Add Windows media key simulation for Windows support - Create MediaPauseController with explicit pause/play (not toggle) - Detect if media is playing before pausing (macOS) - Only resume if we paused it (prevents accidental playback) - Add pause_media_during_recording setting (default: false) - Add UI toggle in Settings > General - Works with Spotify, Apple Music, YouTube, etc.
- Upgrade windows crate from 0.51 to 0.62 - Add Media_Control and Foundation features for WinRT APIs - Replace key simulation toggle with proper GSMTC APIs: - Detect actual playback status before pausing - Use explicit TryPauseAsync/TryPlayAsync (no toggle) - Only pause if media is actually playing - Only resume if we paused it - Fix HWND breaking change: isize -> *mut c_void - Use .join() for blocking async operations per docs - Add 4 new tests for media controller behavior - Requires Windows 10 1809+ for GSMTC APIs This fixes the issue where pause media during recording could accidentally start paused media on Windows. Note: Windows build to be verified via CI/CD pipeline.
CI workflow (.github/workflows/ci.yml): - Frontend: lint, typecheck, tests on Ubuntu - Backend macOS: cargo test + clippy on macos-14 - Backend Windows: cargo check + test with Vulkan SDK - Build check: smoke test Tauri build on macOS Release workflow (.github/workflows/release.yml): - Triggered on push to 'release' branch or manual dispatch - Parallel builds: macOS aarch64, macOS x86_64, Windows x64 - macOS: Apple code signing + notarization via Tauri - Windows: Vulkan SDK for GPU acceleration - Stages artifacts to flat directory for reliable download - Auto-generates latest.json for Tauri updater - Creates draft GitHub release with all artifacts Required secrets: - APPLE_CERTIFICATE, APPLE_CERTIFICATE_PASSWORD - APPLE_SIGNING_IDENTITY, APPLE_ID, APPLE_PASSWORD, APPLE_TEAM_ID - TAURI_SIGNING_PRIVATE_KEY, TAURI_SIGNING_PRIVATE_KEY_PASSWORD
Users expect media to pause during recording by default. Changed default from false to true in: - Backend settings default - Frontend fallback value - Audio command fallback - Test fixtures
When an error is caught by ErrorBoundary, users can now report bugs: - CrashReportDialog shows error details, stack trace, and system info - 'Report Bug' button opens pre-filled GitHub issue in browser - Collects: app version, OS, architecture, current model, timestamp - 'Copy Details' button for manual reporting - No authentication required - uses URL parameters Files added: - src/utils/crashReport.ts - data gathering and GitHub URL generation - src/components/CrashReportDialog.tsx - dialog UI component Modified: - src/components/ErrorBoundary.tsx - integrated crash reporter
Pull Request Review: feat: AI providers + crash reporter + media pause + CIThis is a comprehensive PR bringing multiple significant features to VoiceTypr. Overall, the code quality is high with good attention to detail. Strengths1. CI/CD Workflows
2. AI Provider Implementation
3. Media Pause Controller
4. Crash Reporter
5. Frontend Changes
Potential IssuesSecurity (Medium Priority)
Performance (Low Priority)
Test Coverage
Code Quality
Security AssessmentNo critical security issues found
Final RecommendationsBefore Merge:
Post-Merge:
SummaryThis PR demonstrates excellent engineering practices with comprehensive features, strong security, good test coverage, and production-ready CI/CD. Minor issues identified are low-priority and don't block merging. Verdict: APPROVED with minor recommendationsGreat work! The media pause feature is particularly impressive with its layered fallback strategy. Review by Claude Code based on CLAUDE.md guidelines |
- Remove dtolnay/rust-toolchain@stable from CI (use preinstalled Rust) - Add scripts/ci-local-macos.sh for local macOS CI validation - Add scripts/ci-local-windows.ps1 for local Windows CI validation - Add pnpm ci:mac / ci:win / ci:win:full scripts
Code Review - PR #62This is a substantial PR bringing together multiple features. Overall, the code quality is good, but there are several areas that need attention before merging. 🟢 Strengths1. CI/CD Implementation
2. Media Controller (Windows + macOS)
3. AI Provider Refactoring
4. Crash Reporter
5. Test Coverage
🟡 Issues Requiring Attention1. Security ConcernsCritical: Secrets in Workflows (
|
Code Review: AI Providers + Crash Reporter + Media Pause + CIOverall, this is a well-structured, high-quality pull request with excellent test coverage. Here's my comprehensive feedback: Strengths
Areas for Improvement1. Media Controller Race ConditionsLocation: src-tauri/src/media/controller.rs:208 2. Windows Timeline SleepLocation: src-tauri/src/media/controller.rs:556 3. Crash Reporter PrivacyLocation: src/utils/crashReport.ts:26 4. Retry LogicLocation: src-tauri/src/ai/anthropic.rs:56-57 5. Missing ImportLocation: src-tauri/src/media/controller.rs:167 6. Provider Card Race ConditionLocation: src/components/ProviderCard.tsx:52-56 7. Test Coverage Gaps
Performance Considerations
Potential BugsmacOS Resume Check (controller.rs:401-407): Flag cleared before osascript check, could prevent subsequent resumes. Impact: Minor edge case. Security AuditNo critical issues found. Minor recommendations:
Overall AssessmentGrade: A- Well-engineered PR demonstrating strong craftsmanship. Issues are mostly minor edge cases. Code is production-ready with minor revisions needed. Recommendation: Approve with minor revisions (device ID privacy and Windows Mutex import minimum) Great work! Review by Claude Code (claude-sonnet-4-5) |
- Remove redundant backend-macos, backend-windows, build-check jobs - Add full build jobs for macOS and Windows with all dependencies - All jobs run in parallel (faster CI) - Both build jobs include: Node.js, pnpm, FFmpeg sidecar, cargo test, release build
PR #62 Code Review - Comprehensive AnalysisThanks for this substantial PR! I've completed a thorough review of the AI providers, crash reporter, media pause/resume, and CI/Release workflows. Overall, this is solid engineering work with good architecture, but there are critical issues that must be addressed before merging. 🔴 Critical Issues (Must Fix Before Merge)1. Missing Mutex Import (Compilation Blocker)File: The Windows implementation uses Fix needed at top of file: use std::sync::Mutex;Affected lines: 167, 181, 237-239, 603-605, 612-613 2. API Key Validation Missing for Non-OpenAI ProvidersFile: The Current behavior: if provider == "openai" {
// ... validation code
} else {
return Err("Unsupported provider".to_string()); // Line 283
}Recommendation: Implement lightweight validation for Anthropic (GET 3. Regex Validation BugFile: The regex assert!(validate_provider_name("test-provider").is_err()); // This will fail!Fix: Either update regex to exclude hyphens OR fix the test expectation. 🟡 High Priority Issues4. API Key Security - Plain-text Memory StorageFile: static API_KEY_CACHE: Lazy<Mutex<HashMap<String, String>>> =
Lazy::new(|| Mutex::new(HashMap::new()));Issues:
Recommendations:
5. Stack Trace Privacy Leak in Crash ReporterFile: Stack traces are included in public GitHub issues without sanitization, potentially exposing:
Recommendation: Sanitize stack traces before URL generation: function sanitizeStackTrace(stack?: string): string {
return stack?.replace(/\/Users\/[^/]+\//g, '/users/.../')
.replace(/C:\\Users\\[^\\]+\\/g, 'C:\\Users\\...\\') || '';
}6. Missing componentStack in ErrorBoundaryFile: ErrorBoundary receives Fix: onError={(error, errorInfo) => {
console.error('Error caught by boundary:', error, errorInfo);
if (onError) {
onError(error, errorInfo.componentStack); // Pass componentStack
}
}}🟢 Code Quality ObservationsAI Provider ImplementationStrengths:
Issues:
Crash Reporter ImplementationStrengths:
Issues:
Media Pause/Resume ImplementationStrengths:
Issues:
CI/Release WorkflowsStrengths:
Issues:
📊 Test Coverage Summary
Recommendation: Add tests for crash reporter utilities before merge. 🔧 Recommendations by PriorityPriority 1 - Must Fix Before Merge
Priority 2 - Should Fix Soon
Priority 3 - Nice to Have
📈 Overall AssessmentScore: 7.2/10 This PR demonstrates solid architectural thinking with mature error handling and good separation of concerns. The multi-provider AI system is well-designed, the crash reporter provides excellent UX, and the media pause/resume shows sophisticated platform-specific handling. However, the missing Mutex import is a compilation blocker that must be fixed immediately. Additional high-priority security concerns around API key validation and stack trace sanitization should be addressed before merge. Recommendation: Request changes for Priority 1 items, then approve once fixed. Priority 2-3 can be follow-up PRs. 📚 Detailed Analysis AvailableI've conducted in-depth analysis of each component. Key findings:
Happy to discuss any findings or provide more detail on specific areas! |
|
PR Review: AI Providers + Crash Reporter + Media Pause + CI This is a substantial branch rollup PR with 4,215 additions across 77 files. Overall code quality is good with comprehensive testing. STRENGTHS:
CRITICAL SECURITY ISSUE: CODE QUALITY ISSUES:
TEST COVERAGE GAPS:
PERFORMANCE:
RECOMMENDATIONS: VERDICT: Approve with suggestions Great work on this refactor! The media pause feature is particularly well-implemented with thoughtful fallback strategies. |
Pull Request Review: AI Providers + Crash Reporter + Media Pause + CIThis is a substantial PR bringing multiple features together. Overall quality is good with comprehensive testing. Here's my detailed feedback: 🎯 StrengthsCI/CD Implementation
Code Quality
Architecture
|
Pull Request Review: AI Providers + Crash Reporter + Media Pause + CII've completed a comprehensive review of this large PR (4,241 additions, 990 deletions across 77 files). Here's my detailed feedback: ✅ Strengths1. AI Provider Implementation
2. Crash Reporter
3. Media Control
4. CI/CD Workflows
|
- Decouple custom and openai API key cache entries (no more custom->openai remap) - Store custom endpoint config under dedicated keys (ai_custom_base_url, ai_custom_no_auth) - Frontend uses provider 'custom' instead of aliasing to 'openai' in UI state - Key removal only clears active selection when the removed provider matches active - Backend readiness fallback for custom/openai no-auth configs without keyring keys - Legacy config migration support for existing openai-compatible setups - Add regression tests for cache isolation, no-auth toggle, and cross-provider removal
…rding errors - Bump pnpm from 9 to 10.13.1 in CI and release workflows - Set CARGO_TARGET_DIR=t on Windows release builds to avoid path length limits - Make Windows updater signature required (remove silent fallback) - Refactor AI providers (anthropic, gemini, openai) to create HTTP client per-request instead of storing on struct - Add resume_media_on_error handling: if media was paused before recording and start_recording fails at any point, resume media before returning
Code Review: PR #62 - AI Providers + Crash Reporter + Media Pause + CISummaryThis is a substantial and well-executed PR that brings together multiple high-value features with solid implementation. Overall quality is excellent with good architecture, comprehensive testing, and attention to cross-platform concerns. ✅ Strengths1. AI Provider Architecture
2. Media Pause Controller
3. Crash Reporter
4. CI/CD Workflows
5. Testing
|
Summary
This PR is a branch rollup that brings multiple features/fixes onto
main:What changed (high level)
AI providers / Enhancements UI
src-tauri/src/ai/*andsrc-tauri/src/commands/ai.rs.src/components/ProviderCard.tsx, updates toEnhancementsSection.tsx).useProviderModelshook + tests (src/hooks/useProviderModels.ts,src/hooks/useProviderModels.test.ts) and related types (src/types/providers.ts).Crash reporter
CrashReportDialogUI (src/components/CrashReportDialog.tsx) plus supporting utilities (src/utils/crashReport.ts).src/components/ErrorBoundary.tsx) so crashes surface actionable reporting UX.Media pause/resume during recording (default ON)
src-tauri/src/media/*).CI / Release
.github/workflows/ci.yml.github/workflows/release.ymlMisc
scripts/ensure-ffmpeg-sidecar.cjs).cargo clippy -- -D warningsgreen.Validation
pnpm lint,pnpm typecheck,pnpm testcargo test,cargo clippy -- -D warnings