Skip to content

fix(cli): expand windows-style tilde paths - #5298

Merged
wenshao merged 1 commit into
QwenLM:mainfrom
tt-a1i:fix/cli-resolve-windows-tilde
Jun 18, 2026
Merged

fix(cli): expand windows-style tilde paths#5298
wenshao merged 1 commit into
QwenLM:mainfrom
tt-a1i:fix/cli-resolve-windows-tilde

Conversation

@tt-a1i

@tt-a1i tt-a1i commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

What this PR does

Teaches the CLI path resolver (resolvePath) to expand Windows-style tilde paths. Previously the resolver only expanded %USERPROFILE%…, bare ~, and POSIX-style ~/… paths; a path that began with a backslash tilde such as ~\schemas\input.json fell through unexpanded and was treated as a literal relative path, so the home directory was never substituted. The PR adds a branch for inputs starting with ~\: it joins os.homedir() with the remaining segments (splitting on both / and \ and dropping empty segments), so ~\schemas\input.json now resolves to <home>/schemas/input.json. The existing ~/…, bare ~, and %USERPROFILE% behavior is unchanged — the new case is appended as an else if after the existing branches. A new unit-test file adds focused coverage for empty input, bare ~, POSIX ~/, the POSIX trailing-separator case, Windows ~\, case-insensitive %USERPROFILE%, and relative-path normalization.

Why it's needed

resolvePath is what resolves @-prefixed file arguments to --json-schema (it is called on the path portion in packages/cli/src/config/config.ts, the resolveJsonSchemaArg flow). On Windows, users naturally type tilde paths with backslashes (e.g. --json-schema @~\schemas\input.json). Before this change the ~\ prefix was left unexpanded, so the home directory was not substituted and the schema file would not be found at the intended location. Expanding ~\… the same way ~/… is already expanded makes tilde paths behave consistently for Windows users.

Reviewer Test Plan

How to verify

  1. Apply the branch and run the unit tests:
    • npx vitest run packages/cli/src/utils/resolvePath.test.ts packages/cli/src/config/jsonSchemaArg.test.ts
    • npx eslint packages/cli/src/utils/resolvePath.ts packages/cli/src/utils/resolvePath.test.ts
    • npx prettier --check packages/cli/src/utils/resolvePath.ts packages/cli/src/utils/resolvePath.test.ts
    • git diff --check
  2. Expected vs observed: resolvePath('~\\schemas\\input.json') returns path.join(os.homedir(), 'schemas', 'input.json') (home directory expanded), while resolvePath('~/schemas/input.json'), resolvePath('~'), and %USERPROFILE%\… continue to return exactly what they returned before. The new resolvePath.test.ts asserts each of these.

Evidence (Before & After)

N/A — non-visible logic fix (a path-string resolver, no TUI surface); covered by the unit tests above.

Tested on

OS Status
🍏 macOS ✅ CI
🪟 Windows ✅ CI
🐧 Linux ✅ CI

✅ tested · ⚠️ not tested · N/A

Environment (optional)

Unit tests only (npm workspaces); no special environment required.

Risk & Scope

  • Main risk or tradeoff: Low; scoped to packages/cli/src/utils/resolvePath.ts. The behavior change is limited to inputs that begin with ~\, which previously were not expanded at all; all other inputs (~/…, bare ~, %USERPROFILE%, relative, and absolute paths) take the same branches as before.
  • Not validated / out of scope: No unrelated refactors, no public API changes, no UI changes. A pre-existing npm run typecheck --workspace=packages/cli failure on upstream/main (in src/acp-integration/session/Session.ts and src/serve/server.ts) is unrelated to this PR, which only touches packages/cli/src/utils/resolvePath*.
  • Breaking changes / migration notes: None.

Linked Issues

No linked issue. This PR was opened directly against the resolvePath resolver and does not reference or close an existing issue.

中文说明

这个 PR 做了什么

