Skip to content

Intel changes - #51

Merged
altic-dev merged 5 commits into
mainfrom
intel-changes
Dec 15, 2025
Merged

altic-dev merged 5 commits into
mainfrom
intel-changes

Conversation

@altic-dev

@altic-dev altic-dev commented Dec 15, 2025 •

Copy link
Copy Markdown
Owner
Add Intel (x86_64) architecture support for universal binary
- Changed ARCHS from arm64-only to
- Removed x86_64 from EXCLUDED_ARCHS
- Added SwiftWhisper package dependency for Intel fallback
- Updated signing configuration for release builds

Stability bug fixes in ASR Service and CoreAudio

Summary by CodeRabbit

  • New Features

    • Added selectable transcription engines (Apple Silicon optimized engine and Whisper for Intel) with model download, cache management, and provider switching.
    • On-device Whisper support for Intel Macs.
    • Added a thread-safe audio buffer to improve streaming reliability.
    • UI: second Transcription Engine card in Settings and alerts to surface transcription errors.
  • Version Update

    • App version bumped to 1.5.1.

✏️ Tip: You can customize this high-level summary in your review settings.

- Changed ARCHS from arm64-only to
- Removed x86_64 from EXCLUDED_ARCHS
- Added SwiftWhisper package dependency for Intel fallback
- Updated signing configuration for release builds
@coderabbitai

coderabbitai Bot commented Dec 15, 2025 •

Copy link
Copy Markdown
Contributor

Walkthrough

This PR adds SwiftWhisper as a new SPM dependency and implements a provider-based ASR architecture with FluidAudio (ARM64) and Whisper (Intel) providers, refactors ASRService to use providers/ThreadSafeAudioBuffer/TranscriptionExecutor, updates build settings, and bumps app version to 1.5.1.

Changes

Cohort / File(s) Summary
Project & SPM
Fluid.xcodeproj/project.pbxproj, Fluid.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved, Package.resolved, Package.swift, Info.plist
Added SwiftWhisper package (exPHAT/SwiftWhisper), synced package references across pbxproj and Package.resolved, updated originHash and pin entry; changed ARCHS/VALID_ARCHS to "$(ARCHS_STANDARD)"; updated code signing/team settings; bumped CFBundleShortVersionString to 1.5.1.
Provider abstraction & types
Sources/Fluid/Services/TranscriptionProvider.swift, Sources/Fluid/Services/ASRService.swift
Introduced TranscriptionProvider protocol and ASRTranscriptionResult; added CPUArchitecture helpers; refactored ASRService to use provider strategy, provider caching/selection, single-flight prepare, error UI bindings, TranscriptionExecutor actor, ThreadSafeAudioBuffer usage, and provider lifecycle APIs.
FluidAudio provider
Sources/Fluid/Services/FluidAudioProvider.swift
Added FluidAudioProvider (ARM64: full implementation wrapping AsrManager; Intel: shim that throws) with prepare/transcribe/modelsExistOnDisk/clearCache and readiness management.
Whisper provider
Sources/Fluid/Services/WhisperProvider.swift
Added WhisperProvider implementing TranscriptionProvider, manages on-disk ggml model, downloads from Hugging Face with progress and error handling, implements prepare/transcribe/modelsExistOnDisk/clearCache.
Model downloader & platform guards
Sources/Fluid/Networking/ModelDownloader.swift, Sources/Fluid/Services/MeetingTranscriptionService.swift
Added ARM64-only loadLocalAsrModels(from:) to ModelDownloader; guarded MeetingTranscriptionService transcription with arch(arm64) and made non-ARM builds throw a not-supported error.
Audio buffering
Sources/Fluid/Services/ThreadSafeAudioBuffer.swift
Added ThreadSafeAudioBuffer for thread-safe sample append/read/clear operations with NSLock API (append, getPrefix, getAll, clear, count).
Settings
Sources/Fluid/Persistence/SettingsStore.swift
Added TranscriptionProviderOption enum (auto, fluidAudio, whisper) and persisted selectedTranscriptionProvider with objectWillChange notifications.
UI
Sources/Fluid/ContentView.swift, Sources/Fluid/UI/SettingsView.swift
ContentView: added alert bindings for ASR errors (errorTitle/errorMessage/showError). SettingsView: added a second Transcription Engine card and provider picker that resets provider on change.

