diff --git a/NucleicRemote/NucleicRemote/Models/PhoneIntelligenceExecutor.swift b/NucleicRemote/NucleicRemote/Models/PhoneIntelligenceExecutor.swift index 23ee553..4dde2a4 100644 --- a/NucleicRemote/NucleicRemote/Models/PhoneIntelligenceExecutor.swift +++ b/NucleicRemote/NucleicRemote/Models/PhoneIntelligenceExecutor.swift @@ -69,8 +69,14 @@ enum PhoneIntelligenceExecutor { let deadline = request.deadlineSeconds ?? 60 let text = await raceAgainstDeadline(seconds: deadline) { await gate.run { - try? await LanguageModelSession(model: model, instructions: job.instructions) - .respond(to: job.prompt).content + // Strip the tool-calling envelope the macOS 27 / iOS 27 model wraps free-form + // replies in before it goes on the wire — the host parses this text with the + // same line-oriented heuristics as a local generation, so it must arrive + // already unwrapped. A reply that was nothing but scaffolding yields nil, which + // answers `error` below and drops the host straight to its heuristic. + ModelOutput.usableText( + try? await LanguageModelSession(model: model, instructions: job.instructions) + .respond(to: job.prompt).content) } } if let text, !text.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty {