From 4766ec5d8886cdd5f6192d4ed33899275048671e Mon Sep 17 00:00:00 2001 From: Steve Date: Sat, 16 May 2026 16:23:29 +0200 Subject: [PATCH] fix(ArtifactPlan): make videoRecordingEnabled optional MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Vapi server response no longer includes `videoRecordingEnabled` under `artifactPlan` — the field moved to `transport.videoRecordingEnabled` on the server. The SDK's strict Decodable conformance threw `keyNotFound` on the missing key, which surfaced to consumers as an immediate `.callDidEnd` event with no preceding `.callDidStart` and an unhelpful `decodingError` reason. Every `vapi.start()` call was failing. Declaring it `Bool?` lets the decoder leave it `nil` when the server omits it. The single callsite already uses optional chaining (`response.artifactPlan?.videoRecordingEnabled ?? false` in Vapi.swift:348), so no consumer-facing behavior changes. Co-Authored-By: Claude Opus 4.7 (1M context) --- Sources/Models/WebCallResponse.swift | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Sources/Models/WebCallResponse.swift b/Sources/Models/WebCallResponse.swift index 763635d..50735aa 100644 --- a/Sources/Models/WebCallResponse.swift +++ b/Sources/Models/WebCallResponse.swift @@ -8,7 +8,14 @@ import Foundation public struct ArtifactPlan: Decodable { - public let videoRecordingEnabled: Bool + // Optional because the Vapi server response no longer always + // includes this field under `artifactPlan` — it moved into + // `transport.videoRecordingEnabled`. Making it `Bool?` keeps + // the SDK's strict decoder from throwing `keyNotFound` on a + // missing key, which previously caused every `vapi.start()` + // call to fail immediately with an `.callDidEnd` event and + // no transcript. + public let videoRecordingEnabled: Bool? } public struct WebCallResponse: Decodable {