Skip to content

fix(extensions): reject http archive URLs with an actionable error instead of attempting a git clone - #12697

Merged
wenshao merged 6 commits into
QwenLM:mainfrom
liwenjie200543:fix/extension-archive-http-clear-error
Sep 26, 2026
Merged

wenshao merged 6 commits into
QwenLM:mainfrom
liwenjie200543:fix/extension-archive-http-clear-error

Conversation

@liwenjie200543

@liwenjie200543 liwenjie200543 commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

What this PR does

When a user installs an extension from an archive URL served over plain http://, parseInstallSource() now rejects it immediately with a typed InsecureArchiveUrlError (exported from marketplace.ts) carrying an actionable message:

Archive URLs must use https:// (got http://example.com/releases/extension.zip). Re-download the archive from an HTTPS URL — or, if this is a Git repository whose name ends in an archive extension, use its git@/SSH remote, or clone it into a directory whose name does not end in .zip or .tar.gz and install from that local path.

Previously the request was misrouted into the git-clone path and failed downstream with a confusing Failed to clone Git repository from <...>.zip error. Plain http:// Git URLs and non-http transports isGitUrl admits (e.g. sso://) keep working exactly as before. Two supporting changes:

  • github.ts exports isArchiveShapedUrl (built on getSupportedArchiveExtension), so the insecure-scheme rejection shares its URL→pathname classification with the archive-vs-git routing and cannot drift from it.
  • ExtensionManager.addSource rethrows the policy rejection instead of burying it under No marketplace found at ... when the input is an insecure archive URL.

Why it's needed

Archive downloads are HTTPS-only by design: isSupportedArchiveUrl() accepts only https: URLs. But isGitUrl() accepts http://, so an archive link over http:// skips the archive branch, gets classified as a git source, and fails downstream with an error that names git and says nothing about the real problem (the scheme). Reproduced on the 0.24.5 npm build, Windows 11:

$ qwen extensions install http://127.0.0.1:8765/rtk-mcp-qwen-extension.zip --consent
Failed to clone Git repository from http://127.0.0.1:8765/rtk-mcp-qwen-extension.zip Cloning into '.'...
fatal: http://127.0.0.1:8765/rtk-mcp-qwen-extension.zip/info/refs not valid: could not determine hash algorithm; is this a git repository?

With this change the same command fails fast with the message above.

Reviewer Test Plan

How to verify

Run the extension marketplace unit tests: npm run test --workspace=@qwen-code/qwen-code -- src/extension/marketplace.test.ts (or the vitest equivalent). Expected: 42 tests pass in that file; the three touched suites total 376 passing. The message body is pinned end-to-end (^...$) in marketplace.test.ts, and the sso:// non-http-transport case, the credential-redaction case, and the unparseable-URL fallthrough each have their own discriminating tests.

Evidence (Before & After)

Before (0.24.5 npm build, real run):

$ qwen extensions install http://127.0.0.1:8765/rtk-mcp-qwen-extension.zip --consent
Failed to clone Git repository from http://127.0.0.1:8765/rtk-mcp-qwen-extension.zip Cloning into '.'...
fatal: ...info/refs not valid: could not determine hash algorithm; is this a git repository?

After (real CLI run during independent real-environment verification, and asserted by the unit suite):

Archive URLs must use https:// (got http://127.0.0.1:8765/rtk-mcp-qwen-extension.zip). Re-download the archive from an HTTPS URL — or, if this is a Git repository whose name ends in an archive extension, use its git@/SSH remote, or clone it into a directory whose name does not end in .zip or .tar.gz and install from that local path.

The git@/SSH remedy was verified end-to-end against a fake ssh serving git-upload-pack; the local-path remedy wording reflects the measured EISDIR behavior of installing from a directory named *.zip (pre-existing on main, see Risk & Scope).

Tested on

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

Windows 11 / Node 22: differential repros on 0.22.3 and 0.24.5 npm builds plus the unit suites. macOS 26.6.2 arm64: all three rounds of the independent real-environment verification (real git http-backend, request ledger, TUI in tmux) ran there, covering the CLI/TUI matrix, the upgrade path, and both remedies. Linux not exercised; this is a URL-classification path with no platform-specific logic.

Environment (optional)

Local vitest run on Windows 11, Node 22. Differential repros used the published npm builds (0.22.3 / 0.24.5) against a local HTTPS server serving a test extension archive.

Risk & Scope

  • Main risk or tradeoff: http:// archive URLs are now rejected outright. No working use case is broken — the same input already failed with the confusing git-clone error, because the archive downloader is HTTPS-only. The one narrow exception (a git repository whose name ends in an archive extension, served over http) keeps two working remedies: the git@/SSH remote, and cloning into a directory not named *.zip/*.tar.gz.
  • Known pre-existing behavior (unchanged by this PR, now documented by the message): installExtension chooses archive extraction by name for local sources, so installing from a directory named *.zip fails with EISDIR (extensionManager.ts:2387, same on main). The same case-sensitivity mismatch surfaces independently of directories: archive routing matches extensions case-insensitively (getSupportedArchiveExtensionFromPathname lowercases the pathname, github.ts:86-102) while the extraction dispatch is case-sensitive (extractFile, github.ts:1353/1371), so an https:// URL or a local file ending in .ZIP fails with Unsupported file extension for extraction. A follow-up PR should extract only regular files and dispatch on the lowercased extension, covering installExtension and checkForExtensionUpdate — that would close the EISDIR case and the *.ZIP mismatch together.
  • Not validated / out of scope: not run on Linux; the silent exit-0 symptom reported in qwen extensions install from .zip URL silently exits 0 without installing (Windows 11, v0.22.3) #10742 on the official-installer build is not reproduced by this path (npm-build differential repros show loud failures), so this PR does not claim to fix it.
  • Breaking changes / migration notes: the http:// archive case changes from a late, confusing git error to an immediate, typed rejection. No other successful install path changes behavior — with one narrow exception spelled out in the Risk section above: a git repository whose name ends in an archive extension, served over http://, previously installed successfully and is now refused (the message offers two working remedies for it).

Linked Issues

Refs #10742, #10741

中文说明

这个 PR 做了什么

当用户通过纯 http:// 的归档 URL 安装扩展时,parseInstallSource() 现在会立即拒绝,并抛出从 marketplace.ts 导出的类型化错误 InsecureArchiveUrlError,附可操作的错误信息:

Archive URLs must use https:// (got http://example.com/releases/extension.zip). Re-download the archive from an HTTPS URL — or, if this is a Git repository whose name ends in an archive extension, use its git@/SSH remote, or clone it into a directory whose name does not end in .zip or .tar.gz and install from that local path.

此前请求会被误路由到 git clone 路径,之后才以令人困惑的 Failed to clone Git repository from <...>.zip 错误失败。普通 http:// Git URL 以及 isGitUrl 接受的其他非 http 传输方式(如 sso://)行为完全不变。两项配套修改:

  • github.ts 导出 isArchiveShapedUrl(基于 getSupportedArchiveExtension),使不安全协议拒绝与归档/git 分类共享同一套 URL→pathname 判定,不会漂移。
  • ExtensionManager.addSource 在输入是不安全归档 URL 时重新抛出策略拒绝,而不是用 No marketplace found at ... 掩盖真实原因。

为什么需要

归档下载在设计上仅支持 HTTPS:isSupportedArchiveUrl() 只接受 https: URL。但 isGitUrl() 同时接受 http://,因此 http:// 的归档链接会跳过归档分支、被归类为 git 来源,然后在下游失败,报错只提 git、完全没提到真正的问题(协议方案)。在 0.24.5 npm 版本(Windows 11)上复现:

$ qwen extensions install http://127.0.0.1:8765/rtk-mcp-qwen-extension.zip --consent
Failed to clone Git repository from http://127.0.0.1:8765/rtk-mcp-qwen-extension.zip Cloning into '.'...
fatal: http://127.0.0.1:8765/rtk-mcp-qwen-extension.zip/info/refs not valid: could not determine hash algorithm; is this a git repository?

修改后,同样的命令会快速失败,并给出上面的错误信息。

审阅者测试计划

如何验证

