From 661c094e82a9104d5e07c28cea061102423e2ee6 Mon Sep 17 00:00:00 2001 From: marius-kilocode Date: Mon, 3 Aug 2026 17:36:18 +0200 Subject: [PATCH] fix(vscode): include macOS speech errors --- packages/kilo-vscode/src/speech-to-text/capture.ts | 5 ++++- .../kilo-vscode/tests/unit/speech-to-text-capture.test.ts | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/kilo-vscode/src/speech-to-text/capture.ts b/packages/kilo-vscode/src/speech-to-text/capture.ts index e8b61251072..4b354158426 100644 --- a/packages/kilo-vscode/src/speech-to-text/capture.ts +++ b/packages/kilo-vscode/src/speech-to-text/capture.ts @@ -46,7 +46,10 @@ function run(args) { const error = Ref() const url = $.NSURL.fileURLWithPath(args[0]) const recorder = $.AVAudioRecorder.alloc.initWithURLSettingsError(url, settings, error) - if (!recorder || !recorder.prepareToRecord || !recorder.record) throw new Error("Could not start recording") + if (!recorder || !recorder.prepareToRecord || !recorder.record) { + const description = error[0] && error[0].localizedDescription + throw new Error(description ? description.js : "Could not start recording") + } console.log("ready") $.NSFileHandle.fileHandleWithStandardInput.readDataToEndOfFile recorder.stop diff --git a/packages/kilo-vscode/tests/unit/speech-to-text-capture.test.ts b/packages/kilo-vscode/tests/unit/speech-to-text-capture.test.ts index b76c8e8c7a8..a0e7120b044 100644 --- a/packages/kilo-vscode/tests/unit/speech-to-text-capture.test.ts +++ b/packages/kilo-vscode/tests/unit/speech-to-text-capture.test.ts @@ -19,6 +19,7 @@ describe("macCaptureArgs", () => { expect(args[3]).toContain("numberWithDouble(16000), $.AVSampleRateKey") expect(args[3]).toContain("numberWithInt(1), $.AVNumberOfChannelsKey") expect(args[3]).toContain("numberWithInt(24000), $.AVEncoderBitRateKey") + expect(args[3]).toContain("error[0] && error[0].localizedDescription") expect(args[3]).toContain('console.log("ready")') }) })