Skip to content

v4.0.2 — wrapper Windows ^4.0.0 escape critical 修

Latest

Choose a tag to compare

@Accelerator-mzq Accelerator-mzq released this 21 May 08:23
· 2 commits to main since this release
3b1b96a

critical hotfix:v4.0.1 通过 wrapper 调的 CLI Windows 用户永远是 v4.0.0(文件层 plugin 改动生效但 CLI 改动拿不到)。本 release 修。

根因(第 3 个同根 bug)

scripts/run-forge.mjs:24 --package @accelerator-mzq/forge@^4.0.0 + spawn { shell: true }(Windows 必须,Node 21+ CVE-2024-27980)
→ 走 cmd.exe 解析 → cmd.exe 把 ^ 当 escape character 吃掉
→ npx 收到 @accelerator-mzq/forge@4.0.0 精确版本(不是 semver range)→ 永远拉 4.0.0

修法(1 行 + 4 处版本号)

REQUIRED_RANGE: '^4.0.0' → '4.x'(等价 >=4.0.0 <5.0.0,字符全 cmd-safe 字母数字 + 点)。Linux/macOS 不受影响。跨 major bump(4→5)时改 5.x。

同根 3 bug 完整状态(v4.0.2 后)

Bug shell:true → cmd.exe 干扰具体表现 状态
JSON 花括号被吃 → record_error 解析 {} 引号嵌套 ✅ v4.0.1 workaround --json-file
Config build_prompt 引号嵌套乱 → codex 失焦 双重 escape 引号 ✅ v4.0.1 workaround config + preflight
^4.0.0 被 escape → 永远拉 4.0.0 ^ 当 escape char 吃掉 ✅ v4.0.2 修(本 release)

三同根 bug 全部 covered。根因 shell: true 本身未根治(Node 21+ 强制要求),需重写 wrapper 走 spawn node + dist/cli/index.js 绕 .cmd 中间层 — 留 follow-up,scripts/build-bundled-plugin.mjs 已有 pattern 参考。

升级

  • npm:npm i -g @accelerator-mzq/forge@4.0.2
  • plugin:/plugin marketplace update accelerator-mzq-forge(plugin 文件层升级到 v4.0.2 后,wrapper 用新 REQUIRED_RANGE,下次 wrapper 调能拉到 latest 4.x)

完整改动见 CHANGELOG.md#402---2026-05-21。