Sequence Diagram(s)

sequenceDiagram
    actor User
    participant ContentView
    participant SettingsStore
    participant ASRService
    participant Provider
    participant Models
    participant Audio

    User->>ContentView: Choose provider / Start recording
    ContentView->>SettingsStore: Update/read selectedTranscriptionProvider
    ContentView->>ASRService: ensureAsrReady()
    ASRService->>SettingsStore: Read selection
    ASRService->>ASRService: Select provider (FluidAudio/Whisper)
    ASRService->>Provider: prepare(progressHandler)
    Provider->>Models: Check/download models
    Models-->>Provider: Models ready
    Provider-->>ASRService: isReady
    ContentView->>ASRService: start()
    Audio->>ASRService: stream samples
    ASRService->>ASRService: Buffer samples (ThreadSafeAudioBuffer)
    ContentView->>ASRService: stop()
    ASRService->>ASRService: Serialize via TranscriptionExecutor
    ASRService->>Provider: transcribe(audioChunk)
    Provider->>Models: Run inference
    Models-->>Provider: Transcription result
    Provider-->>ASRService: ASRTranscriptionResult
    ASRService-->>ContentView: Display transcript

    alt Provider error
        Provider-->>ASRService: throws
        ASRService->>ContentView: set errorTitle/errorMessage/showError
        ContentView-->>User: show alert
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

  • Pay close attention to ASRService changes: provider selection logic, TranscriptionExecutor actor, ThreadSafeAudioBuffer integration, and error propagation.
  • Review FluidAudioProvider and WhisperProvider for correct conditional compilation, model download/error handling, and resource cleanup.
  • Validate ModelDownloader ARM64 extension and MeetingTranscriptionService guards for consistent behavior across architectures.
  • Check project.pbxproj/Package.* changes for correct Swift package reference and target package dependency wiring.

Poem

🐇 I hopped through code to fetch a new voice,
Two providers now sing — each platform, its choice,
A buffer that guards every float and frame,
Whisper on Intel, FluidAudio on name,
Version 1.5.1 — the rabbit applauds! 🎶

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 42.86% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Title check ❓ Inconclusive The title 'Intel changes' is vague and generic, using non-descriptive phrasing that doesn't convey the specific nature of the architectural changes or the substantive work in the PR. Use a more descriptive title that captures the main objective, such as 'Add Intel x86_64 support and WhisperProvider for cross-architecture transcription' or 'Support universal binary with Intel fallback via SwiftWhisper'.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch intel-changes

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
Sources/Fluid/Networking/ModelDownloader.swift (1)

356-360: Hardcoded repository name breaks configurability.

The vocabulary path construction hardcodes "parakeet-tdt-0.6b-v3-coreml", which contradicts the class design that allows custom owner/repo via the initializer. If a different repository is configured, this path will be incorrect.

Consider loading the vocabulary from within repoDirectory directly, similar to how other model files are loaded:

-        let vocabPath = repoDirectory.deletingLastPathComponent().appendingPathComponent("parakeet-tdt-0.6b-v3-coreml").appendingPathComponent("parakeet_v3_vocab.json")
+        let vocabPath = repoDirectory.appendingPathComponent("parakeet_v3_vocab.json")

If the vocabulary must be in a parent directory for some reason, consider using the instance's repo property instead of a hardcoded string.

🧹 Nitpick comments (9)
Sources/Fluid/Networking/ModelDownloader.swift (1)

352-354: Add existence checks for decoder and joint models for consistent error handling.

