`LanguageModelSession.respond()` never resolves in Beta 5

Hi all,

I noticed on Friday that on the new Beta 5 using FoundationModels on a simulator LanguageModelSession.respond() neither resolves nor throws most of the time. The SwiftUI test app below was working perfectly in Xcode 16 Beta 4 and iOS 26 Beta 4 (simulator).

import SwiftUI
import FoundationModels

struct ContentView: View {
    var body: some View {
        VStack {
            Image(systemName: "globe")
                .imageScale(.large)
                .foregroundStyle(.tint)
            Text("Hello, world!")
        }
        .padding()
        .onAppear {
            
            Task {
                do {
                    let session = LanguageModelSession()
                    let response = try await session.respond(to: "are cats better than dogs ???")
                    print(response.content)
                } catch {
                    print("error")
                }
            }
        }
    }
}

After updating to Xcode 16 Beta 5 and iOS 26 Beta 5 (simulator), the code now often hangs.

Occasionally it will work if I toggle Apple Intelligence on and off in Settings, but it’s unreliable.

The .onAppear and Task can be replaced by .task. I did not experience your problem, so might try changing this.

Hi @itsramensam, can you confirm what version of Xcode you are using? In the menu bar navigate to About Xcode, then copy the full version including build number.

Best,

-J

`LanguageModelSession.respond()` never resolves in Beta 5
 
 
Q