From 8652729fdbff35da592e31c7ffaa90162f2eb293 Mon Sep 17 00:00:00 2001 From: "opencode-agent[bot]" <219766164+opencode-agent[bot]@users.noreply.github.com> Date: Thu, 24 Sep 2026 15:44:20 +1000 Subject: [PATCH] fix(desktop): identify updater requests (#50445) Co-authored-by: Dax <826656+thdxr@users.noreply.github.com> --- packages/desktop/src/main/updater/platform.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/desktop/src/main/updater/platform.ts b/packages/desktop/src/main/updater/platform.ts index a75ddaa4d51..1c4b6f5bee6 100644 --- a/packages/desktop/src/main/updater/platform.ts +++ b/packages/desktop/src/main/updater/platform.ts @@ -13,6 +13,7 @@ const stableArtifact = "https://opencode.ai/update/api/latest/desktop/opencode" export const make = Effect.gen(function* () { const external = requiresStableMacInstaller(process.platform, CHANNEL) + const userAgent = `opencode/${CHANNEL === "prod" ? "latest" : CHANNEL}/${app.getVersion()}/desktop` const runFork = Effect.runForkWith(yield* Effect.context()) updateClient.logger = { info: (...args) => runFork(Effect.logInfo(...args)), @@ -21,6 +22,7 @@ export const make = Effect.gen(function* () { debug: (...args) => runFork(Effect.logDebug(...args)), } updateClient.channel = "latest" + updateClient.requestHeaders = { "User-Agent": userAgent } updateClient.allowPrerelease = false updateClient.allowDowngrade = true updateClient.autoDownload = false @@ -38,7 +40,7 @@ export const make = Effect.gen(function* () { checkForUpdate: Effect.tryPromise({ try: async () => { if (external) { - const response = await fetch(stableArtifact) + const response = await fetch(stableArtifact, { headers: { "User-Agent": userAgent } }) if (!response.ok) throw new Error(`Stable OpenCode update check failed: ${response.status}`) const download = stableMacDownload(await response.json(), process.arch) if (!download) throw new Error("Stable OpenCode download is unavailable")