The function checks for encoder/preprocessor existence but loads decoder and joint without validation. If these files are missing, users will get a cryptic MLModel error instead of a clear message like the one at line 346-349.

         // Load decoder and joint (same for both structures)
+        guard fm.fileExists(atPath: decUrl.path) else {
+            throw NSError(domain: "ModelDL", code: -1, userInfo: [
+                NSLocalizedDescriptionKey: "Decoder model not found at \(decUrl.path)"
+            ])
+        }
+        guard fm.fileExists(atPath: jointUrl.path) else {
+            throw NSError(domain: "ModelDL", code: -1, userInfo: [
+                NSLocalizedDescriptionKey: "JointDecision model not found at \(jointUrl.path)"
+            ])
+        }
         let decoder = try MLModel(contentsOf: decUrl, configuration: config)
         let joint = try MLModel(contentsOf: jointUrl, configuration: config)
Sources/Fluid/Persistence/SettingsStore.swift (1)

769-791: Clean implementation, but address SwiftLint warnings.

The transcription provider enum is well-designed with clear display names and descriptions. However, the string enum values are redundant when they match the case names.

Apply this diff to address the SwiftLint warnings:

     enum TranscriptionProviderOption: String, CaseIterable, Identifiable {
-        case auto = "auto"
-        case fluidAudio = "fluidAudio"
-        case whisper = "whisper"
+        case auto
+        case fluidAudio
+        case whisper

Based on learnings, SwiftLint flagged redundant string enum values.

Sources/Fluid/Services/WhisperProvider.swift (1)

23-52: WhisperProvider model lifecycle looks solid; consider minor robustness/UX tweaks

Overall the provider wiring (cache location, download, load, cache clearing) looks correct and matches the TranscriptionProvider contract.

Two small follow‑ups you might consider:

  • modelURL force‑unwraps the caches directory (.first!). It’s extremely unlikely to be nil, but you could defensively fall back (or throw a clear error) instead of crashing if the URL lookup ever fails in unusual sandboxed contexts.
  • prepare(progressHandler:) forwards the closure to downloadModel, but downloadModel doesn’t currently report progress. Either wire progress into a custom URLSession/delegate pipeline or, if that’s not planned, document that progress isn’t used so callers don’t expect updates.

Also applies to: 84-134

Sources/Fluid/UI/SettingsView.swift (1)

567-648: Transcription Engine card correctly drives provider selection; only minor state-source nit

The card cleanly reflects asr.activeProviderName, shows an architecture badge, and uses a Picker bound to SettingsStore.shared.selectedTranscriptionProvider, calling asr.resetTranscriptionProvider() so the new provider takes effect on next use. That matches the new provider architecture.

If you want to tighten separation of concerns later, you could have ASRService expose the selected provider (and perhaps the architecture label) instead of reading SettingsStore.shared directly in the view, keeping persistence/selection logic in one place.

Sources/Fluid/Services/MeetingTranscriptionService.swift (1)

3-8: Confirm Apple‑Silicon‑only file transcription behavior and clean up duplicate imports

  • import AVFoundation and import Combine are now each imported twice. It’s harmless but worth pruning for clarity.
  • With the new #if arch(arm64) block, file transcription:
    • Only runs via asrService.asrManager on Apple Silicon (FluidAudio).
    • Always throws TranscriptionError.transcriptionFailed("File transcription is only supported on Apple Silicon Macs at this time.") on non‑arm64.
    • On Apple Silicon, if the selected transcription provider is Whisper, asrService.asrManager will be nil, and you’ll hit the ASR Manager not initialized error path.

If the intent is “Meeting transcription only works with FluidAudio on Apple Silicon,” this is fine but might merit a more specific user‑facing error (and possibly UI gating). If you eventually want meeting transcription to respect the same provider abstraction as streaming/real‑time ASR, this would be the main place to refactor toward calling the TranscriptionProvider instead of FluidAudio directly.

Also applies to: 99-150

Sources/Fluid/Services/FluidAudioProvider.swift (1)

20-77: FluidAudioProvider wrapper looks correct; progressHandler currently unused

The arm64 implementation cleanly wraps AsrModels.downloadAndLoad() and AsrManager, tracks readiness, and manages both v2/v3 CoreML caches. The Intel shim appropriately advertises itself as unavailable and throws from prepare/transcribe, matching the provider‑selection logic in ASRService.

One small improvement: prepare(progressHandler:) ignores the progress callback. If you ever want to surface model‑download/load progress in the UI (similar to the ASR settings card), plumbing this through to AsrModels would make the API more meaningful. If you don’t plan to support progress here, consider documenting that the handler is not called to avoid false expectations.

Also applies to: 79-92

Sources/Fluid/Services/ASRService.swift (3)

11-27: TranscriptionExecutor correctly serializes CoreML calls; document non‑reentrancy assumption

The actor’s lastTask chaining effectively enforces strict serialization of transcription operations and shields CoreML from concurrent access.

One thing to be explicit about: if any future code calls transcriptionExecutor.run from inside an operation already running under run, it will deadlock (inner task waits on previous which is the outer task). Today your providers don’t do this, so it’s safe, but a short doc comment or assertion warning against re‑entrant use would help future maintainers avoid accidental misuse.


76-80: Provider abstraction and ensureAsrReady single‑flight look good; small state/UX tweaks

  • The FluidAudio/Whisper provider selection via SettingsStore.shared.selectedTranscriptionProvider and CPUArchitecture.isAppleSilicon is clean, and the single‑flight ensureAsrReady logic (ensureReadyTask + ensureReadyProviderKey) correctly prevents overlapping prepare() calls for a given provider.
  • checkIfModelsExist() now delegates to transcriptionProvider.modelsExistOnDisk(), which is correct per‑provider. When you call resetTranscriptionProvider(), you currently force modelsExistOnDisk = false; if you want the “Model cached” indicator to accurately reflect the newly selected provider immediately, consider invoking checkIfModelsExist() there instead of hard‑resetting to false.
  • Inside performEnsureAsrReady, you’re already on the @MainActor but still wrap UI state changes (isDownloadingModel, isLoadingModel, modelsExistOnDisk) in DispatchQueue.main.async. You can safely assign these properties directly and drop the extra dispatch, which simplifies the code and keeps updates strictly ordered with the rest of the main‑actor logic.
  • clearModelCache() delegates to transcriptionProvider.clearCache(), so the “Delete models” button in the UI effectively applies to whichever provider is currently active. If the intent is “delete models for current engine,” this is perfect; if instead you want a global cache purge (both FluidAudio and Whisper), you might add a helper that calls clearCache() on both providers when present.

The error fields (errorTitle, errorMessage, showError) wired in stop() and predownloadSelectedModel() are also a good fit for the new ContentView alert and keep user‑visible error handling scoped to explicit failure points.

Also applies to: 90-97, 98-164, 176-189, 246-250, 636-767, 769-791, 807-813


186-189: ThreadSafeAudioBuffer integration fixes mutation races; revisit streaming startup semantics

  • Replacing the raw [Float] buffer with ThreadSafeAudioBuffer and using append, getAll, getPrefix, and clear in processInputBuffer, stop, stopWithoutTranscription, and streaming logic is a solid fix for the “Array mutation while enumerating” / cross‑thread mutation issues during long sessions.
  • In processStreamingChunk, you now take audioBuffer.count and pass audioBuffer.getPrefix(currentSampleCount) into transcriptionExecutor.run, which is fine as long as getPrefix is cheap enough (you’re effectively re‑transcribing the accumulated audio each time, relying on smartDiffUpdate to smooth the UI). If streaming performance ever regresses on slower machines, consider switching to a “take and trim” API to process only new samples per chunk.
  • startStreamingTranscription() still bails out when isAsrReady is false. Given that ContentView.startRecording() starts the engine and then calls ensureAsrReady() in a background Task, the first recording session on a fresh install may have no streaming preview until the user stops and restarts after models are ready. If you want streaming on the very first run, you may want to (re)start streaming once ensureAsrReady() completes successfully.

Also applies to: 298-305, 365-368, 419-420, 512-525, 868-887, 913-915

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ef79498 and 7a64654.

📒 Files selected for processing (15)
  • Fluid.xcodeproj/project.pbxproj (18 hunks)
  • Fluid.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved (2 hunks)
  • Info.plist (1 hunks)
  • Package.resolved (1 hunks)
  • Package.swift (2 hunks)
  • Sources/Fluid/ContentView.swift (1 hunks)
  • Sources/Fluid/Networking/ModelDownloader.swift (3 hunks)
  • Sources/Fluid/Persistence/SettingsStore.swift (2 hunks)
  • Sources/Fluid/Services/ASRService.swift (14 hunks)
  • Sources/Fluid/Services/FluidAudioProvider.swift (1 hunks)
  • Sources/Fluid/Services/MeetingTranscriptionService.swift (3 hunks)
  • Sources/Fluid/Services/ThreadSafeAudioBuffer.swift (1 hunks)
  • Sources/Fluid/Services/TranscriptionProvider.swift (1 hunks)
  • Sources/Fluid/Services/WhisperProvider.swift (1 hunks)
  • Sources/Fluid/UI/SettingsView.swift (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (4)
Sources/Fluid/Services/TranscriptionProvider.swift (2)
Sources/Fluid/Services/FluidAudioProvider.swift (6)
  • prepare (20-35)
  • prepare (85-87)
  • transcribe (37-45)
  • transcribe (89-91)
  • modelsExistOnDisk (47-51)
  • clearCache (53-70)
Sources/Fluid/Services/WhisperProvider.swift (4)
  • prepare (32-52)
  • transcribe (54-68)
  • modelsExistOnDisk (70-72)
  • clearCache (74-80)
Sources/Fluid/Services/WhisperProvider.swift (1)
Sources/Fluid/Services/TranscriptionProvider.swift (2)
  • modelsExistOnDisk (49-49)
  • clearCache (50-50)
Sources/Fluid/UI/SettingsView.swift (1)
Sources/Fluid/Services/ASRService.swift (1)
  • resetTranscriptionProvider (157-164)
Sources/Fluid/Services/FluidAudioProvider.swift (4)
Sources/Fluid/Services/WhisperProvider.swift (4)
  • prepare (32-52)
  • transcribe (54-68)
  • modelsExistOnDisk (70-72)
  • clearCache (74-80)
Sources/Fluid/Services/DebugLogger.swift (1)
  • info (133-135)
Sources/Fluid/Services/ASRService.swift (1)
  • initialize (224-244)
Sources/Fluid/Services/TranscriptionProvider.swift (2)
  • modelsExistOnDisk (49-49)
  • clearCache (50-50)
🪛 SwiftLint (0.57.0)
Sources/Fluid/Persistence/SettingsStore.swift

[Warning] 770-770: String enum values can be omitted when they are equal to the enumcase name

(redundant_string_enum_value)


[Warning] 771-771: String enum values can be omitted when they are equal to the enumcase name

(redundant_string_enum_value)


[Warning] 772-772: String enum values can be omitted when they are equal to the enumcase name

(redundant_string_enum_value)

Sources/Fluid/Networking/ModelDownloader.swift

[Warning] 3-3: Imports should be unique

(duplicate_imports)

🔇 Additional comments (18)
Sources/Fluid/Networking/ModelDownloader.swift (1)

302-386: LGTM on the overall structure and conditional compilation.

The ARM64-gated extension with fallback support for legacy model structures is well-designed. The version detection logic and verbose logging will help with debugging model loading issues.

Info.plist (1)

14-14: LGTM! Version bump aligns with the release.

The version update to 1.5.1 is consistent with the MARKETING_VERSION changes in the project configuration.

Fluid.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved (2)

94-102: LGTM! SwiftWhisper correctly pinned to version 1.2.0.

This Package.resolved correctly pins SwiftWhisper to a semantic version (1.2.0) with a specific revision, ensuring reproducible builds. This is the proper approach that should also be applied to Package.swift and the root Package.resolved.


2-2: OriginHash update is expected.

The originHash change reflects the addition of the SwiftWhisper dependency.

Sources/Fluid/Persistence/SettingsStore.swift (2)

794-806: LGTM! Proper UserDefaults integration with default fallback.

The property correctly persists the selected provider and defaults to .auto when no value is stored, allowing automatic selection based on architecture.


67-69: Key constant properly namespaced.

The new key constant follows the existing pattern in the Keys enum.

Sources/Fluid/Services/TranscriptionProvider.swift (4)

7-15: LGTM! Clean result type with sensible defaults.

The ASRTranscriptionResult struct provides a unified result type with a default confidence of 1.0, which is appropriate for providers that don't compute confidence scores (like WhisperProvider).


19-45: Excellent provider abstraction.

The TranscriptionProvider protocol cleanly abstracts ASR functionality across multiple backends. The prepare() method with optional progress handler enables async model downloads, and transcribe() is well-documented regarding the expected audio format (16kHz mono PCM).


48-51: Default implementations reduce boilerplate.

Providing default no-op implementations for modelsExistOnDisk() and clearCache() allows providers to opt into these features only when needed.


56-75: Proper compile-time architecture detection.

The CPUArchitecture enum uses compile-time conditionals (#if arch(arm64)) to detect Apple Silicon vs Intel, which is the correct approach for platform-specific feature gating. The helper properties (isAppleSilicon, isIntel) improve readability at call sites.

Sources/Fluid/Services/ThreadSafeAudioBuffer.swift (1)

6-45: Excellent thread-safe implementation.

The ThreadSafeAudioBuffer correctly uses NSLock to protect all buffer operations. Key strengths:

  • Consistent use of defer { lock.unlock() } ensures locks are always released
  • Read operations (count, getPrefix, getAll) return copies, preventing external mutation
  • The getPrefix() method properly clamps the length to prevent out-of-bounds access
  • The clear() method's keepingCapacity parameter optimizes for repeated use
Fluid.xcodeproj/project.pbxproj (6)

11-11: SwiftWhisper integration looks correct.

SwiftWhisper is properly added to the Frameworks build phase and package product dependencies.

Also applies to: 36-36, 84-84


421-428: Correct package reference using semantic versioning.

The SwiftWhisper package reference correctly uses upToNextMajorVersion with minimum version 1.2.0, ensuring stable and reproducible builds. This is the proper approach that should be mirrored in Package.swift.


156-156: ARCHS configuration enables universal binary support.

Changing ARCHS from arm64 to $(ARCHS_STANDARD) correctly enables building for both Apple Silicon (arm64) and Intel (x86_64) architectures, which aligns with the PR objective to add Intel support.

Also applies to: 223-223, 282-282, 337-337, 330-330, 385-385


318-318: Version bump is consistent across the project.

MARKETING_VERSION updated to 1.5.1 matches the Info.plist change.

Also applies to: 373-373


286-287: Code signing configuration updated for consistency.

The CODE_SIGN_IDENTITY is set to "Apple Development" with Automatic code signing style, which is appropriate for development builds. The per-SDK override [sdk=macosx*] ensures the correct identity is used for macOS targets.

Also applies to: 341-342


290-290: Verify the Development Team change is authorized.

DEVELOPMENT_TEAM has been updated to V4J43B279J across all build configurations (lines 188, 255, 290, 345 in project.pbxproj). The old team ID J67LH9U7BN is no longer present anywhere in the codebase. The team ID is also consistently referenced in scripts/check-team-id.sh and Sources/Fluid/Services/SimpleUpdater.swift, confirming the change is systematic and intentional.

Only you can verify that V4J43B279J corresponds to the correct Apple Developer account for code signing and distribution. Ensure you have valid code signing certificates provisioned for this team ID.

Sources/Fluid/ContentView.swift (1)

523-527: ASR error alert binding is correctly wired

The new alert cleanly binds to asr.errorTitle / errorMessage / showError and is consistent with the existing keychain alert pattern. This should give users clear feedback on provider/model failures without impacting other flows.

Comment thread Package.resolved
Comment on lines +57 to +65
{
"identity" : "swiftwhisper",
"kind" : "remoteSourceControl",
"location" : "https://github.com/exPHAT/SwiftWhisper.git",
"state" : {
"branch" : "master",
"revision" : "c340197966ebd264f3135d3955874b40f8ed58bc"
}
},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

# Find and read the Package.resolved file
find . -name "Package.resolved" -type f

Repository: altic-dev/FluidVoice

Length of output: 158


🌐 Web query:

SwiftWhisper GitHub releases version 1.2.0

💡 Result:

Yes — exPHAT/SwiftWhisper has a 1.2.0 release (published 2023-08-17). [1][2]

Sources:
[1] GitHub — exPHAT/SwiftWhisper.
[2] Swift Package Registry — SwiftWhisper (shows 1.2.0 and timestamp).


🌐 Web query:

SwiftWhisper exPHAT GitHub repository latest releases

💡 Result:

The latest release is v1.2.0 (released Aug 17, 2023). [1][2]

Sources:

  • GitHub releases list for exPHAT/SwiftWhisper. [1]
  • Swift Package Registry / Package index entry for SwiftWhisper (v1.2.0, 2023‑08‑17). [2]

🏁 Script executed:

# Read the main Package.resolved file
cat -n ./Package.resolved | grep -A 10 -B 2 "swiftwhisper"

Repository: altic-dev/FluidVoice

Length of output: 505


🏁 Script executed:

# Read the workspace Package.resolved file
cat -n ./Fluid.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved | grep -A 10 -B 2 "swiftwhisper"

Repository: altic-dev/FluidVoice

Length of output: 505


🌐 Web query:

SwiftWhisper exPHAT GitHub version 1.2.0 commit hash revision

💡 Result:

The 1.2.0 release is the commit tagged a192004 (merge commit). [1][2]

Sources:

  • GitHub releases (1.2.0) showing tag a192004. [1]
  • Commit page for a192004. [2]

Synchronize main Package.resolved with workspace version: pin SwiftWhisper to v1.2.0.

The main Package.resolved file currently tracks the master branch, which causes inconsistency with the workspace file (already pinned to v1.2.0) and creates reproducibility risks. The workspace Package.resolved is already correctly configured; the main file needs to match.

Apply this diff to pin to version 1.2.0:

     {
       "identity" : "swiftwhisper",
       "kind" : "remoteSourceControl",
       "location" : "https://github.com/exPHAT/SwiftWhisper.git",
       "state" : {
-        "branch" : "master",
-        "revision" : "c340197966ebd264f3135d3955874b40f8ed58bc"
+        "revision" : "a192004db08de7c6eaa169eede77f1625e7d23fb",
+        "version" : "1.2.0"
       }
     },
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
{
"identity" : "swiftwhisper",
"kind" : "remoteSourceControl",
"location" : "https://github.com/exPHAT/SwiftWhisper.git",
"state" : {
"branch" : "master",
"revision" : "c340197966ebd264f3135d3955874b40f8ed58bc"
}
},
{
"identity" : "swiftwhisper",
"kind" : "remoteSourceControl",
"location" : "https://github.com/exPHAT/SwiftWhisper.git",
"state" : {
"revision" : "a192004db08de7c6eaa169eede77f1625e7d23fb",
"version" : "1.2.0"
}
},
🤖 Prompt for AI Agents
In Package.resolved lines 57-65 update the SwiftWhisper entry so it matches the
workspace pin: locate the "swiftwhisper" remoteSourceControl block and replace
the branch-based state with a version-based state for v1.2.0 (i.e., set
"version": "1.2.0") and update the "revision" value to the commit SHA that
corresponds to the v1.2.0 tag from the workspace Package.resolved; ensure the
entry now pins the dependency to version 1.2.0 instead of tracking "master" to
maintain reproducible builds.

Comment thread Package.swift
.package(url: "https://github.com/mxcl/PromiseKit", from: "6.0.0"),
.package(url: "https://github.com/MrKai77/DynamicNotchKit", from: "1.0.0")
.package(url: "https://github.com/MrKai77/DynamicNotchKit", from: "1.0.0"),
.package(url: "https://github.com/exPHAT/SwiftWhisper.git", branch: "master")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Pin SwiftWhisper to a semantic version for reproducible builds.

Using branch: "master" prevents reproducible builds and can introduce unexpected breaking changes. Pin to version 1.2.0 (as referenced in the Xcode workspace Package.resolved) or the latest stable release.

Apply this diff:

-        .package(url: "https://github.com/exPHAT/SwiftWhisper.git", branch: "master")
+        .package(url: "https://github.com/exPHAT/SwiftWhisper.git", from: "1.2.0")
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
.package(url: "https://github.com/exPHAT/SwiftWhisper.git", branch: "master")
.package(url: "https://github.com/exPHAT/SwiftWhisper.git", from: "1.2.0")
🤖 Prompt for AI Agents
In Package.swift around line 16, the dependency currently uses branch: "master"
which prevents reproducible builds; replace that entry to pin SwiftWhisper to
the semantic version 1.2.0 (e.g. use exact: "1.2.0" or the equivalent
version-pinning syntax), then run swift package resolve (or update the Xcode
workspace) to refresh Package.resolved and commit the change.

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@altic-dev
altic-dev merged commit 60234a0 into main Dec 15, 2025

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

♻️ Duplicate comments (1)
Sources/Fluid/Networking/ModelDownloader.swift (1)

1-7: Fix unmatched #if arch(arm64) and duplicate Foundation import at top of file

  • Line 2 duplicates the Foundation import from Line 1.
  • Lines 4–5 introduce two nested #if arch(arm64) but only one #endif at Line 7, which—combined with the additional #if arch(arm64) at Line 303 and #endif at Line 387—leaves the preprocessor conditionals unbalanced and will break compilation.

You can simplify and fix both issues with something like:

-import Foundation
-import Foundation
-import CoreML
-#if arch(arm64)
-#if arch(arm64)
-import FluidAudio
-#endif
+import Foundation
+import CoreML
+#if arch(arm64)
+import FluidAudio
+#endif

This restores a single balanced conditional around FluidAudio and removes the redundant import.

🧹 Nitpick comments (1)
Sources/Fluid/Networking/ModelDownloader.swift (1)

303-385: Avoid hard‑coding the vocab repo path in loadLocalAsrModels

In loadLocalAsrModels(from:), vocabPath (around Lines 358–361) is constructed as:

let vocabPath = repoDirectory
    .deletingLastPathComponent()
    .appendingPathComponent("parakeet-tdt-0.6b-v3-coreml")
    .appendingPathComponent("parakeet_v3_vocab.json")

This ties the loader to a specific repo name and ignores the actual repoDirectory passed in (and the repo initializer parameter). If HuggingFaceModelDownloader is ever configured for a different ASR repo or if the directory name changes, this will fail even when the correct vocab file is present.

Consider deriving the vocab path directly from repoDirectory (or from repo) instead, e.g.:

- let vocabPath = repoDirectory.deletingLastPathComponent()
-    .appendingPathComponent("parakeet-tdt-0.6b-v3-coreml")
-    .appendingPathComponent("parakeet_v3_vocab.json")
+ let vocabPath = repoDirectory.appendingPathComponent("parakeet_v3_vocab.json")

or by making the vocab filename/repo name configurable.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7a64654 and c3aba0a.

📒 Files selected for processing (1)
  • Sources/Fluid/Networking/ModelDownloader.swift (3 hunks)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant