From d87950e1d7986a77950265b9930d2910a2671664 Mon Sep 17 00:00:00 2001 From: Lihang Zhang <70703489+Alarak-Alex@users.noreply.github.com> Date: Wed, 21 Oct 2026 00:41:26 +0800 Subject: [PATCH] qoder: claim the desktop app's Cosy-Version 1.1.69, not the CLI's 1.1.49 (#281) Cosy-ClientType 10 says the desktop app, so Cosy-Version (and the signature's cosyVersion and the session's business.version, which share the constant) now carry the version that app's worker runtime sends: 1.1.69, not the CLI's 1.1.49. Verified at the reviewed head 62c3f162ba06100383f765c601044cbcbc725364: - Qoder's update feed (download.qoder.com.cn/qoder-app/releases/latest-mac.yml) names 0.4.8, build 79743374, released 2026-10-14. Range-read app.asar out of that release's Qoder-mac-arm64.zip: its transport config says "qoderCliVersion": "1.1.69", "sdkVersion": "1.0.52". The locally installed 0.4.3 says 1.1.64, so the number does follow the app. - The 1.1.69 worker runtime (download.qoder.com/qodercli/releases/1.1.69/qodercli-worker-runtime-darwin-arm64.tgz, runtime-info.json version 1.1.69) sets "Cosy-Version" from its own version constant ("1.1.69") in its header middleware, so the desktop app's requests carry 1.1.69. - packages/qoder `bun test` at the PR head: 157 pass, 0 fail; with the change applied on main e2c3a35: 166 pass, 0 fail. - Not tried: a live chat request with 1.1.69 against a real Qoder account. --- packages/qoder/index.mjs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/qoder/index.mjs b/packages/qoder/index.mjs index 399ec37..e3e0c8a 100644 --- a/packages/qoder/index.mjs +++ b/packages/qoder/index.mjs @@ -43,7 +43,14 @@ import { join, resolve } from "node:path" const CHAT_PATH = "/algo/api/v2/service/pro/sse/agent_chat_generation?FetchKeys=llm_model_result&AgentId=agent_common&Encode=1" const MODELS_PATH = "/algo/api/v2/model/list?Encode=1" -const COSY_VERSION = "1.1.49" +// The build the envelope claims. It has to be the one Qoder's desktop app +// talks through — the worker runtime bundled in the app — because the +// envelope also says Cosy-ClientType: 10 (desktop) and carries that app's +// machine identity; the CLI's channel publishes a different, later number +// that no desktop build runs. Taken from app 0.4.8 (build 79743374, +// 2026-10-14), whose transport config names 1.1.69. Raise it when the app +// moves, not when the CLI does. +const COSY_VERSION = "1.1.69" const SIGN_IN_TIMEOUT = 15 * 60 * 1000 const REFRESH_LEAD = 5 * 60 * 1000 // a chat token this close to its end is refreshed before a request const RENEW_LEAD = 10 * 60 * 1000 // and this close, magpie renews it ahead of time (auth.refresh)