Skip to content

AsrManager needs Sendable conformance for Xcode 26.4 compatibility #448

@sebsto

Description

@sebsto

Summary

Xcode 26.4 (17E192) introduces stricter Swift 6 concurrency checking that causes build failures in FluidAudio 0.12.4. The AsrManager class is used from within StreamingAsrManager (an actor) via a nonisolated(unsafe) property, but the compiler now flags the await calls as sending 'asrManager' risks causing data races.

Errors

StreamingAsrManager.swift:622:38: error: sending 'asrManager' risks causing data races
StreamingAsrManager.swift:379:77: error: sending 'asrManager' risks causing data races
StreamingAsrManager.swift:258:34: error: sending 'asrManager' risks causing data races

Why 0.12.4 Specifically

FluidAudio 0.12.5+ likely fixes this but requires swift-transformers >= 1.2.0. Projects that also depend on WhisperKit are capped at FluidAudio 0.12.4 because WhisperKit pins swift-transformers to < 1.2.0 (see argmaxinc/WhisperKit#451).

A patch on the 0.12.x branch that adds Sendable conformance without bumping the swift-transformers requirement would unblock these projects.

Suggested Fix

Add @unchecked Sendable to AsrManager in Sources/FluidAudio/ASR/AsrManager.swift:

// Current
public final class AsrManager {

// Proposed
public final class AsrManager: @unchecked Sendable {

This is safe because AsrManager is only accessed from within StreamingAsrManager's actor isolation domain.

Environment

  • Xcode 26.4 (17E192) — fails
  • Xcode 26.3 (17C529) — succeeds
  • FluidAudio 0.12.4
  • macOS 26

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions