fix(ai,persistence): ModelStore + FileVault 标 @unchecked Sendable
Xcode 26 默认开启 Swift 6 严格并发检查。AIRuntime(actor) 调用 ModelStore.shared.isReady(...) 跨 actor 边界,因 ModelStore 非 Sendable 而编译报错"Expression is 'async' but is not marked with 'await'; this is an error in the Swift 6 language mode"。 两个类的内部状态只读(rootURL: let),方法只做线程安全的 filesystem I/O,符合 Sendable 语义,标 @unchecked Sendable 即可,不必加锁或重构。 修复目标错误: - AIRuntime.swift:48 - guard ModelStore.shared.isReady(.llm) ... - 后续 CaptureService 调 FileVault.shared.writeJPEG 同样路径 不影响: - HomeView/B5ResultView 里 Text "+" 的 macOS 26.0 deprecation 是 warning,不阻塞 build,留待 UI polish 周清理 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -8,7 +8,9 @@ enum FileVaultError: Error {
|
||||
case decodeFailed
|
||||
}
|
||||
|
||||
final class FileVault {
|
||||
/// `@unchecked Sendable`:rootURL 是 let,方法只 I/O 到沙盒目录(线程安全),
|
||||
/// 可被任意 actor / Task 跨边界访问。
|
||||
final class FileVault: @unchecked Sendable {
|
||||
static let shared: FileVault = {
|
||||
do {
|
||||
let appSupport = try FileManager.default.url(
|
||||
|
||||
Reference in New Issue
Block a user