From 2b3b3ebfe8a7b1575b6c7140c453326ee19e5684 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20=22Dezzy=22=20Victor?= Date: Fri, 31 Jul 2026 13:29:19 -0300 Subject: [PATCH] exit 0 when the model id is unknown Same defect as the accessibility path: `unknown model` throws ExitCode(1), and the LaunchAgent sets KeepAlive{SuccessfulExit: false}, so launchd relaunches the daemon, which prints the same error and exits again. Observed after pointing the agent at an id that was not in the registry: unknown model: whisper-large-v3-turbo-compressed run `parrot models list` to see options. unknown model: whisper-large-v3-turbo-compressed run `parrot models list` to see options. unknown model: whisper-large-v3-turbo-compressed A wrong id in a plist cannot fix itself by being retried. Exit 0 so the user gets the message once. --- Sources/parrot/Parrot.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Sources/parrot/Parrot.swift b/Sources/parrot/Parrot.swift index 05a69ebe..112c212e 100644 --- a/Sources/parrot/Parrot.swift +++ b/Sources/parrot/Parrot.swift @@ -50,7 +50,9 @@ struct Run: ParsableCommand { guard let m = ModelRegistry.find(id) else { FileHandle.standardError.write(Data("unknown model: \(id)\n".utf8)) FileHandle.standardError.write(Data("run `parrot models list` to see options.\n".utf8)) - throw ExitCode(1) + // Exit 0 for the same reason as a missing permission: a bad model id + // is not transient, and KeepAlive would relaunch us forever. + throw ExitCode(0) } chosenModel = m } else {