运行扩展市场单元测试:npm run test --workspace=@qwen-code/qwen-code -- src/extension/marketplace.test.ts(或等效的 vitest 命令)。预期:该文件 42 个测试全部通过;三个涉及的套件合计 376 个通过。错误消息在 marketplace.test.ts 中被全串锚定(^...$)钉住;sso:// 非 http 传输、凭据脱敏、不可解析 URL 回落各有独立的判别测试。

证据(修改前与修改后)

修改前(0.24.5 npm 版本,真实运行):

$ qwen extensions install http://127.0.0.1:8765/rtk-mcp-qwen-extension.zip --consent
Failed to clone Git repository from http://127.0.0.1:8765/rtk-mcp-qwen-extension.zip Cloning into '.'...
fatal: ...info/refs not valid: could not determine hash algorithm; is this a git repository?

修改后(独立真实环境验证中的真实 CLI 运行,同时由单元测试断言):

Archive URLs must use https:// (got http://127.0.0.1:8765/rtk-mcp-qwen-extension.zip). Re-download the archive from an HTTPS URL — or, if this is a Git repository whose name ends in an archive extension, use its git@/SSH remote, or clone it into a directory whose name does not end in .zip or .tar.gz and install from that local path.

git@/SSH 补救办法已用假 ssh(本地 git-upload-pack)端到端验证;本地路径补救措辞反映了从 *.zip 命名目录安装时的实测 EISDIR 行为(main 上预存,见风险与范围)。

测试平台

操作系统 状态
🍏 macOS ✅ 已测试
🪟 Windows ✅ 已测试
🐧 Linux ⚠️ 未测试

Windows 11 / Node 22:在 0.22.3 与 0.24.5 npm 版本上做了差分复现,并完整运行单元套件。macOS 26.6.2 arm64:独立真实环境验证(真实 git http-backend、请求台账、tmux 中的 TUI)的全部三轮都在该平台运行,覆盖 CLI/TUI 矩阵、升级路径和两条补救办法。Linux 未运行;这是 URL 分类路径,没有平台特定逻辑。

环境(可选)

Windows 11、Node 22 上本地 vitest run。差分复现使用已发布的 npm 版本(0.22.3 / 0.24.5),配合本地 HTTPS 服务器提供测试扩展归档。

风险与范围

  • 主要风险或取舍:http:// 归档 URL 现在被直接拒绝。没有破坏任何可用的场景 —— 相同输入此前本来就会以令人困惑的 git clone 错误失败,因为归档下载器仅支持 HTTPS。唯一的窄例外(名字以归档扩展名结尾、经 http 提供的 git 仓库)保留两条可行的补救:git@/SSH 远端,以及 clone 到名字不以 *.zip/*.tar.gz 结尾的目录。
  • 已知的预存行为(本 PR 未改变,已由错误信息说明):installExtension 对本地来源按名称选择归档解压,因此从名为 *.zip 的目录安装会以 EISDIR 失败(extensionManager.ts:2387,main 上相同)。同一个大小写不一致还会独立于目录出现:归档路由对扩展名不区分大小写(getSupportedArchiveExtensionFromPathname 会把 pathname 转小写,github.ts:86-102),而解压分派区分大小写(extractFile,github.ts:1353/1371),因此以 .ZIP 结尾的 https:// URL 或本地文件会报 Unsupported file extension for extraction。后续 PR 应改为只解压普通文件、并按小写扩展名分派,覆盖 installExtension 与 checkForExtensionUpdate —— 这样可以把 EISDIR 场景和 *.ZIP 不一致一起解决。
  • 未验证 / 超出范围:未在 Linux 运行;官方安装器版本中 qwen extensions install from .zip URL silently exits 0 without installing (Windows 11, v0.22.3) #10742 报告的静默 exit-0 症状并非由该路径复现(npm 版本差分复现均为响亮失败),因此本 PR 不声称修复它。
  • 破坏性变更 / 迁移说明:http:// 归档场景从滞后的、令人困惑的 git 错误变为立即的、类型化的拒绝。其余任何成功的安装路径行为均未改变 —— 唯一的窄例外已在上方风险条目中写明:名字以归档扩展名结尾、经 http:// 提供的 git 仓库此前能安装成功,现在会被拒绝(报错信息为它提供了两条可行的补救办法)。

关联 Issue

Refs #10742, #10741

…stead of attempting a git clone

Archive downloads are HTTPS-only (isSupportedArchiveUrl), but isGitUrl also accepts http://, so an archive link served over http:// falls through to the git path and fails with a confusing clone error. Guard the git branch: if an http:// URL points at a supported archive path, throw an actionable error telling the user to re-download from HTTPS. The URL pathname is matched so query strings cannot hide the archive extension.
@liwenjie200543

Copy link
Copy Markdown
Contributor Author

