chore: fix Swift 6 / Xcode 26.4 strict concurrency build errors#727
Merged
RaajeevChandran merged 1 commit intoosaurus-ai:mainfrom Mar 26, 2026
Merged
Conversation
Xcode 26.4 enforces Swift 6 strict concurrency checking more aggressively than 16.x, exposing build failures in two dependencies and three source files that were previously only warnings or silent. Dependency updates: - swift-sdk 0.10.x → from: "0.12.0": fixes NetworkTransport data race (upstream PR osaurus-ai#206). Also adds annotations/metadata fields to Tool.Content cases that required call-site pattern updates. - FluidAudio 0.12.1 → from: "0.12.6": AsrManager converted to actor, fixing StreamingAsrManager sending-risk data race errors. Source fixes: - MCPProviderTool.swift: update .text/.image/.audio/.resource pattern matches for new MCP SDK 0.12 tuple labels (annotations:, _meta:) - MCPProviderManager.swift: same .text pattern match update - WorkEngine.swift: add Sendable to WorkEngineDelegate so the delegate can be sent across actor boundaries without data races - HostAPIBridgeServer.swift: explicit capture list [plugin] in Task { @mainactor in } closure to satisfy Swift 6 sendability checker
9 tasks
Contributor
|
Good to merge! |
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
Xcode 26.4 (released March 24, 2026) enforces Swift 6 strict concurrency checking more aggressively than Xcode 16.x. Errors that were warnings or silent in 16.x become hard build failures in 26.4, breaking compilation for anyone who has upgraded. This PR fixes all affected files.
Changes
What changed
Dependency updates (
Package.swift/Package.resolved):swift-sdkupToNextMinor(from: "0.10.0")→from: "0.12.0": fixes aNetworkTransportdata race reported upstream in fix #203 NetworkTransport race, with main-isolated variables modelcontextprotocol/swift-sdk#206. Also addsannotations:and_meta:tuple labels toTool.Contentcases that required call-site updates.FluidAudiofrom: "0.12.1"→from: "0.12.6":AsrManagerwas converted to an actor upstream, fixingStreamingAsrManagersending-risk data race errors that surface under Xcode 26.4's stricter checker.Source fixes:
MCPProviderTool.swift— update.text,.image,.audio,.resourcepattern matches to the new MCP SDK 0.12 tuple labels (annotations:,_meta:added to each case)MCPProviderManager.swift— same.text(let text)→.text(let text, _, _)pattern updateWorkEngine.swift— addSendabletoWorkEngineDelegateprotocol so the delegate value can cross actor isolation boundaries without a data raceHostAPIBridgeServer.swift— add explicit[plugin]capture list inTask { @MainActor in }closure to satisfy Swift 6 sendability checker forvar pluginTest Plan
swift test --package-path Packages/OsaurusCoreAll tests pass except two known pre-existing failures (
toolLoadBuffersSpecrequires a loaded model;prefillDidFinish_calledAfterFirstTokenis flaky under concurrent test execution due to sharedInferenceProgressManager.sharedstate).Build verified on macOS with Xcode 26.4.
Checklist
CONTRIBUTING.md