Skip to content

[codex] Add Qwen runtime source options to desktop release#8

Merged
DragonnZhang merged 1 commit into
mainfrom
dragon/add-qwen-runtime-source-options
Jun 8, 2026
Merged

[codex] Add Qwen runtime source options to desktop release#8
DragonnZhang merged 1 commit into
mainfrom
dragon/add-qwen-runtime-source-options

Conversation

@DragonnZhang

Copy link
Copy Markdown
Collaborator

What this PR does

Adds an explicit Qwen Code runtime source selector to the Desktop Release workflow. Release operators can now choose npm_latest, source_branch, or pinned_package_version; source-branch builds check out QwenLM/qwen-code at the requested ref and set QWEN_CODE_ROOT, npm-latest builds set QWEN_CODE_VERSION=latest, and pinned builds continue to use package.json's qwenCodeRuntime.version unless an exact npm version is entered.

The vendoring script now resolves npm dist-tags through package metadata before downloading the tarball, so QWEN_CODE_VERSION=latest resolves to the current npm latest version instead of trying to download a nonexistent qwen-code-latest.tgz file.

Why it's needed

The release UI previously had an optional qwen_code_version text field, but leaving it empty silently packaged the pinned 0.15.11 runtime. That made it too easy to think a desktop release was using the current Qwen Code runtime when it was actually using the package-pinned fallback. The workflow now makes that choice visible and supports the three intended release modes: current npm latest, a Qwen Code source ref, or the pinned runtime version.

Reviewer Test Plan

How to verify

Open the Desktop Release workflow dispatch form and confirm the new qwen_code_source choice contains npm_latest, source_branch, and pinned_package_version. For source_branch, confirm qwen_code_ref controls the QwenLM/qwen-code checkout. For npm_latest, confirm the build logs show the real npm version resolved from the latest dist-tag.

Evidence (Before & After)

Before: running the old vendoring script with QWEN_CODE_VERSION=latest attempted to download https://registry.npmjs.org/@qwen-code/qwen-code/-/qwen-code-latest.tgz and failed with HTTP 404.

After: QWEN_CODE_VERSION=latest bun run scripts/vendor-qwen-code.ts resolved npm latest to 0.17.1 at test time and vendored @qwen-code/[email protected]; the default pinned path vendored 0.15.11; a fake QWEN_CODE_ROOT source checkout smoke test built and vendored a local dist/cli.js.

Tested on

OS Status
🍏 macOS ✅ tested
🪟 Windows ⚠️ not tested locally
🐧 Linux ⚠️ not tested locally

Environment (optional)

Local macOS shell in /Users/dragon/Documents/openwork; Bun 1.3.8, Node 26.0.0, npm 11.12.1.

Risk & Scope

  • Main risk or tradeoff: source_branch builds clone and install Qwen Code source dependencies in every platform job, which is straightforward but slower than prebuilding the runtime once and sharing it across the matrix.
  • Not validated / out of scope: a full hosted Desktop Release run with source_branch has not completed yet.
  • Breaking changes / migration notes: the old empty qwen_code_version behavior is preserved under pinned_package_version, which remains the default.

Linked Issues

References the desktop release workflow follow-up from #5, #6, and #7.

中文说明

What this PR does

这个 PR 给 Desktop Release workflow 加了明确的 Qwen Code runtime source 选择。发版时现在可以选择 npm_latestsource_branchpinned_package_version;source-branch 会 checkout 指定 ref 的 QwenLM/qwen-code 并设置 QWEN_CODE_ROOT,npm-latest 会设置 QWEN_CODE_VERSION=latest,pinned 则继续使用 package.json 里的 qwenCodeRuntime.version,除非额外填写一个精确 npm version。

vendoring 脚本现在会先通过 npm package metadata 解析 dist-tag,再下载 tarball,所以 QWEN_CODE_VERSION=latest 会解析成当前 npm latest 对应的真实版本,而不是去下载不存在的 qwen-code-latest.tgz

Why it's needed

之前发版 UI 只有一个可选的 qwen_code_version 文本框,不填就会静默打包 package 里 pinned 的 0.15.11 runtime。这样很容易以为桌面版用了当前 Qwen Code runtime,但实际用了固定 fallback。现在 workflow 把这个选择显式暴露出来,并支持三种预期模式:当前 npm latest、某个 Qwen Code 源码 ref、或者 pinned runtime version。

Reviewer Test Plan

How to verify

打开 Desktop Release workflow 的手动触发表单,确认新的 qwen_code_source 选项包含 npm_latestsource_branchpinned_package_version。选择 source_branch 时,确认 qwen_code_ref 控制 QwenLM/qwen-code checkout。选择 npm_latest 时,确认 build log 会显示从 latest dist-tag 解析出的真实 npm 版本。

Evidence (Before & After)

Before: 旧脚本在 QWEN_CODE_VERSION=latest 时会尝试下载 https://registry.npmjs.org/@qwen-code/qwen-code/-/qwen-code-latest.tgz,并因 HTTP 404 失败。

After: QWEN_CODE_VERSION=latest bun run scripts/vendor-qwen-code.ts 在测试时把 npm latest 解析为 0.17.1,并成功 vendor @qwen-code/[email protected];默认 pinned 路径 vendor 了 0.15.11;fake QWEN_CODE_ROOT source checkout smoke test 也能 build 并 vendor 本地 dist/cli.js

Tested on

OS Status
🍏 macOS ✅ tested
🪟 Windows ⚠️ not tested locally
🐧 Linux ⚠️ not tested locally

Environment (optional)

本地 macOS shell,目录 /Users/dragon/Documents/openwork;Bun 1.3.8,Node 26.0.0,npm 11.12.1。

Risk & Scope

  • Main risk or tradeoff: source_branch 会在每个平台 job 里 clone 并安装 Qwen Code 源码依赖,逻辑直接但比预先构建一次 runtime 再分发给 matrix 更慢。
  • Not validated / out of scope: 还没有完整跑过一次 hosted Desktop Release 的 source_branch 模式。
  • Breaking changes / migration notes: 旧的空 qwen_code_version 行为保留在默认的 pinned_package_version 下。

Linked Issues

References desktop release workflow 从 #5#6#7 延续下来的后续改进。

@DragonnZhang DragonnZhang merged commit 8bf2158 into main Jun 8, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant