From e5a557efeee02c94486d391afc48f24a49ebc9a5 Mon Sep 17 00:00:00 2001 From: Aiden Cline <63023139+rekram1-node@users.noreply.github.com> Date: Sun, 11 Oct 2026 22:17:03 -0500 Subject: [PATCH] fix(cli): return unavailable in updater.check when install method is unknown (#54672) --- packages/cli/src/services/updater.ts | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/packages/cli/src/services/updater.ts b/packages/cli/src/services/updater.ts index 31270000e23..618265edc3c 100644 --- a/packages/cli/src/services/updater.ts +++ b/packages/cli/src/services/updater.ts @@ -499,7 +499,12 @@ const make = Effect.gen(function* () { }) const apply = Effect.fn("cli.updater.apply")(function* (version: string) { - if (!(yield* install(version))) return yield* Effect.fail(new Error("Installation method not found")) + if (!(yield* install(version))) + return yield* Effect.fail( + new Error( + "Could not detect the installation method. Update with your package manager or download the latest release.", + ), + ) }) const check = Effect.fn("cli.updater.check")(function* () { @@ -508,7 +513,14 @@ const make = Effect.gen(function* () { type: "unavailable" as const, message: "This build runs from a source checkout. Use an installed OpenCode release to check for updates.", } - const version = yield* latest() + const detected = yield* method() + if (!detected) + return { + type: "unavailable" as const, + message: + "Could not detect the installation method. Update with your package manager or download the latest release.", + } + const version = yield* latest(detected) if (!parseReleaseVersion(version)) return yield* Effect.fail(new Error(`Invalid version: ${version}`)) const current = yield* Ref.get(installedVersion) if (action(current, version, "auto") === "none") {