Description rewritten to follow the repository PR template (What this PR does / Why it's needed / Reviewer Test Plan with the Before & After evidence and the OS matrix / Risk & Scope / Linked Issues). Per your notes: Tested on now states macOS/Linux as ⚠️ not tested (URL-classification path, no platform-specific logic), and Risk & Scope makes the tradeoff explicit — the http:// archive path already failed with the confusing git error, so no working use case is broken by the explicit rejection. Ready for the code review pass.

…tations, keep diagnostics

Round-1 review follow-ups (all four suggestions):

- R1-2: wrap the pathname parse in try/catch so an unparseable http:// URL keeps falling through to the git path (whose error names the source) instead of surfacing a bare TypeError: Invalid URL. Matches the defensive parsing of the sibling helpers in github.ts.
- R1-3: the error now also names the git-remote reading — a plain-http Git repository whose name ends in an archive extension is a real (if narrow) case, so the message offers https:// or git@ remotes as the way out instead of implying an archive re-download is the only option.
- R1-1: add tests for the uppercase-scheme, fragment-hiding and credential-redaction mutations the review measured as surviving; also pin the unparseable-URL fallthrough and the git-reading wording.
- R1-4: ExtensionManager.addSource now rethrows the archive-scheme policy rejection instead of burying it under a misleading No-marketplace-found error; addSource test pins the new behavior.

marketplace.test.ts: 41/41 passed locally (Windows 11, Node 22). extensionManager.test.ts: 172 passed, 1 pre-existing Windows symlink-permission (EPERM) failure unrelated to this change.
@liwenjie200543

Copy link
Copy Markdown
Contributor Author

All four suggestions addressed in 90e38ca — thank you for the mutation-testing evidence, it made triage trivial:

  • R1-2 (unguarded new URL): adopted the defensive-parse fix as written — an unparseable http:// URL now keeps falling through to the git path. Pinned by a new test: parseInstallSource('http://exa mple.com/plugin.zip') resolves to type: 'git' (removing the try/catch turns it red with TypeError: Invalid URL).
  • R1-3 (git repo named .zip): adopted the wording fix — the error now adds "or, if this is a Git repository whose name ends in an archive extension, use an https:// or git@ remote." while preserving the Archive URLs must use https:// prefix both existing assertions pin. Pinned by a new test asserting the git-reading clause for http://example.com:8080/team/tools.zip.
  • R1-1 (mutation coverage): added the three suggested cases — uppercase HTTP:// scheme with .tar.gz, fragment after the extension, and credential redaction asserting the ***REDACTED*** literal from redaction.ts — plus the two pins above; isSupportedArchivePath double left at full .zip/.tar.gz breadth.
  • R1-4 (addSource probe): the probe now records the caught error and rethrows it when it is the archive-scheme policy rejection, so the user sees the real reason instead of No marketplace found at .... New addSource test asserts manager.addSource('http://example.com/plugin.zip') rejects with /must use https:/ (red before the fix, which produced No marketplace found at ...).

Local: marketplace.test.ts 41/41 passed (Windows 11, Node 22). extensionManager.test.ts 172 passed; the one failure is a pre-existing Windows symlink-permission (EPERM) case in refreshCatalogSnapshot, unrelated to this change.

@wenshao

wenshao commented Sep 25, 2026

Copy link
Copy Markdown
Collaborator

Real-environment verification: PR #12697 @ 90e38ca4

For merge: the core fix is correct and safe in the real CLI and TUI. On an http:// archive URL it fails fast with a clear message and makes zero network requests; https installs, plain-http git installs and upgrades of existing installs are unchanged. Two small fix-induced items from round 2 are worth one more short round before merge: the error message's https:// remedy misleads users, and the new unit test makes a live internet request. The rest are optional.

The round-2 bot review (review, 18:14 UTC on 90e38ca4) landed while this run was in progress. Where our findings overlap, this report adds real-CLI and runtime evidence and links the bot's thread rather than filing a duplicate.

Setup

  • Two arms built from source on macOS 26.6.2 arm64, Node 24.18.1, git 2.55.0. BASE is the merge-base c9a9a8ad; PR is head 90e38ca4. The PR merges cleanly into current main (53afcb69), and none of main's 6 newer commits touch packages/core/src/extension/. Each arm was built with npm run build && npm run bundle and run as node dist/cli.js.
  • A local origin with a request ledger served a real extension archive (probe-archive-ext, .zip and .tar.gz) and real git smart-HTTP via git http-backend (bare repos probe-git, tools.zip, bundle.zip.git). It listened on http://127.0.0.1:18697 and on https://127.0.0.1:18698, the latter behind a local CA passed in through NODE_EXTRA_CA_CERTS / GIT_SSL_CAINFO.
  • Every run used a fresh HOME, QWEN_HOME and QWEN_RUNTIME_DIR under env -i, with no proxy variables. The TUI ran in its own tmux socket.

1. The fix in the real TUI

TUI before/after

BASE sends the archive to git clone. The origin logs GET /files/probe-archive-ext.zip/info/refs?service=git-upload-pack → 404, and the error only talks about git. The PR rejects the source inside parseInstallSource() with zero requests to the origin, and the message names the real problem: the scheme.

2. Real CLI matrix (both arms)

CLI matrix

Scenario Result
Issue shape (A–E): http://…zip, .tar.gz, ?token=1, HTTP://, user:token@ Fixed. BASE fails in git clone; row C reproduces the issue's exact could not determine hash algorithm. PR fails immediately with Archive URLs must use https://, 0 requests, credentials printed as ***REDACTED***.
R1-2 (K1/K2): malformed http://exa mple.com/plugin.zip, port :99999 Holds. Output is identical to BASE; no bare Invalid URL.
R1-4 (L1): extensions sources add http://…zip Holds. BASE says "looks like a single extension…"; PR gives the real https reason. https://…zip, http git and garbage input (L2–L4) are unchanged.
Happy paths (F/G): https://…zip, plain http:// git Unchanged; both arms install.
Upgrade (N): installed from http://…/git/tools.zip on BASE, remote bumped, then extensions update with the PR build Safe. It updates 1.0.0 → 1.0.1. update does not call parseInstallSource, so the R1-3 trade-off affects new installs only.
R1-3 trade-off (H/J1): real git repos at http://…/git/tools.zip and …/bundle.zip As the author accepted: BASE installs, PR refuses.

The daemon and Web Shell install routes are unaffected. They reject any non-https: source with `source` must use https (parseExtensionInstallSource in serve/routes/workspace-extensions.ts) before parseInstallSource runs. I confirmed this by reading the code, not with a live daemon.

3. Tests, lint, mutation

  • packages/core/src/extension/: 887/887 across 28 files. marketplace.test.ts now has 41 tests (33 on BASE). ESLint --max-warnings 0, Prettier and tsc --noEmit (core) are all clean on the 4 changed files.
  • Mutation matrix: 8 of 9 mutants killed. As a control, reverting both source files to BASE turns 7 of the new tests red.

Mutation matrix

Round-2 findings: runtime evidence

a. R1-3 (fix-induced), the https:// remedy in the message: confirmed, and a measured alternative. Row I shows the https spelling of a git repo named tools.zip being classified as an archive, failing with Failed to download archive … status code 404 on both arms. Besides the bot's "clone it locally" fallback, appending .git also works: rows J2 (http) and O (https) both install on the PR, provided the server resolves the suffix. git http-backend does for bare repos stored as *.git, and GitHub, GitLab and Gitea all accept it. A bare repo stored literally as tools.zip returns 404 for tools.zip.git. Candidate wording for marketplace.ts, checked locally: all 217 tests in the two files stay green, including both Archive URLs must use https:// prefix assertions and the git-clause assertion:

`Re-download the archive from an HTTPS URL — or, if this is a Git ` +
  `repository whose name ends in an archive extension, append \`.git\` ` +
  `to the URL or use a git@ remote.`,

b. R1-4 (fix-induced), the new addSource test goes online: confirmed. Running that single test with NODE_DEBUG=http on the PR arm logs createConnection example.com:80 → sockets example.com:80: 1 1. The same test on BASE opens no socket. I did not reproduce the blackholed-egress timeout.

c. R2-1, the new addSource comment is contradicted at runtime: confirmed. The comment says the tool "never even tried to fetch" a marketplace.json. In row L1 the origin ledger shows the PR's sources add http://…zip making 1 cleartext GET /files/probe-archive-ext.zip → 200 before it rejects, which matches BASE. The fetch itself predates this PR; only the comment is wrong.

d. R2-2, the narrow addSource rethrow is unpinned: confirmed by mutation. Mutant M2, which rethrows every probe error, survives with 217/217 green. Under M2, sources add invalid-format-no-slash would print Install source not found: … instead of No marketplace found at "…". Three lines next to the new assertion kill it (checked: green on the PR, red on M2):

await expect(manager.addSource('invalid-format-no-slash')).rejects.toThrow(
  /^No marketplace found at "invalid-format-no-slash"/,
);

R2-3 (pathname derivation duplicated from github.ts) is a design point I did not measure.

Before merging (housekeeping)

  • The PR body is out of date. It still says "36 tests pass, including 3 new ones"; the file now has 41 (8 new, plus 1 new test in extensionManager.test.ts). Its "After" message is missing the git clause, and it doesn't mention the addSource change in extensionManager.ts. Risk & Scope still says "No successful install path changes behavior", which rows H/J1 contradict. The author's reply (comment) acknowledged this, but the body was not updated.
  • reviewDecision is still CHANGES_REQUESTED. It comes from the triage template gate (review on f3e3c987), filed before the body was rewritten. It clears only when the bot approves on a re-run or a maintainer dismisses it. CI on 90e38ca4 is otherwise green: Test (ubuntu-latest, Node 22.x), Lint & Static and review-pr all passed.

Unrelated to this PR and seen on both arms: the successful archive install (row F) prints a Node DEP0005 Buffer() deprecation warning.

中文说明

真实环境验证:PR #12697 @ 90e38ca4

合并参考: 核心修复在真实 CLI 和 TUI 中正确且安全。遇到 http:// 归档 URL 时它会立即失败,给出清晰的报错,且网络请求数为零;https 安装、普通 http git 安装以及已有安装的升级都不受影响。第二轮评审中有两处由修复引入的小问题,值得在合入前再走一小轮:一是报错里的 https:// 补救办法会误导用户,二是新增的单元测试会真实访问外网。其余几项可选。

第二轮机器人评审(review,18:14 UTC,针对 90e38ca4)是在本次实测过程中发布的。与之重合的发现,本报告只补充真实 CLI 和运行时证据,并链接到机器人的原帖,不再重复提出。

环境

  • 两个臂都在 macOS 26.6.2 arm64、Node 24.18.1、git 2.55.0 上从源码构建:BASE 是 merge-base c9a9a8ad,PR 是 head 90e38ca4。PR 能干净合入当前 main(53afcb69),main 新增的 6 个提交都没有改动 packages/core/src/extension/。每个臂执行 npm run build && npm run bundle,以 node dist/cli.js 运行。
  • 本地源站自带请求台账。它提供一个真实扩展归档(probe-archive-ext,.zip 与 .tar.gz 两种),以及通过 git http-backend 实现的真实 git smart-HTTP(裸仓库 probe-git、tools.zip、bundle.zip.git),同时监听 http://127.0.0.1:18697 和 https://127.0.0.1:18698。后者使用本地 CA,通过 NODE_EXTRA_CA_CERTS / GIT_SSL_CAINFO 传入。
  • 每次运行都在 env -i 下使用全新的 HOME、QWEN_HOME 和 QWEN_RUNTIME_DIR,不带任何代理变量。TUI 在独立的 tmux socket 中运行。

1. 真实 TUI 中的修复效果

见上方第一张图。BASE 把归档交给了 git clone:源站记录到 GET /files/probe-archive-ext.zip/info/refs?service=git-upload-pack → 404,报错内容只涉及 git。PR 在 parseInstallSource() 内就拒绝了该来源,对源站的请求数为 0,并且报错直接指出了真正的问题:协议。

2. 真实 CLI 矩阵(两个臂)

场景 结果
issue 形态(A–E):http://…zip、.tar.gz、?token=1、HTTP://、user:token@ 已修复。 BASE 在 git clone 阶段失败,其中 C 行复现了 issue 原文的 could not determine hash algorithm。PR 立即报 Archive URLs must use https://,请求数 0,凭据显示为 ***REDACTED***。
R1-2(K1/K2):畸形的 http://exa mple.com/plugin.zip、端口 :99999 成立。 输出与 BASE 完全相同,不再出现孤零零的 Invalid URL。
R1-4(L1):extensions sources add http://…zip 成立。 BASE 报「looks like a single extension…」,PR 报真实的 https 原因。https://…zip、http git 和无法识别的输入(L2–L4)行为不变。
正常路径(F/G):https://…zip、普通 http:// git 不变,两个臂都能安装。
升级(N):先用 BASE 从 http://…/git/tools.zip 安装,远端提升版本后,用 PR 构建执行 extensions update 安全。 成功更新 1.0.0 → 1.0.1。update 不经过 parseInstallSource,所以 R1-3 的取舍只影响新安装。
R1-3 取舍(H/J1):真实 git 仓库 http://…/git/tools.zip 与 …/bundle.zip 与作者接受的一致:BASE 能装,PR 拒绝。

daemon 和 Web Shell 的安装路由不受影响:它们在调用 parseInstallSource 之前就会以 `source` must use https 拒绝所有非 https: 来源(见 serve/routes/workspace-extensions.ts 的 parseExtensionInstallSource)。这一点是读代码确认的,没有起真实 daemon 验证。

3. 测试、lint 与变异

  • packages/core/src/extension/:28 个文件共 887/887 通过。marketplace.test.ts 现有 41 个用例(BASE 为 33 个)。4 个改动文件的 ESLint --max-warnings 0、Prettier 和 core 的 tsc --noEmit 全部通过。
  • 变异矩阵:9 个变异体中 8 个被杀死。作为对照,把两个源文件回退到 BASE 后有 7 个新用例变红。

第二轮发现:运行时证据

a. R1-3(修复引入),报错中的 https:// 补救办法:已实测证实,并给出一个经过实测的替代方案。 I 行显示,名为 tools.zip 的 git 仓库改用 https 写法后被判定为归档,在两个臂上都报 Failed to download archive … status code 404。除了机器人提出的「先在本地 clone」这条退路,在 URL 末尾加 .git 同样可行:J2(http)和 O(https)在 PR 上都能安装成功,前提是服务端能解析这个后缀。git http-backend 在裸仓库以 *.git 存储时可以,GitHub、GitLab、Gitea 也都接受。若裸仓库在磁盘上就叫 tools.zip,请求 tools.zip.git 会得到 404。上方给出的候选文案已在本地验证:两个测试文件共 217 个用例保持全绿,包括两处 Archive URLs must use https:// 前缀断言和针对 git 分句的断言。

b. R1-4(修复引入),新增的 addSource 测试会联网:已证实。 在 PR 臂上用 NODE_DEBUG=http 单独运行该用例,日志中出现 createConnection example.com:80 → sockets example.com:80: 1 1;BASE 上的同名用例不会建立任何 socket。出站流量被黑洞时的超时问题我没有复现。

c. R2-1,新增的 addSource 注释与运行时行为不符:已证实。 注释说工具「never even tried to fetch」marketplace.json。但在 L1 行中,源站台账显示 PR 执行 sources add http://…zip 时,在拒绝之前发出了 1 次明文 GET /files/probe-archive-ext.zip → 200,与 BASE 相同。这次请求本身在本 PR 之前就存在,只是注释写错了。

d. R2-2,addSource 只重抛 https 拒绝的收窄行为没有被钉住:变异实测证实。 变异体 M2(重抛所有探测错误)存活,217/217 全绿。在 M2 下,sources add invalid-format-no-slash 会输出 Install source not found: …,而不是 No marketplace found at "…"。在新断言旁加上方那 3 行即可杀死 M2(已验证:PR 上通过,M2 上变红)。

R2-3(从 github.ts 重复实现 pathname 推导)属于设计层面的问题,本次没有实测。

合并前收尾

  • PR 描述已过期。 仍写着「36 tests pass, including 3 new ones」,而该文件现在有 41 个用例(新增 8 个,另有 1 个新用例在 extensionManager.test.ts)。「After」中的报错缺少 git 分句,也没有提到 extensionManager.ts 中 addSource 的改动。Risk & Scope 仍写着「No successful install path changes behavior」,与 H/J1 行的实测结果矛盾。作者在回复(comment)中承认了这些,但描述本身没有更新。
  • reviewDecision 仍为 CHANGES_REQUESTED。 它来自 triage 的模板门禁(review,提交于 f3e3c987),早于描述重写。只有机器人在重新运行后 APPROVE,或维护者 dismiss,才能清除。除此之外,90e38ca4 上的 CI 全部通过:Test (ubuntu-latest, Node 22.x)、Lint & Static 和 review-pr 均为绿色。

与本 PR 无关、两个臂都能看到:成功安装归档时(F 行)Node 会打印一条 DEP0005 Buffer() 弃用警告。

…d error, egress-free test

Round-2 review follow-ups:

- R2-3: export isArchiveShapedUrl from github.ts (single source of truth for the URL-to-pathname archive classification, built on getSupportedArchiveExtension) and collapse the call-site guard to it, so the insecure-scheme rejection can never drift from the archive-vs-git routing it mirrors. Pinned by real-implementation cases in github.test.ts; the marketplace.test.ts stub mirrors the documented semantics.
- R2-2: replace the unexported message-prefix contract with a typed InsecureArchiveUrlError thrown by parseInstallSource and matched via instanceof in ExtensionManager.addSource; tighten the addSource test to toBeInstanceOf and add a negative case pinning that non-archive probe failures still produce the No-marketplace-found guidance.
- R1-3 (fix-induced): the error no longer recommends an https:// remote for a Git repository whose name ends in an archive extension — an https:// URL with an archive pathname is classified as an archive download first — and now names the git@/SSH remote and the clone-locally fallback instead. The git-reading test asserts the new wording and rejects the old advice.
- R1-4 (fix-induced): the addSource test fixture now uses http://127.0.0.1:1 (instant ECONNREFUSED) instead of example.com, so the suite performs no real DNS lookup or outbound HTTP GET.
- R2-1: the rethrow comment in addSource now states what actually happens (the marketplace probe has already attempted the fetch; rethrowing changes only the reported reason).

Local: marketplace.test.ts 41/41, github.test.ts 149 passed + 9 skipped, extensionManager.test.ts 175 passed + 1 pre-existing Windows symlink-permission (EPERM) failure unrelated to this change (Windows 11, Node 22).
@liwenjie200543

Copy link
Copy Markdown
Contributor Author

Round-2 items addressed in ee80598:

  • R1-1 / R1-2 rulings: thank you for re-running the mutants — good to see all four now killed.
  • R1-3 (fix-induced, advice that cannot work): adopted the message-only fix. The error now says "use its git@/SSH remote, or clone it yourself and install from the local path" — naming only remedies that reach an install — and no longer suggests an https:// remote, which the A/B probe showed is classified as an archive download first. The git-reading test asserts the new wording and explicitly rejects the old https:// or git@ remote phrasing.
  • R1-4 (fix-induced, outbound egress): fixture switched to http://127.0.0.1:1/plugin.zip (instant ECONNREFUSED, no DNS, no outbound GET).
  • R2-1 (comment contradicted by the run): the rethrow comment now states what actually happens — the probe has already attempted the fetch, rethrowing changes only the reported reason. The deeper ordering fix (asserting the scheme before the marketplace fetch) is noted as follow-up scope, per your range note that the plaintext fetch predates this diff.
  • R2-2 (unexported prefix contract): the rejection is now a typed InsecureArchiveUrlError exported from marketplace.ts and matched via instanceof in addSource; the message still carries the pinned Archive URLs must use https:// phrase and the redacted URL. The addSource test is tightened to toBeInstanceOf and a network-free negative case pins that invalid-format-no-slash still yields the No marketplace found guidance.
  • R2-3 (re-derived classification): exported isArchiveShapedUrl from github.ts (built on getSupportedArchiveExtension, parse-defensive, extension set unchanged) and collapsed the guard to startsWith('http://') && isArchiveShapedUrl(repo). Real-implementation behavior is pinned in github.test.ts (including the parse-failure → false and the .tar.gz/uppercase/fragment cases); the marketplace.test.ts stub mirrors the documented semantics, as the review's own fix-witness accepted.

Local (Windows 11, Node 22): marketplace.test.ts 41/41 · github.test.ts 149 passed + 9 skipped · extensionManager.test.ts 175 passed + 1 pre-existing Windows symlink-permission (EPERM) failure unrelated to this change.

…rrowing, restore the cross-boundary message pin, assert against the real classifier

Round-3 review follow-ups (all four suggestions; no production change needed):\n\n- R3-1: dropped the inert negative assertion and the second parseInstallSource call feeding it — its regex matched only a literal the implementation never produces. The positive assertion above it pins the remedy clause verbatim, so any rewording (including one re-adding an https:// recommendation) still goes red.\n- R3-2: added the discriminating case for the startsWith('http://') conjunct — sso://git.corp/team/tools.zip (archive-shaped pathname, non-http transport isGitUrl admits) stays type: 'git'. Verified: deleting the conjunct turns this test red.\n- R2-3: the mock factory now builds from importOriginal, so isSupportedArchiveUrl and isArchiveShapedUrl are the real implementations (pure URL predicates, nothing to isolate) and the orphaned isSupportedArchivePath stub member is gone; added the missing query-string pins (?token=1) for both real helpers in github.test.ts.\n- R2-2: the addSource test re-adds the message-body assertion (/Archive URLs must use https:\/\/ (got /) alongside toBeInstanceOf, keeping the loopback fixture. Verified: rewrapping the probe failure with a stripped message turns the suite red.\n\nLocal (Windows 11, Node 22): marketplace.test.ts 42/42, github.test.ts 158 passed + 9 skipped, extensionManager.test.ts 175 passed + 1 pre-existing Windows symlink-permission (EPERM) failure unrelated to this change. Both acceptance-criterion mutations confirmed red before reverting.
@liwenjie200543

Copy link
Copy Markdown
Contributor Author

Round-3 items addressed in a97b019 (test-only; no production change needed):\n\n- R3-1 (inert negative assertion): adopted the drop option — the negative assertion and the second parseInstallSource call feeding it are gone. The positive assertion above it pins the remedy clause verbatim, so a rewording that re-adds an https:// recommendation still turns the suite red, and the redundant second stat mock went with it.\n- R3-2 (unpinned scheme narrowing): added the suggested discriminating case — parseInstallSource('sso://git.corp/team/tools.zip') stays type: 'git' (the fixture is sso://, not git@, per your measurement). Acceptance criterion confirmed: deleting the startsWith('http://') conjunct turns this test red (checked locally before reverting).\n- R2-3 (mock copy vs real classifier): the factory now builds from importOriginal — isSupportedArchiveUrl and isArchiveShapedUrl are the real implementations (the earlier hang I'd hit with this shape was a stale vite cache; cleared and re-verified), the orphaned isSupportedArchivePath stub member is gone, and the missing query-string pins (?token=1 for both real helpers) were added to github.test.ts. The suite that owns the policy now asserts against the actual classifier.\n- R2-2 (stripped message contract): the addSource test re-adds the message-body assertion (/Archive URLs must use https:\/\/ \(got /) alongside toBeInstanceOf, keeping the loopback 127.0.0.1:1 fixture. Acceptance criterion confirmed: rewrapping the probe failure as InsecureArchiveUrlError('Insecure install source') turns the test red (checked locally before reverting).\n\nOn the convergence note: agreed — this round had no open Critical, the four items were all test-hardening, and the diff now stands at 3 commits / 4 files. If the next pass is clean, landing and moving any residual Suggestion threads to a follow-up issue works for me.\n\nLocal (Windows 11, Node 22): marketplace.test.ts 42/42 · github.test.ts 158 passed + 9 skipped · extensionManager.test.ts 175 passed + 1 pre-existing Windows symlink-permission (EPERM) failure unrelated to this change.

@wenshao

wenshao commented Sep 26, 2026

Copy link
Copy Markdown
Collaborator

Real-environment verification, round 2: PR #12697 @ a97b0198

Follow-up to round 1 (90e38ca4). This round re-verifies the two new commits: ee805983 (typed InsecureArchiveUrlError, shared isArchiveShapedUrl, message rewrite, offline test) and a97b0198 (tests only).

For merge: the fix is functionally ready. Every round-1 and bot round-2/3 item I could exercise holds on the new head. One issue remains in the new error message: of the two remedies it names, the local-path one fails when followed literally. The fix is a two-line wording change plus its test pin (§2). Separately, CI's Lint & Static is red only because the branch needs a merge of origin/main, and the PR body is still stale.

Setup

The PR arm was rebuilt from source at a97b0198 (npm run build && npm run bundle). BASE is still the merge-base c9a9a8ad, and its output is byte-identical to round 1. I reused round 1's environment: a local origin serving a real extension archive plus git http-backend on http/https with a request ledger, a fresh HOME/QWEN_HOME/QWEN_RUNTIME_DIR per run under env -i, and the TUI in its own tmux socket. New this round: a real git clone to test the local-path remedy, and a fake ssh (GIT_SSH_COMMAND, which logs the call and runs git-upload-pack locally) to test the git@ remedy.

1. Status of earlier items on a97b0198

Item Result on a97b0198
The fix (A–E: http://…zip, .tar.gz, ?token=1, HTTP://, user:token@) Holds. Immediate Archive URLs must use https://, 0 requests, credentials redacted
R1-2, malformed URLs (K1/K2) Holds. Identical to BASE; isArchiveShapedUrl parses defensively
R1-4, sources add http://…zip (L1) Holds via the typed rethrow; garbage input (L4) still says No marketplace found
Round-1 S1 / bot R1-3: https:// advice Removed. Row I is still a dead end, but the message no longer recommends it
Round-1 S2 / bot R2-2: widened addSource rethrow Now pinned. Mutant M2 is killed
Bot R1-4: unit test went online Fixed. NODE_DEBUG=http shows only createConnection 127.0.0.1:1
Bot R2-1: addSource comment Fixed. It now says the probe already fetched; row L1 still shows that 1 GET, as the comment describes
Bot R2-3: duplicated classifier Fixed. isArchiveShapedUrl mutants (M6/M7) are killed by both marketplace.test.ts (now on the real github.js) and github.test.ts
Bot R3-2: http-only narrowing (sso://) Pinned. Mutant M3 is killed
Upgrade path (N) Still safe. Installed from http://…/git/tools.zip on BASE, then update with the PR build: 1.0.1 → 1.0.2
Happy paths (F/G), sources add https/git (L2/L3) Unchanged

2. New finding: the local-path remedy fails when followed literally

TUI remedies

For a git repo whose name ends in .zip, the message now says "…use its git@/SSH remote, or clone it yourself and install from the local path." I followed both remedies in the real CLI and TUI:

  • git@/SSH remote: works on both arms. The ssh ledger shows ssh [email protected] git-upload-pack '…/git/tools.zip'.
  • Clone and install locally: fails for the natural clone. git clone http://…/git/tools.zip creates ./tools.zip/. Then extensions install ./tools.zip, or the absolute path, fails with Extension archive could not be extracted. Make sure it is a valid .zip or .tar.gz file. EISDIR: illegal operation on a directory. The cause is that installExtension chooses archive extraction by name (installMetadata.type === 'local' && isSupportedArchivePath(source), extensionManager.ts:2387). This behaviour predates the PR (BASE fails the same way), but the message now sends users there. Cloning into a directory with a different name (git clone … tools-src) installs fine.

Candidate wording, checked locally: all 376 tests pass with the pin updated, and the message renders as intended:

`repository whose name ends in an archive extension, use its ` +
  `git@/SSH remote, or clone it into a directory whose name does not end ` +
  `in .zip or .tar.gz and install from that local path.`,

Update the pin in marketplace.test.ts to match, anchored at the end (…install from that local path\.$/). The anchor also closes the one surviving mutant (M10, §4).

A code fix (extract only when the local source is a file) would make the original wording true. It has to cover two sites, installExtension (extensionManager.ts:2387) and checkForExtensionUpdate (github.ts:581), so it is probably better as a follow-up.

3. Real CLI matrix (both arms)

CLI matrix

4. Tests, lint, mutation

  • packages/core/src/extension/: 889/889 across 28 files. The three touched test files: 376/376. ESLint --max-warnings 0, Prettier and tsc --noEmit (core) are clean on all 6 changed files.
  • Mutation matrix: 11 of 12 mutants killed. Round 1's survivor (M2) is now killed. The one survivor is M10: appending "You can also retry the same URL over https://." to the message stays green. This is the gap the bot flagged as R3-1. a97b0198 dropped that negative assertion on the grounds that the positive pin covers it, but an unanchored substring pin doesn't catch appended text. With the §2 wording and the end-anchored pin, M10 is killed.

Mutation matrix

Before merging

  • Lint & Static is red only at "Check lint gate freshness". On main, c7c6def8 (test(managed-agent): add Hosted no-tool process gates #12733) edited .github/workflows/ci.yml after this branch's merge-base, so the branch needs git merge origin/main (not a rebase) and a push. The code itself is lint-clean locally. Integration Tests (no-AK) passed. When this was written, Test (ubuntu-latest) and the round-4 review-pr were still pending on a97b0198.
  • The PR body is still unchanged since round 1. It still reports "36 tests pass, including 3 new ones", shows the original message, and says "No successful install path changes behavior". It doesn't mention the addSource, typed-error or github.ts changes.
  • reviewDecision is still CHANGES_REQUESTED from the triage template gate (review). Only a bot approval or a maintainer dismissal clears it.
中文说明

真实环境验证第 2 轮:PR #12697 @ a97b0198

接续第 1 轮(90e38ca4)。本轮复验两个新提交:ee805983(类型化的 InsecureArchiveUrlError、共用的 isArchiveShapedUrl、改写报错文案、离线化测试)和 a97b0198(仅改测试)。

合并参考: 修复在功能上已可合入。第 1 轮和机器人第 2、3 轮中凡是我能实测的项目,在新 head 上都成立。新报错文案还剩一个问题:它给出的两个补救办法中,本地路径那条照字面执行会失败。修复只需改两行文案并同步更新测试钉子(见 §2)。另外,CI 的 Lint & Static 变红只是因为分支需要合入 origin/main;PR 描述也仍未更新。

环境

PR 臂在 a97b0198 上从源码重新构建(npm run build && npm run bundle)。BASE 仍是 merge-base c9a9a8ad,输出与第 1 轮逐字节相同。沿用第 1 轮的环境:本地源站在 http/https 上提供真实扩展归档和 git http-backend,并记录请求台账;每次运行在 env -i 下使用全新的 HOME/QWEN_HOME/QWEN_RUNTIME_DIR;TUI 在独立的 tmux socket 中运行。本轮新增两样:用真实的 git clone 测试本地路径补救办法;用假 ssh(GIT_SSH_COMMAND,记录调用并在本地执行 git-upload-pack)测试 git@ 补救办法。

1. 之前各项在 a97b0198 上的状态

项目 a97b0198 上的结果
修复本身(A–E:http://…zip、.tar.gz、?token=1、HTTP://、user:token@) 成立。 立即报 Archive URLs must use https://,请求数 0,凭据已打码
R1-2,畸形 URL(K1/K2) 成立。 与 BASE 完全相同;isArchiveShapedUrl 解析时做了防护
R1-4,sources add http://…zip(L1) 通过类型化重抛成立;无法识别的输入(L4)仍报 No marketplace found
第 1 轮 S1 / 机器人 R1-3:建议改用 https:// 已删除。 I 行仍是死路,但报错已不再推荐它
第 1 轮 S2 / 机器人 R2-2:addSource 重抛被放宽 已被测试钉住。 变异体 M2 被杀死
机器人 R1-4:单测会联网 已修复。 NODE_DEBUG=http 下只看到 createConnection 127.0.0.1:1
机器人 R2-1:addSource 注释 已修复。 注释现在说明探测已经发过请求;L1 行仍记录到那 1 次 GET,与注释描述一致
机器人 R2-3:分类逻辑重复实现 已修复。 isArchiveShapedUrl 的变异体(M6/M7)被 marketplace.test.ts(现在用的是真实 github.js)和 github.test.ts 同时杀死
机器人 R3-2:只针对 http 的收窄(sso://) 已被测试钉住。 变异体 M3 被杀死
升级路径(N) 仍然安全。 先用 BASE 从 http://…/git/tools.zip 安装,再用 PR 构建执行 update:1.0.1 → 1.0.2
正常路径(F/G)、sources add 的 https 与 git 来源(L2/L3) 不变

2. 新发现:本地路径补救办法照字面执行会失败

对于名称以 .zip 结尾的 git 仓库,报错现在写的是「…use its git@/SSH remote, or clone it yourself and install from the local path」。我在真实 CLI 和 TUI 中把两条补救办法都执行了一遍:

  • git@/SSH 远端:可行,两个臂都能安装。ssh 台账记录到 ssh [email protected] git-upload-pack '…/git/tools.zip'。
  • 自己 clone 后从本地安装:按最自然的做法会失败。 git clone http://…/git/tools.zip 会创建 ./tools.zip/ 目录,之后执行 extensions install ./tools.zip(或绝对路径)报 Extension archive could not be extracted. Make sure it is a valid .zip or .tar.gz file. EISDIR: illegal operation on a directory。原因是 installExtension 按名称决定是否解压归档(installMetadata.type === 'local' && isSupportedArchivePath(source),extensionManager.ts:2387)。这一行为早于本 PR(BASE 上同样失败),但现在的报错会把用户引到这里。clone 到其他名字的目录(git clone … tools-src)则可以正常安装。

上方的候选文案已在本地验证:同步更新钉子后 376 个用例全部通过,报错渲染符合预期。marketplace.test.ts 里的钉子要随之更新,并在末尾加锚点(…install from that local path\.$/),这样也能堵住唯一存活的变异体(M10,见 §4)。

另一种做法是改代码:只有本地来源是文件时才按归档解压,这样原文案就成立了。但需要同时改两处,installExtension(extensionManager.ts:2387)和 checkForExtensionUpdate(github.ts:581),更适合作为后续 PR。

3. 真实 CLI 矩阵(两个臂)

见上方矩阵图。

4. 测试、lint 与变异

  • packages/core/src/extension/:28 个文件共 889/889 通过;本 PR 涉及的三个测试文件 376/376。6 个改动文件的 ESLint --max-warnings 0、Prettier 和 core 的 tsc --noEmit 全部通过。
  • 变异矩阵:12 个变异体中 11 个被杀死。第 1 轮存活的 M2 现在被杀死了。唯一存活的是 M10:在报错末尾追加「You can also retry the same URL over https://.」时测试仍全绿。这正是机器人 R3-1 指出的缺口。a97b0198 删掉了那条反向断言,理由是正向钉子已经覆盖;但不带锚点的子串钉子抓不到追加的文字。改用 §2 的文案并在钉子末尾加锚点后,M10 被杀死。

合并前

  • Lint & Static 只红在「Check lint gate freshness」这一步。 main 上的 c7c6def8(test(managed-agent): add Hosted no-tool process gates #12733)在本分支的 merge-base 之后修改了 .github/workflows/ci.yml,所以分支需要执行 git merge origin/main(不要 rebase)并推送。代码本身在本地 lint 全部通过。Integration Tests (no-AK) 已通过。撰写本报告时,a97b0198 上的 Test (ubuntu-latest) 和第 4 轮 review-pr 仍在进行。
  • PR 描述自第 1 轮以来没有任何改动。 仍写着「36 tests pass, including 3 new ones」,展示的还是最初的报错,也仍说「No successful install path changes behavior」;addSource、类型化错误和 github.ts 的改动都没有提及。
  • reviewDecision 仍为 CHANGES_REQUESTED,来自 triage 的模板门禁(review)。只有机器人批准或维护者 dismiss 才能清除。

… literally; pin the message end-to-end

Real-environment verification round 2 found that the local-path remedy in the InsecureArchiveUrlError message fails when followed literally: git clone http://host/git/tools.zip creates ./tools.zip/, and installExtension chooses archive extraction by name (installMetadata.type === 'local' && isSupportedArchivePath(source)), so installing from a directory named *.zip fails with EISDIR. This behavior predates the PR, but the message now sends users there.\n\nThe remedy wording now says to clone into a directory whose name does not end in .zip or .tar.gz (the git@/SSH remedy was verified to work as-is). A code fix (extract only when the local source is a file, covering installExtension and checkForExtensionUpdate) would make the original wording true and is better suited to a follow-up.\n\nThe marketplace.test.ts pin is upgraded from a substring-with-end-anchor to a full-string anchor (^...$): adversarial replay showed an end-anchored pin still lets an https:// recommendation be inserted mid-message while every test stays green; the full-string anchor kills appends (mutation M10), mid-message insertions, and any rewording.\n\nLocal (Windows 11, Node 22): marketplace.test.ts 42/42; the three touched suites 376 of 377 with the one pre-existing Windows symlink-permission (EPERM) failure unrelated to this change.
@liwenjie200543

Copy link
Copy Markdown
Contributor Author

Thank you for the round-2 real-environment verification — the §2 finding (local-path remedy fails when followed literally) was exactly the kind of check this message needed. All items addressed in 3a3fbf3 (+ the a8191b2 merge):

  • §2 (local-path remedy): adopted your candidate wording — "clone it into a directory whose name does not end in .zip or .tar.gz and install from that local path" — with the pin updated in marketplace.test.ts. Per your recommendation we did not take the two-site code fix; it is now documented in Risk & Scope as a pre-existing behavior with the follow-up sketched.
  • M10 (append survivor): your end-anchored pin kills it — and I confirmed this by replaying the mutation before reverting.
  • Lint & Static gate: upstream/main is merged into the branch (a8191b2, merge commit as advised, no rebase); the three touched suites still pass on the merge result.
  • Stale PR body: rewritten to the current state — 42 tests in marketplace.test.ts, the typed InsecureArchiveUrlError / shared isArchiveShapedUrl / addSource rethrow changes, the current message text, and the pre-existing EISDIR behavior called out in Risk & Scope.

Adversarial review I ran on the updated message pin (all mutations applied, tested, then reverted):

Attack Result with your end-anchored pin Result after hardening
M10 replay: append "You can also retry the same URL over https://." to the message red ✅ red ✅
New: insert "Try https:// instead. " mid-message (before "Re-download") green — gap (prefix pins cover the start, the end anchor covers the tail, nothing covers the middle) red ✅
Full-repo scan for stale remedy wording ("clone it yourself", "use an https") — clean ✅

Because the mid-message insertion survived the end-anchored pin, the assertion in marketplace.test.ts is upgraded from substring-with-end-anchor to a full-string anchor (/^Archive URLs must use https:\/\/ \(got [^)]*\)\. Re-download … and install from that local path\.$/). That kills appends, mid-message insertions, and any rewording in one assertion, while the pristine message stays green (42/42).

One residual disclosed rather than fixed: the message says the directory name must not end in ".zip or .tar.gz", but getSupportedArchiveExtensionFromPathname matches case-insensitively, so a directory named *.ZIP also hits the pre-existing EISDIR path. I kept your verified wording and left this to the follow-up code fix (extract only when the local source is a file), which removes the trap entirely regardless of case.

Local (Windows 11, Node 22): marketplace.test.ts 42/42 · github.test.ts 158 passed + 9 skipped · extensionManager.test.ts 175 passed + 1 pre-existing Windows symlink-permission (EPERM) failure unrelated to this change.

@wenshao

wenshao commented Sep 26, 2026

Copy link
Copy Markdown
Collaborator

Real-environment verification, round 3: PR #12697 @ 3a3fbf35

Follow-up to round 2 (a97b0198). New since then: a8191b27 (merge of main @ 9e60263f) and 3a3fbf35 (message wording plus a full-message ^…$ pin).

For merge: ready from a real-environment standpoint. The round-2 finding is closed: both remedies the message names now install when followed literally. The one surviving mutant from round 2 is killed, and 14 of 14 mutants are killed overall. BASE is now current main, and nothing regressed against it. What remains are non-blocking nits and a pre-existing follow-up (below). CI was still running on 3a3fbf35 when this was written.

What I checked

  • The merge is clean. a8191b27 is a pure auto-merge: its tree equals git merge-tree --write-tree a97b0198 9e60263f exactly, so there are no manual edits. None of main's new commits touch packages/core/src/extension/ or the CLI extension commands. All 8 lint-gate files on main are ancestors of the head, so the round-2 Lint & Static gate-freshness red should not recur.
  • Both arms rebuilt from source. PR at 3a3fbf35; BASE at the new merge-base 9e60263f (current main). Same origin (real archive plus git http-backend, request ledger) and fresh-home recipe as before.
  • Real CLI matrix on both arms: identical to round 2 apart from timings and the new message tail. BASE on current main matches the old merge-base.

1. The round-2 finding is closed

TUI literal remedy

Following the new wording literally: git clone http://…/git/tools.zip tools, then extensions install ./tools, installs on both arms (CLI row R3; TUI above). The git@/SSH remedy also installs on both arms (R2). The default clone directory tools.zip/ still fails with EISDIR on both arms (R1). That behaviour predates this PR, and the message now steers users away from it.

CLI matrix

2. Tests, lint, mutation

  • packages/core/src/extension/: 889/889 across 28 files; marketplace.test.ts 42/42. ESLint --max-warnings 0, Prettier and tsc --noEmit (core) are clean on the 6 changed files.
  • 14 of 14 mutants killed. Round 2's survivor M10 (appended https:// hint) is now killed, as are the author's mid-message insertion (M13) and a revert to the round-2 wording (M14). The upgrade path is still safe: installed on BASE, then update with the PR build gives 1.0.2 → 1.0.3.

Mutation matrix

3. Correction to the disclosed *.ZIP residual, and scope for the follow-up

The author's reply says a directory named *.ZIP also hits EISDIR. It does fail, but with a different error: Unsupported file extension for extraction: …/TOOLS.ZIP (row U3). Routing (getSupportedArchiveExtensionFromPathname) matches extensions case-insensitively, while the extractor's dispatch in extractFile (github.ts:1371, file.endsWith('.zip')) is case-sensitive. The same mismatch breaks two things on both arms: an https archive URL ending in .ZIP (U1), and a genuine local .ZIP file (U2). Neither is caused by this PR. Because the new message tells HTTP://…/X.ZIP users to re-download over HTTPS, one follow-up should cover both the documented EISDIR case and this one: extract only regular files, and dispatch on the lowercased extension.

Non-blocking nits

  • PR body: it is now accurate apart from the "Breaking changes" bullet. That bullet still ends "No successful install path changes behavior", while the Risk bullet above it describes the exception: an http git repo named *.zip installed on main and is refused here (rows H/J1). The Tested-on matrix could also mark macOS ✅, since all three rounds of this verification ran on macOS 26.6.2 arm64.
  • reviewDecision is still CHANGES_REQUESTED from the triage template gate (review). Only a bot approval or a maintainer dismissal clears it.
  • CI at the time of writing: Integration Tests (no-AK) passed; Lint & Static, Test (ubuntu-latest) and review-pr were still pending on 3a3fbf35.
中文说明

真实环境验证第 3 轮:PR #12697 @ 3a3fbf35

接续第 2 轮(a97b0198)。新增提交:a8191b27(合入 main @ 9e60263f)和 3a3fbf35(改写报错文案,并用 ^…$ 钉住整条消息)。

合并参考:从真实环境验证的角度看,可以合入。 第 2 轮的发现已关闭:报错给出的两条补救办法照字面执行都能装上。第 2 轮唯一存活的变异体已被杀死,全部 14 个变异体都被杀死。BASE 现在就是当前 main,相对它没有任何回归。剩下的只是非阻塞的小问题,以及一个早已存在、适合后续处理的问题(见下)。撰写时 3a3fbf35 上的 CI 仍在运行。

检查了什么

  • 合并提交是干净的。 a8191b27 是纯自动合并:它的 tree 与 git merge-tree --write-tree a97b0198 9e60263f 完全相同,没有手工改动。main 新增的提交都没有改动 packages/core/src/extension/ 或 CLI 的扩展命令。main 上 8 个 lint 门禁文件都是当前 head 的祖先,第 2 轮那种门禁新鲜度红灯不会再出现。
  • 两个臂都从源码重新构建。 PR 在 3a3fbf35;BASE 在新的 merge-base 9e60263f(即当前 main)。源站(真实归档加 git http-backend,带请求台账)和全新 home 的做法与前两轮相同。
  • 两个臂的真实 CLI 矩阵: 除耗时和新的报错结尾外,与第 2 轮完全一致。当前 main 上的 BASE 与旧 merge-base 的表现相同。

1. 第 2 轮的发现已关闭

按新文案照字面操作:git clone http://…/git/tools.zip tools,再执行 extensions install ./tools,两个臂都能安装(CLI 矩阵 R3 行,以及上方 TUI 图)。git@/SSH 补救办法两个臂也都能安装(R2)。默认 clone 出来的目录 tools.zip/ 在两个臂上仍报 EISDIR(R1)。这一行为早于本 PR,而新文案已经引导用户避开它。

2. 测试、lint 与变异

  • packages/core/src/extension/:28 个文件共 889/889 通过;marketplace.test.ts 42/42。6 个改动文件的 ESLint --max-warnings 0、Prettier 和 core 的 tsc --noEmit 全部通过。
  • 14 个变异体全部被杀死。 第 2 轮存活的 M10(在消息末尾追加 https:// 提示)现在被杀死,作者提出的消息中段插入(M13)和退回第 2 轮文案(M14)也都被杀死。升级路径仍然安全:先用 BASE 安装,再用 PR 构建执行 update,结果为 1.0.2 → 1.0.3。

3. 更正作者披露的 *.ZIP 残留问题,以及后续修复的范围

作者回复说名为 *.ZIP 的目录同样会报 EISDIR。实测确实会失败,但报错不同:Unsupported file extension for extraction: …/TOOLS.ZIP(U3 行)。原因是路由判断(getSupportedArchiveExtensionFromPathname)对扩展名不区分大小写,而 extractFile 里的解压分派(github.ts:1371,file.endsWith('.zip'))区分大小写。同一个不一致在两个臂上还会导致另外两处失败:以 .ZIP 结尾的 https 归档 URL(U1),以及真正的本地 .ZIP 文件(U2)。这些都不是本 PR 引入的。但新报错会让使用 HTTP://…/X.ZIP 的用户改用 HTTPS 重新下载,所以建议用同一个后续 PR 一并处理已记录的 EISDIR 和这个问题:只对普通文件做解压,并按小写扩展名分派。

非阻塞的小问题

  • PR 描述: 现在基本准确,只有「Breaking changes」这一条仍以「No successful install path changes behavior」结尾,而上面的 Risk 条目已经说明了例外:名称以 *.zip 结尾的 http git 仓库在 main 上能装,在本 PR 中被拒绝(H/J1 行)。另外,Tested on 表格里的 macOS 可以标为 ✅,因为这三轮验证都是在 macOS 26.6.2 arm64 上跑的。
  • reviewDecision 仍为 CHANGES_REQUESTED,来自 triage 的模板门禁(review)。只有机器人批准或维护者 dismiss 才能清除。
  • 撰写时的 CI 状态: Integration Tests (no-AK) 已通过;3a3fbf35 上的 Lint & Static、Test (ubuntu-latest) 和 review-pr 仍在进行。

@liwenjie200543

Copy link
Copy Markdown
Contributor Author

Thank you for the round-3 real-environment verification — great to see all 14 mutants killed and both remedies installing when followed literally on both arms.

No code change this round; the PR body was updated to address all three non-blocking items:

  • Breaking-changes bullet: rewritten. It now spells out the narrow exception instead of contradicting the Risk section: a git repository whose name ends in an archive extension, served over http://, previously installed successfully and is now refused (with the two working remedies offered in the message).
  • Tested-on matrix: macOS is now marked ✅, credited to your three verification rounds on macOS 26.6.2 arm64 (CLI/TUI matrix, upgrade path, both remedies). Linux remains ⚠️.
  • §3 correction adopted: the *.ZIP disclosure in the body was wrong about the failure mode, as you measured. It now states the real error (Unsupported file extension for extraction), attributes it to the case-sensitivity mismatch (routing lowercases the pathname in getSupportedArchiveExtensionFromPathname, github.ts:86-102, while extractFile's dispatch is case-sensitive, github.ts:1353/1371), and scopes the follow-up as: extract only regular files, dispatch on the lowercased extension, covering installExtension and checkForExtensionUpdate — closing the EISDIR case and the *.ZIP mismatch together.

Adversarial verification of the updated claims

# Attack Result
A1 Re-derive §3 from source instead of trusting the correction Confirmed: getSupportedArchiveExtensionFromPathname lowercases (github.ts:89,98); extractFile dispatches on raw endsWith('.tar.gz')/endsWith('.zip') (github.ts:1353/1371) and throws Unsupported file extension for extraction otherwise (github.ts:1374)
A2 Attack the follow-up scope claim — does the update path really share the by-name extraction? Confirmed: checkForExtensionUpdate (github.ts:565) calls extractArchiveFile for local archive sources, same as installExtension (extensionManager.ts:2392). Note extractArchiveFile's own guard isSupportedArchivePath is case-insensitive, so .ZIP passes the guard and dies inside the case-sensitive dispatch — exactly the U1-U3 shape
A3 Byte-diff the PR body's example message against the production template in marketplace.ts:476-480 Exact match
A4 Pristine rerun of marketplace.test.ts at 3a3fbf3 42/42 green
A5 Stale-wording scan of the body for the two retired claims ("No successful install path changes behavior" / "macOS not tested") Clean; only the Linux row remains ⚠️, which is accurate

Head remains 3a3fbf3 — no new commit, nothing for CI to re-run.

中文说明

感谢第 3 轮真实环境验证——14 个变异体全部被杀死、两条补救办法照字面执行都能在两个臂上安装,非常好。

本轮没有代码改动,只更新了 PR 描述,落实全部三项非阻塞意见:

  • 破坏性变更条目:已重写,明确写出窄例外(名字以归档扩展名结尾、经 http 提供的 git 仓库此前能装、现在被拒绝,报错提供两条补救办法),不再与风险条目矛盾。
  • 测试平台表:macOS 标为 ✅,归功于你在 macOS 26.6.2 arm64 上的三轮验证;Linux 仍为 ⚠️。
  • 采纳 §3 更正:正文中 *.ZIP 披露的失败形态确实写错了。现已改为真实报错(Unsupported file extension for extraction),并写明原因(路由转小写 vs extractFile 分派区分大小写)和后续 PR 范围:只解压普通文件、按小写扩展名分派、覆盖 installExtension 与 checkForExtensionUpdate。

对抗性核实:A1 从源码独立复推 §3 更正(属实);A2 攻击 follow-up 范围声明——确认更新路径同样走按名解压(github.ts:565 → extractArchiveFile),且 extractArchiveFile 的守卫 isSupportedArchivePath 不区分大小写,所以 .ZIP 能过守卫、死在区分大小写的分派里,与 U1-U3 完全吻合;A3 正文示例消息与 marketplace.ts:476-480 逐字节一致;A4 marketplace.test.ts 在 3a3fbf3 上 42/42 通过;A5 陈旧措辞扫描干净。

head 仍为 3a3fbf3,无新提交,CI 无需重跑。

@wenshao

wenshao commented Sep 26, 2026

Copy link
Copy Markdown
Collaborator

@qwen-code /triage

@wenshao
wenshao enabled auto-merge September 26, 2026 12:48
@wenshao
wenshao added this pull request to the merge queue Sep 26, 2026
Merged via the queue into QwenLM:main with commit 8629086 Sep 26, 2026
43 checks passed
wenshao added a commit to doudouOUC/qwen-code that referenced this pull request Sep 26, 2026
…s-p0-p8

Brings in main through 939b4db: QwenLM#12697 (http archive URLs rejected
with an actionable error), QwenLM#12741 (batch task records that list cannot
read) and QwenLM#12652 (scrollbar gutter in the collapsed sidebar rail).

The merge is clean.
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.

3 participants