让 CLI 的路径解析器 resolvePath 能够展开 Windows 风格的波浪号路径。此前解析器只展开 %USERPROFILE%…、单独的 ~ 以及 POSIX 风格的 ~/…;以反斜杠加波浪号开头的路径(例如 ~\schemas\input.json)会原样落空、被当作普通相对路径处理,主目录不会被替换。本 PR 为以 ~\ 开头的输入新增一个分支:把 os.homedir() 与剩余的路径片段拼接(同时按 /\ 切分并丢弃空片段),于是 ~\schemas\input.json 现在会解析为 <home>/schemas/input.json。原有的 ~/…、单独的 ~ 以及 %USERPROFILE% 行为保持不变——新分支是追加在已有分支之后的 else if。新增的单元测试文件针对空输入、单独的 ~、POSIX 的 ~/、POSIX 末尾分隔符的情形、Windows 的 ~\、大小写不敏感的 %USERPROFILE%,以及相对路径的归一化提供了集中覆盖。

为什么需要

resolvePath 用于解析传给 --json-schema 的、以 @ 开头的文件参数(在 packages/cli/src/config/config.tsresolveJsonSchemaArg 流程中对路径部分调用它)。在 Windows 上,用户很自然地会用反斜杠来写波浪号路径(例如 --json-schema @~\schemas\input.json)。在本次修改之前,~\ 前缀不会被展开,主目录不会被替换,于是 schema 文件无法在预期位置被找到。让 ~\… 像现有的 ~/… 一样被展开,可以让波浪号路径对 Windows 用户表现一致。

审阅者测试计划

如何验证

  1. 应用该分支并运行单元测试:
    • npx vitest run packages/cli/src/utils/resolvePath.test.ts packages/cli/src/config/jsonSchemaArg.test.ts
    • npx eslint packages/cli/src/utils/resolvePath.ts packages/cli/src/utils/resolvePath.test.ts
    • npx prettier --check packages/cli/src/utils/resolvePath.ts packages/cli/src/utils/resolvePath.test.ts
    • git diff --check
  2. 期望与实际对比:resolvePath('~\\schemas\\input.json') 返回 path.join(os.homedir(), 'schemas', 'input.json')(主目录已展开),而 resolvePath('~/schemas/input.json')resolvePath('~') 以及 %USERPROFILE%\… 仍返回与改动前完全一致的结果。新增的 resolvePath.test.ts 对以上每一项都做了断言。

证据(改动前 & 改动后)

N/A——这是不可见的逻辑修复(一个路径字符串解析器,没有 TUI 界面);由上述单元测试覆盖。

测试平台

操作系统 状态
🍏 macOS ✅ CI
🪟 Windows ✅ CI
🐧 Linux ✅ CI

✅ 已测试 · ⚠️ 未测试 · N/A

环境(可选)

仅单元测试(npm workspaces);无需特殊环境。

风险与范围

  • 主要风险或权衡:低;仅限于 packages/cli/src/utils/resolvePath.ts。行为变化仅限于以 ~\ 开头的输入——这类输入此前根本不会被展开;其它所有输入(~/…、单独的 ~%USERPROFILE%、相对路径与绝对路径)走的分支与之前完全相同。
  • 未验证 / 范围之外:无无关的重构,无公共 API 变更,无 UI 变更。upstream/main 上已存在的 npm run typecheck --workspace=packages/cli 失败(位于 src/acp-integration/session/Session.tssrc/serve/server.ts)与本 PR 无关,本 PR 只改动 packages/cli/src/utils/resolvePath*
  • 破坏性变更 / 迁移说明:无。

关联的 Issue

无关联 issue。本 PR 直接针对 resolvePath 解析器提出,未引用或关闭任何已有 issue。

AI Assistance Disclosure

I used Codex to review the changes, sanity-check the implementation against existing patterns, and help spot potential edge cases.

expandedPath = path.join(
os.homedir(),
...p
.substring(2)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Suggestion] The ~\ branch uses path.join + split/filter, while the ~/ and %USERPROFILE% branches use string concatenation. This creates two issues:

  1. Trailing separator inconsistency: path.join strips trailing separators, but path.normalize (used by the other branches) preserves them. So resolvePath('~/foo/')homedir/foo/ but resolvePath('~\\foo\\')homedir/foo (trailing separator lost).

  2. Strategy divergence: different construction patterns make the function harder to maintain — a future change to one branch may not be correctly ported to the others.

A simpler approach using replaceAll matches the existing concat pattern and avoids both issues:

