fix(cli): honor list extensions flag#4673
Conversation
Stage 1: Template Gate — ✅ PassedAll required headings are present in the PR body:
Bilingual body (English + Chinese in 中文说明PR 模板检查通过。所有必需标题均存在: |
Stage 2: Product Direction Gate — ✅ AlignedClassification: Bug fix for a documented but non-functional CLI flag. Evidence:
Direction verdict: Clearly in-scope bug fix. No product direction concern. 中文说明分类: 修复已文档化但不可用的 CLI 参数。 证据:
方向判断: 明确的范围内 bug 修复,无产品方向问题。 |
Stage 3: KISS-Focused Code Review — ✅ CleanSummary: 57 additions, 9 deletions across 2 files. Minimal, focused bug fix with no unnecessary complexity. Implementation (
|
Stage 4: Real-Scenario Testing — ✅ PassedEnvironment: macOS (darwin), Node v22, PR branch Test 1: Unit test —
|
There was a problem hiding this comment.
Stage 5: Final Decision — ✅ Approved
All gates passed:
- Stage 1 (Template): All required headings present, bilingual body, linked issue.
- Stage 2 (Direction): Straightforward bug fix for a documented but non-functional flag. Qwen Code–specific feature, no parity question.
- Stage 3 (Code Review): Minimal change (4 lines of logic), correct placement, reuses existing handler, good test coverage, removes dead code.
- Stage 4 (Testing): Unit tests pass, regression tests pass, tmux real-CLI test confirms the fix. Windows CI failure is pre-existing and unrelated.
Recommendation: Approve and merge.
中文说明
所有关卡通过:
- Stage 1(模板): 所有必需标题存在,中英双语 body,关联 issue。
- Stage 2(方向): 明确的 bug 修复,修复已文档化但不可用的 CLI 参数。Qwen Code 特有功能,无竞品对齐问题。
- Stage 3(代码审查): 最小化改动(4 行逻辑代码),放置位置正确,复用已有处理器,测试覆盖良好,删除了死代码。
- Stage 4(测试): 单元测试通过,回归测试通过,tmux 真实 CLI 测试确认修复有效。Windows CI 失败为已有问题,与本 PR 无关。
建议: 批准并合并。
wenshao
left a comment
There was a problem hiding this comment.
No review findings. Downgraded from Approve to Comment: CI failing: Test (windows-latest, Node 22.x). — qwen3.7-max via Qwen Code /review
✅ Local runtime verification (real
|
| Command (PR build) | Result |
|---|---|
qwen --list-extensions |
lists both extensions, exit 0 |
qwen -l (short alias) |
byte-identical output, exit 0 |
qwen extensions list |
byte-identical output, exit 0 — confirms it reuses the same handleList |
qwen --list-extensions with a bare QWEN_HOME (no auth configured) |
lists solo-ext (2.0.0), exit 0, no auth/theme dialog — proves it exits before auth/sandbox/TUI |
Tests & static checks (PR build)
| Check | Result |
|---|---|
gemini.test.tsx -t "list-extensions" (author's targeted) |
1 passed |
gemini.test.tsx + commands/extensions/list.test.ts |
28 passed (2 files) |
eslint on gemini.tsx + gemini.test.tsx |
clean (exit 0) |
git diff --check on changed files |
no whitespace errors |
tsc --build (cli typecheck + emit) |
clean |
Side note: the PR description flags a local
TS5055blocking a full build — that's the known stale-packages/core/distissue. A clean rebuild ofcore(which clearsdist/first) resolves it; with that,clibuilds clean here.
Bottom line: the documented --list-extensions / -l behavior is restored — it prints the same output as qwen extensions list and exits (exit 0) before sandbox/auth/TUI, even with no auth configured, whereas main ignores the flag and drops into the interactive prompt. Targeted + full unit tests, eslint, whitespace and typecheck all green. 👍
Re-triage complete; all stages pass. Replacing with updated approval.
ddc8883 to
cc0b954
Compare
wenshao
left a comment
There was a problem hiding this comment.
No issues found. LGTM! ✅ — qwen-latest-series-invite-beta-v38 via Qwen Code /review
What this PR does
Wires the top-level
qwen --list-extensions/qwen -lflag to the existing extension list command and exits before the normal sandbox/auth/TUI startup path runs.Why it's needed
The flag is advertised in
qwen --help, but it currently falls through into the interactive CLI. This restores the documented non-interactive behavior and reuses the same listing code asqwen extensions list.Reviewer Test Plan
How to verify
Run
qwen --list-extensionsorqwen -lwith at least one installed extension. The command should print the extension list and exit instead of opening the interactive prompt.Evidence (Before & After)
Before:
qwen --list-extensionsignored the flag and launched the regular interactive prompt. After: the main startup path calls the extension list handler and exits before sandbox setup or app config startup. Regression coverage is inpackages/cli/src/gemini.test.tsx.Tested on
Environment (optional)
Windows, Node v24.15.0, npm 11.12.1.
Commands run:
Risk & Scope
packages/core/distdeclaration files being treated as TypeScript inputs (TS5055: Cannot write file ... because it would overwrite input file).Linked Issues
Fixes #4450
中文说明
这个 PR 做了什么
把顶层
qwen --list-extensions/qwen -l参数接到已有的扩展列表命令,并在进入常规 sandbox、auth、TUI 启动路径前退出。为什么需要
qwen --help已经声明了这个参数,但当前实现会忽略它并继续进入交互式 CLI。这个改动恢复文档中的非交互行为,并复用qwen extensions list的列表输出逻辑。Reviewer Test Plan
如何验证
安装至少一个 extension 后运行
qwen --list-extensions或qwen -l。命令应打印扩展列表并退出,而不是打开交互式 prompt。Before / After 证据
Before:
qwen --list-extensions忽略参数并启动普通交互界面。After:主启动流程调用 extension list handler,并在 sandbox setup 或 app config startup 前退出。回归测试在packages/cli/src/gemini.test.tsx。Tested on
Environment
Windows, Node v24.15.0, npm 11.12.1。
已运行命令:
风险和范围
packages/core/dist声明文件阻塞,TypeScript 报TS5055: Cannot write file ... because it would overwrite input file。关联 Issue
Fixes #4450