Suggested change
.substring(2)
} else if (p.startsWith('~\\')) {
expandedPath = os.homedir() + p.substring(1).replaceAll('\\', '/');

— qwen3.7-max via Qwen Code /review

it('expands USERPROFILE references case-insensitively', () => {
expect(resolvePath('%USERPROFILE%\\schemas\\input.json')).toBe(
path.normalize(`${os.homedir()}\\schemas\\input.json`),
);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Suggestion] On POSIX, both sides of this assertion produce a path with literal backslash characters (e.g., /home/user\schemas\input.json), which is not a valid POSIX path — the test validates a broken string. Additionally, the test name claims "case-insensitively" but only tests uppercase %USERPROFILE%, never %userprofile%.

Consider making the expected value platform-conditional or adding a lowercase variant:

it('expands lowercase %userprofile% references', () => {
  expect(resolvePath('%userprofile%\\schemas\\input.json')).toBe(
    process.platform === 'win32'
      ? path.join(os.homedir(), 'schemas', 'input.json')
      : path.normalize(`${os.homedir()}\\schemas\\input.json`),
  );
});

— qwen3.7-max via Qwen Code /review

it('normalizes relative paths without resolving them', () => {
expect(resolvePath('nested/../schema.json')).toBe(
path.normalize('schema.json'),
);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Suggestion] Three untested edge cases for the new ~\\ branch:

  1. Bare ~\\ (just two characters) — exercises filter(Boolean) with an empty segment array
  2. Mixed separators like ~\\foo/bar\\baz — validates the [/\\\\]+ regex handles both styles
  3. Trailing separator ~\\foo\\ — would have caught the trailing-separator inconsistency with the ~/ branch
it('expands bare backslash-tilde to the home directory', () => {
  expect(resolvePath('~\\')).toBe(path.normalize(os.homedir()));
});

it('handles mixed separators in Windows-style tilde paths', () => {
  expect(resolvePath('~\\foo/bar\\baz')).toBe(
    path.join(os.homedir(), 'foo', 'bar', 'baz'),
  );
});

— qwen3.7-max via Qwen Code /review

@wenshao

wenshao commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

@qwen-code /triage

@wenshao

wenshao commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

✅ Maintainer verification — local real-binary test

Verified this PR locally with a real build (not just unit tests). Verdict: correct, minimal, well-tested, and safe — good to merge. One benign cross-platform side effect is noted below for awareness; it is not a blocker.

Environment

  • Isolated git worktree at the PR head (4674951f0, on top of current upstream main), fresh npm ci (no symlinked node_modules).
  • Linux · Node v22.22.2 · bundled qwen 0.18.3.
  • Scope is clean: exactly 2 files, +57 / −0, single commit — no unrelated changes.

1. Static checks (reproducing the PR test plan)

Check Command Result
Unit tests vitest run resolvePath.test.ts jsonSchemaArg.test.ts 47/47 pass (7 new + 40 consumer regression)
Lint eslint resolvePath.ts resolvePath.test.ts ✅ clean
Format prettier --check … ✅ clean
Whitespace git diff --check ✅ clean
Typecheck npm run typecheck -w packages/cli exit 0, 0 errors

Note: the PR description flags a "known unrelated typecheck failure" in Session.ts / server.ts. That does not reproduce on the current PR head — packages/cli typechecks fully green.

2. Real-binary end-to-end (the actual fix, driven under tmux)

resolvePath feeds --json-schema @<path>, which echoes the resolved path in its error — a deterministic, auth-free probe. I built the bundle and ran the same Windows-style input against the pre-PR binary and the PR binary in a real tmux PTY (HOME sandboxed so os.homedir() is hermetic):

INPUT  --json-schema '@~\qwen5298\badjson.txt'      (badjson.txt exists, contains invalid JSON)

OLD (pre-PR):  could not read "~\qwen5298\badjson.txt": ENOENT      ← '~\' NOT expanded → the bug
NEW (PR 5298): content of "/tmp/pr5298_home/qwen5298/badjson.txt" is not valid JSON
                                                                    ← expanded, '\'→'/', file found & read ✅

POSIX control @~/qwen5298/badjson.txt is identical on both binaries → no regression to existing behavior. Missing-file and directory inputs also echo the correctly-expanded /home/... path on the new binary.

3. Cross-platform behavior (simulation over path.win32 / path.posix)

Reproduced the exact old vs. new logic under both path implementations. On Windows ~\schemas\input.jsonC:\Users\<user>\schemas\input.json ✅. Every pre-existing form (~, ~/…, %USERPROFILE%\…, relative, absolute) is byte-for-byte unchanged on both platforms.

Observations (non-blocking)

  1. POSIX side effect: on Linux/macOS, ~\foo previously stayed literal (backslash is a legal filename char) and now expands to $HOME/foo. This is harmless in practice — ~\ is a Windows idiom and accepting it everywhere is reasonable — but a (pathological) file literally named ~\foo would now resolve differently. Worth a mention only.
  2. Trailing-separator asymmetry: ~/ preserves a trailing slash ($HOME/) while bare ~\ drops it ($HOME), because the new branch uses path.join(…, …filter(Boolean)). Cosmetic; trailing separators are normalized away downstream.
  3. No new path-traversal surface — ~\..\.. behaves the same as the already-supported ~/../...

🇨🇳 中文版(点击展开)

✅ 维护者验证 —— 本地真实二进制测试

我在本地用真实构建(不仅是单元测试)验证了该 PR。结论:实现正确、改动精简、测试充分、安全可靠,建议合并。 下面记录了一个无害的跨平台副作用,仅供知晓,并非阻断项。

环境

  • 在 PR head(4674951f0,基于当前上游 main)上独立 git worktree,全新 npm ci(绝不软链 node_modules)。
  • Linux · Node v22.22.2 · 打包后的 qwen 0.18.3
  • 改动范围干净:恰好 2 个文件,+57 / −0,单个提交,无任何无关改动。

1. 静态检查(复现 PR 的测试计划)

检查项 命令 结果
单元测试 vitest run resolvePath.test.ts jsonSchemaArg.test.ts 47/47 通过(7 个新增 + 40 个调用方回归)
Lint eslint resolvePath.ts resolvePath.test.ts ✅ 干净
格式 prettier --check … ✅ 干净
空白字符 git diff --check ✅ 干净
类型检查 npm run typecheck -w packages/cli 退出码 0,0 错误

说明:PR 描述里提到 Session.ts / server.ts 存在「已知的无关类型检查失败」。在当前 PR head 上并未复现——packages/cli 类型检查完全通过。

2. 真实二进制端到端测试(在 tmux 中驱动实际修复)

resolvePath--json-schema @<路径> 提供解析,而该参数会在报错信息中原样回显解析后的路径——这是一个确定性的、无需鉴权的探针。我构建了 bundle,并在真实的 tmux PTY 中,用同一个 Windows 风格输入分别跑了 PR 前后的二进制(沙箱化 HOME,使 os.homedir() 完全可控):

输入  --json-schema '@~\qwen5298\badjson.txt'      (badjson.txt 存在,内容是非法 JSON)

旧版(PR 前): could not read "~\qwen5298\badjson.txt": ENOENT     ← '~\' 未展开 → 即为该 bug
新版(PR 5298): content of "/tmp/pr5298_home/qwen5298/badjson.txt" is not valid JSON
                                                                  ← 已展开,'\'→'/',文件被找到并读取 ✅

POSIX 对照组 @~/qwen5298/badjson.txt 在两个二进制上完全一致 → 现有行为无回归。缺失文件、目录等输入在新二进制上也都回显出正确展开的 /home/... 路径。

3. 跨平台行为(在 path.win32 / path.posix 上模拟)

我在两种 path 实现下复现了新旧逻辑。在 Windows~\schemas\input.jsonC:\Users\<user>\schemas\input.json ✅。所有既有形式(~~/…%USERPROFILE%\…、相对路径、绝对路径)在两个平台上都逐字节不变

观察项(非阻断)

  1. POSIX 副作用: 在 Linux/macOS 上,~\foo 以前会被当作字面量保留(反斜杠是合法的文件名字符),现在会展开为 $HOME/foo。实际几乎无害——~\ 本就是 Windows 习惯写法,全平台接受它是合理的——但一个(极端罕见、字面带反斜杠)名为 ~\foo 的文件其解析结果会改变。仅作提示。
  2. 尾部分隔符不一致: ~/ 会保留尾部斜杠($HOME/),而单独的 ~\ 会丢弃它($HOME),因为新分支用了 path.join(…, …filter(Boolean))。属于外观差异;尾部分隔符在下游会被规范化掉。
  3. 未引入新的路径穿越面——~\..\.. 与早已支持的 ~/../.. 行为一致。

@wenshao

wenshao commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

@qwen-code /triage

@qwen-code-ci-bot qwen-code-ci-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @tt-a1i — thanks for the fix! The code change itself looks solid and minimal.

However, the PR body doesn't follow our pull request template. The template requires specific headings that help reviewers quickly understand the change:

  • ## What this PR does — describes the change in prose (your "## Summary" covers similar ground but the heading name matters for our review process)
  • ## Why it's needed — the motivation / user-facing problem (missing entirely — this is the key one)
  • ## Reviewer Test Plan with sub-sections: ### How to verify, ### Evidence (Before & After), ### Tested on (your "## Test Plan" lists commands but is missing the structured reviewer-facing format)
  • ## Risk & Scope and ## Linked Issues

Could you update the PR body to match the template? The "Why it's needed" section is especially important — it helps reviewers understand the user-facing problem without having to infer it from the code.

Once that's done, feel free to re-request review or ping /triage again.

中文说明

你好 @tt-a1i,感谢修复!代码改动本身很精简。

不过 PR 正文没有遵循我们的 PR 模板。模板要求特定标题来帮助审阅者快速理解改动:

  • ## What this PR does — 用文字描述变更内容
  • ## Why it's needed — 动机 / 面向用户的问题(目前缺失,这是关键的一项)
  • ## Reviewer Test Plan 及子章节:### How to verify### Evidence (Before & After)### Tested on
  • ## Risk & Scope## Linked Issues

请按模板更新 PR 正文。"Why it's needed" 部分尤为重要——它帮助审阅者在不看代码的情况下理解用户侧的问题。

更新后可以重新请求审阅或再次 /triage

Qwen Code · qwen3.7-max

@wenshao

wenshao commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

@qwen-code /triage

@qwen-code-ci-bot

Copy link
Copy Markdown
Collaborator

Thanks for the PR!

Template looks good ✓ — all required sections filled in with both English and Chinese.

On direction: this is a straightforward usability fix. Windows users typing ~\schemas\input.json expect tilde expansion to work, just like ~/… already does. Claude Code's own CHANGELOG has a similar fix ("Fixed Windows permission rules never matching when spelled with backslashes (~\, …)"), which confirms this is a real pain point for Windows users. Clearly aligned with the project's cross-platform goals.

On approach: the scope is tight — 8 lines in resolvePath.ts plus a focused test file. No drive-by refactors, no scope creep. The new else if branch is appended after existing branches so all prior behavior is preserved. One thing worth noting: the new branch uses path.join() + split/filter while the existing ~/ branch uses simple string concatenation + path.normalize(). This is a minor stylistic inconsistency but functionally equivalent — not a blocker.

Moving on to code review. 🔍

中文说明

感谢贡献!

模板完整 ✓ — 中英文各节均已填写。

方向:这是一个直接的可用性修复。Windows 用户输入 ~\schemas\input.json 时期望波浪号能展开,就像 ~/… 已经生效一样。Claude Code 自己的 CHANGELOG 也有类似修复("Fixed Windows permission rules never matching when spelled with backslashes"),确认这是 Windows 用户的真实痛点,与项目的跨平台目标完全对齐。

方案:范围紧凑 — resolvePath.ts 增加 8 行,加上一个集中的测试文件。没有顺手重构、没有越界改动。新的 else if 分支追加在已有分支之后,所有既有行为保持不变。值得留意的一点:新分支用了 path.join() + split/filter,而原有的 ~/ 分支用的是简单字符串拼接 + path.normalize()。风格上略有不同但功能等价——不构成阻塞。

进入代码审查 🔍

Qwen Code · qwen3.7-max

@qwen-code-ci-bot

Copy link
Copy Markdown
Collaborator

Code Review

The implementation is correct. The new else if (p.startsWith('~\\')) branch uses path.join() + split/filter rather than the existing branches' string concatenation + path.normalize() — this is actually the right choice for cross-platform correctness, because on POSIX, path.normalize() does not convert backslashes to forward slashes (they're valid filename characters). A naive os.homedir() + p.substring(1) approach would leave literal backslashes in the resolved path on Linux/macOS. The PR's path.join() handles this properly on all platforms.

No critical issues. No AGENTS.md violations. The diff is minimal and focused — exactly two files, no scope creep.

Testing

Before/After — Windows tilde expansion

runner@runnervm7b5n9:~/work/qwen-code/qwen-code$ node /tmp/triage-test-pr5298.mjs 2>&1 | tee /tmp/triage-before.log
=== PR #5298: fix(cli) expand windows-style tilde paths ===

Home directory: /home/runner
Platform: linux

--- Test: Windows tilde path ---
Input:    "~\\schemas\\input.json"
Expected: /home/runner/schemas/input.json

Before (main): ~\schemas\input.json
  Result: FAIL ❌ (tilde not expanded)

After (PR):    /home/runner/schemas/input.json
  Result: PASS ✅

--- Regression tests ---
  "~/schemas/input.json": before=/home/runner/schemas/input.json after=/home/runner/schemas/input.json expected=/home/runner/schemas/input.json ✅
  "~": before=/home/runner after=/home/runner expected=/home/runner ✅
  "": before= after= expected= ✅

Unit tests — all 7 pass

runner@runnervm7b5n9:~/work/qwen-code/qwen-code$ cd packages/cli && npx vitest run src/utils/resolvePath.test.ts 2>&1 | tee /tmp/triage-after.log

 RUN  v3.2.4 /home/runner/work/qwen-code/qwen-code/packages/cli
      Coverage enabled with v8

 ✓ src/utils/resolvePath.test.ts (7 tests) 5ms

 Test Files  1 passed (1)
      Tests  7 passed (7)
   Start at  20:11:26
   Duration  5.70s (transform 67ms, setup 130ms, collect 20ms, tests 5ms, environment 407ms, prepare 81ms)

Bug reproduced on main (tilde-backslash paths not expanded), fix confirmed with PR applied, all regression tests green.

中文说明

代码审查

实现正确。新的 else if (p.startsWith('~\\')) 分支使用了 path.join() + split/filter,而非已有分支的字符串拼接 + path.normalize() —— 这实际上是跨平台正确性的最佳选择,因为在 POSIX 上 path.normalize() 不会将反斜杠转换为正斜杠(反斜杠在 POSIX 上是合法的文件名字符)。简单的 os.homedir() + p.substring(1) 方式会在 Linux/macOS 上留下字面反斜杠。PR 的 path.join() 在所有平台上都能正确处理。

无关键问题。无 AGENTS.md 违规。diff 最小化且聚焦——仅两个文件,无越界改动。

测试

在主分支上复现了 bug(反斜杠波浪号路径未展开),应用 PR 后修复确认生效,所有回归测试通过。

Qwen Code · qwen3.7-max

@qwen-code-ci-bot

Copy link
Copy Markdown
Collaborator

Reflection

Stepping back — this is exactly the kind of PR you want to see from a first-time contributor. A real usability gap (Windows users typing ~\schemas\input.json and getting no tilde expansion), a minimal fix (8 lines + tests), and clean execution.

My instinct before reading the diff was to just add ~\ to the existing startsWith('~/') check and use the same string concatenation approach. The PR's path.join() + split/filter is actually better — it correctly handles the POSIX case where path.normalize() won't convert backslashes to forward slashes. So the PR exceeded my baseline.

Bug confirmed on main, fix confirmed with the patch, all 7 tests pass, no regressions on existing ~/, bare ~, or %USERPROFILE% paths. The diff is exactly two files with zero scope creep.

Approving. ✅

中文说明

反思

退一步看——这正是一位首次贡献者应该提交的 PR 类型。一个真实的可用性缺口(Windows 用户输入 ~\schemas\input.json 时无法展开波浪号),一个最小化的修复(8 行代码 + 测试),以及干净的执行。

我在阅读 diff 之前的直觉是在已有的 startsWith('~/') 检查中加上 ~\,使用同样的字符串拼接方式。PR 的 path.join() + split/filter 实际上更好——它正确处理了 POSIX 环境下 path.normalize() 不会将反斜杠转换为正斜杠的情况。所以 PR 超越了我的基线方案。

在主分支上确认了 bug,应用补丁后确认修复生效,全部 7 个测试通过,既有的 ~/、单独的 ~%USERPROFILE% 路径均无回归。diff 恰好两个文件,零越界改动。

批准合并。✅

Qwen Code · qwen3.7-max

@qwen-code-ci-bot qwen-code-ci-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, looks ready to ship. ✅

@wenshao
wenshao merged commit 933e946 into QwenLM:main Jun 18, 2026
58 checks 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.

3 participants