refactor(cli): remove unused MemoryUsageDisplay component - #10238
Conversation
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
|
Thanks for the PR! Template looks good ✓ Problem: verified, not theoretical. I re-ran the corpus search independently against current Direction: aligned. Removing code nothing references is exactly the dead-surface cleanup tracked in #10000; nothing here touches behavior, public surface, or sensitive areas. Size: not applicable — the only changed file is Approach: the minimal possible change — a pure single-file deletion. The one judgment call is keeping the Risk: no elevated risk signals — the changed file matches none of the revert-correlated paths. Moving on to code review. 🔍 中文说明感谢贡献! 模板完整 ✓ 问题:已核实,并非理论性问题。本次复查中我在当前 方向:对齐。删除无任何引用的代码正是 #10000 跟踪的死代码表面清理;此处不涉及行为、对外接口或敏感领域。 规模:不适用——唯一改动的文件是 方案:最小改动——纯单文件删除。唯一的取舍是保留 风险:无升级风险信号——改动文件不匹配任何与 revert 相关的高风险路径。 进入代码审查 🔍 — Qwen Code · qwen3.8-max Reviewed at |
Code reviewThe diff is a pure 41-line deletion of Testing evidenceThis section carries the PR's own CI signal for commit Final CI results for
One row per check name (latest run); skipped checks omitted; failures sort first. / 每个检查名一行(取最新一次运行),省略 skipped,失败项排在最前。 CI has settled since the previous pass: every check on This is a pure deletion of code nothing references, so there is no behavioural claim to substantiate — no before/after evidence applies, and a sandboxed 中文说明代码审查diff 是对 测试证据本节的证据来自该 PR 针对提交 — Qwen Code · qwen3.8-max Reviewed at |
|
Confidence: 3/5 — clean review at every stage and CI fully green on the reviewed commit; the 3/5 is the fork-refactor policy cap, not doubt about the change. Honestly, there isn't much left to second-guess — and that's the point. The diff is the smallest this change could be: one unreferenced file deleted in its entirety, nothing else touched. I re-verified the central claim independently against current What changed since the last pass: CI settled all green on What has not changed is the policy, so I'll state it plainly: this gate never approves cross-repository Context worth keeping: this is one of several dead-code deletions the author has open (#10139 is the sibling). Judged on its own merits, this one stands — the evidence is mechanical and reproducible, and the only realistic risk of deleting a zero-reference symbol is a compile error, which CI has already caught and cleared. ⏸️ Deferring to @pomelo-nwu @wenshao — policy, not doubt: everything this gate can check is green at 中文说明置信度:3/5 —— 各阶段审查均干净,且被审查提交上的 CI 已全部通过;3/5 反映的是 fork-refactor 策略上限,而非对改动本身的疑虑。 说实话,这里没有多少需要反复掂量的地方——这正是重点所在。diff 已经是这类改动所能达到的最小形态:一个无任何引用的文件被整体删除,此外没有任何改动。本次复查我没有轻信 PR 的自述,而是在当前 自上一轮以来的变化:CI 在 没有变化的是策略,在此直说:本门禁从不批准跨仓库(fork)的 值得保留的背景:这是该作者当前在开的数个死代码删除 PR 之一(#10139 是姊妹篇)。就其本身的是非而言,这个 PR 站得住:证据是机械化、可复现的,而删除零引用符号唯一现实的风险是编译错误,CI 已经兜住并排除。 ⏸️ 转交 @pomelo-nwu @wenshao —— 是策略使然,并非存疑: — Qwen Code · qwen3.8-max Reviewed at |
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
中文说明
— qwen3.8-max via Qwen Code /review (v0.22.2)
|
@qwen-code /triage |
|
Sandboxed verification: ✅ passed — merge-ready (agent verdict) - workflow run Ran the PR in an isolated, token-free container: A/B against the base build, mock-free harness assertions, targeted gates. Advisory evidence for human reviewers — not a review, an approval, or a CI check. Scripted assertions: 38 passed · 0 failed · 38 total Flakiness gate: not applicable — no runnable changed test files (0 out-of-scope file(s) noted in the log) 中文 — 判定:✅ 通过 · 可合入(agent 判定)沙箱验证在隔离、无凭证的容器中执行了该 PR 的代码(与 base 构建 A/B 对照、无 mock harness 断言、定向门禁)。仅作为评审证据,不构成评审、批准或 CI 检查。 脚本断言:38 通过 · 0 失败 · 38 总计 抖动门:不适用 — no runnable changed test files (0 out-of-scope file(s) noted in the log) Verification reportPR #10238 Deep Verification —
|
| cell | tree | MemoryUsageDisplay hits |
case-insens. | kebab / dyn-import shape | flag keys (×3) |
|---|---|---|---|---|---|
| base | HEAD^1 (4a9fe44f) |
1 — MemoryUsageDisplay.tsx:14 self-declaration only |
1 | 0 | 0 (already retired) |
| head | HEAD (= PR 160bb87a merged) |
0 | 0 | 0 | 0 |
Witness: evidence/01-census-ab-base-vs-head.png. Supporting cells: diff shape is exactly one file, +0/−41; file exists at base / absent at head; git rev-list HEAD^1..HEAD^2 yields the single commit matching the metadata snapshot.
The author's specific claims were each re-checked by a second harness (claims.mjs, 6 assertions, witness evidence/02-pr-claim-checks.png):
| claim | check | result |
|---|---|---|
| "full-corpus search resolves to its own declaration" | base census = 1 hit (self) | ✅ |
"no show_memory_usage/showMemoryUsage/show-memory-usage remains anywhere" |
0 hits at base and head | ✅ (retired before this PR, as described) |
"formatMemoryUsage stays — many live consumers" |
8 production + 2 test consumer files at head; present in 6 bundle chunks | ✅ not orphaned |
| "typecheck does not run in CI" | ci.yml runs only typecheck:integration, no full-workspace typecheck step |
✅ accurate |
| nothing mounted it / no barrel export | no index.ts barrel; census covers export * re-export shapes |
✅ |
memoryusage-family set diff (base\head) |
exactly the deleted file (61 → 60 files) | ✅ |
Reviewer Test Plan, per step: (1) the literal search across packages integrations integration-tests scripts .github docs-site — zero hits, verified (and subsumed by the full-corpus census); (2) build && bundle && typecheck — build pre-run by the environment (dist output verified), bundle RC=0, full typecheck RC=0; (3) npm run lint:ci — RC=0. All three steps reproduce as promised.
Corrections
None — first round; no earlier review or bot claims to correct.
Findings
None attributable to this PR. The deletion is safe by construction: no importer, no mount point, no side effects, no barrel, no flag, no docs/locale/build-graph reference at either arm.
Transparency notes (verifier-side, not PR issues):
- The first
lint:cirun exited 1 with 9 errors — all in this verifier's own harness file (tmp/pr10238-verify-*/census-ab.mjs), becausetmp/**is outside the repo's node-globals ESLint blocks. Zero findings in the PR tree. After making the harness lint-clean,lint:ciexits 0. This incident doubles as the lint gate's liveness proof (it caught real violations and exited nonzero). - The raw
packages/clisuite shows 15 failures — every one proven environmental/pre-existing by scripted checks (witnessevidence/03-gates-and-attribution.png, harnessattribution.mjs, 13 assertions):
| failure group | n | proven cause | evidence |
|---|---|---|---|
settings.test.ts HOME/.env scenarios |
12 | this sandbox's own QWEN_HOME=/__w/_temp/verify-agent-home/.qwen leaks into the test process; user-settings resolution then reads $QWEN_HOME/settings.json, outside the tests' mocked paths |
re-run with QWEN_HOME unset: 173/173 pass (live, scripted) |
local-anchor.integration.test.ts sparse-checkout trio |
3 | container git 2.39.5 lacks the git sparse-checkout check-rules subcommand (present only in newer upstream git); invisibleTrackedPaths() fail-closes there by design, and the tests assert the exemption behavior |
base-arm A/A reproduces the same 3 failures with byte-identical test names (git worktree add tmp/base-tree HEAD^1; junit name comparison: identical); unknown subcommand: check-rules reproduced directly. CI runs newer git on ubuntu-latest, where these pass. |
Not covered
- Before/after TUI evidence — not applicable by construction and verified as such: at base the sole reference is the declaration itself (nothing rendered the component either), so there is no visual delta to capture.
- Integration tests / repo-wide
npm test— skipped by scope choice: the diff is one un-imported file (assertions D1–D3 + census), which cannot move any integration behavior; CI covers both lanes. - Base-arm full-suite run — proven unnecessary (every file except the deleted one is byte-identical across arms, asserted by diff shape; the census proves nothing imports it, so no test outcome can move). Only the failing sparse-checkout trio was re-run at base, where it fails identically. Note the base worktree resolved
@qwen-code/qwen-code-corethrough the head tree's symlink (asserted viareadlink -f); benign here because the PR touches no other package, and the nestednode_modulesgap (git-ignored, e.g.ajv@8.20.0underpackages/core) was bridged with symlinks of PR-invariant dependency content before the base run could collect. - macOS/Windows — no platform-specific code involved; not exercised.
- Per-commit attribution was reachable (exactly 1 commit) and is fully covered above.
- The sparse-checkout trio's root-cause behavior (fail-closed on old git) was verified only in this container's git 2.39.5; the pass path on a git new enough to have
check-rulesis covered by CI, not re-measured here.
Methodology
Environment: CI merge-ref checkout (HEAD = merge commit, HEAD^1 = base tip, HEAD^2 = PR head, depth 2) in the verify container (Node 22.23.2, git 2.39.5); npm ci + npm run build were pre-run at HEAD. Three harnesses drove everything, all preserved in this directory as .mjs for re-running: census-ab.mjs (19 assertions: diff shape, file existence, symbol/case/kebab/flag-key census on both trees, formatMemoryUsage non-orphaning, commit attribution), claims.mjs (6 assertions: family set diff, consumer counts, ci.yml typecheck claim, dist output state), attribution.mjs (13 assertions: recorded typecheck/bundle RCs, junit failure-name parity head vs base, full-suite counts, container-git limitation, gate liveness proofs, live clean-env settings re-run, live lint:ci, clean-tree check). Gates ran at head: npm run typecheck (RC=0), npm run lint:ci (RC=0 after harness hygiene), npm run bundle (RC=0; dist/cli.js + 461 chunks grepped), cd packages/cli && npx vitest run (25,523 pass / 15 fail / 90 skip). Gate liveness was proven, not assumed: lint caught 9 real violations (exit 1) and later the clean tree (exit 0); a planted TS2322 scratch file made typecheck fail (exit 2) and was removed; vitest caught the 15 environmental failures rather than passing silently. Base-arm A/A used git worktree add tmp/base-tree HEAD^1 with QWEN_VITEST_GUARD_ROOT pointed at the head root and nested node_modules symlinked (dep tree is PR-invariant); the worktree was removed after evidence capture. Raw logs live in logs/ (chain RCs in logs/chain.log, both arms' junit in logs/head-junit-cleanenv.xml / logs/base-junit.xml). Working tree verified clean at the end (git status --porcelain empty).
Flakiness gate log
verdict: n/a
summary: no runnable changed test files (0 out-of-scope file(s) noted in the log)
Evidence images
Harness scripts and raw logs are in the workflow run artifacts (7-day retention).
— Qwen Code · sandboxed verification
|
Triage re-run completed without a new review.
The stage comments above were updated with the latest result. View workflow run. 上方各阶段评论已更新为最新结果。查看工作流运行。 |



What this PR does
Removes a status-bar memory-usage display component that is no longer referenced anywhere in the codebase. The component polled process RSS on an interval and rendered a formatted reading, but nothing imports or mounts it — its only trace in the repository is its own declaration. Nothing else changes.
Why it's needed
The component arrived together with a debug flag that showed live memory usage in the footer. The flag's snake_case alias was deliberately removed by a follow-up cleanup, and the footer's rendering binding was removed with the welcome-screen redesign of January 2026; the flag itself and the matching setting were retired entirely afterwards. The display file was simply left behind. Today no flag, setting, or mount point exists, and a full-corpus search resolves the symbol to its own declaration. Dead surface is a cost: every contributor who reads it has to work out what wires it up, and the answer here is "nothing".
Reviewer Test Plan
How to verify
This is a pure deletion of code nothing references. Verify the absence of consumers rather than behavior:
rg -n '\bMemoryUsageDisplay\b' packages integrations integration-tests scripts .github docs-site— expect zero hits after this PR (the only hit before it is the component's own declaration).npm run build && npm run bundle && npm run typecheck— all green locally with this change (a type-only break from a removed export would surface here; typecheck does not run in CI).npm run lint:ci— green locally with this change.No user-visible behavior changes: nothing mounted the component, so no before/after TUI evidence applies.
Evidence (Before & After)
N/A — non-UI change (dead-code deletion; nothing rendered this component).
Tested on
Environment (optional)
Local
npm run build && npm run bundle && npm run typecheckandnpm run lint:ciin a clean worktree off upstreammain.Risk & Scope
formatMemoryUsagehelper the component used stays — it has many live consumers.Linked Issues
Part of the dead-surface cleanup tracked in #10000.
Machine details (find-simplifications)
memory-usage-display— class 1/5, orphan file whose feature left.packages/cli/src/ui/components/MemoryUsageDisplay.tsx(41 lines) — 41 deletions, 0 added (git diff --numstat)..github,.husky,.vscode,patches, root build/lint manifests, tracked.qwenfiles) resolves to exactly one path — the component's own declaration. Zero production consumers; checklist rows run:string-keys(noshow_memory_usage/showMemoryUsage/show-memory-usageremains anywhere in the tree),build-graph,vi-mock,dyn-import,cli-flags(the owning flag was already removed upstream, so nothing is turned into an "Unknown argument" failure); rows not applicable:generated,mirrors,assets. Second pass overintegration-testsand the component's own directory without test exclusions: only its own file.formatMemoryUsage(its one import) is consumed by ~10 live call sites and stays.01768d7759(An assistant message with │ │ "tool_calls" must be followed by tool messages responding to each "tool_call_id" #606), last touched 2025-10-23 by the Gemini-CLI v0.8.2 synceb95c131be— dated via the GitHub commits API path-limited against QwenLM/qwen-code; local clone is shallow), published-surface escape (territory ispackages/cli/src— landable, not a published package), full-corpus grep, own-file check, hidden-consumer checklist, test-only check (the surface had no test), unwire history (deliberate:8075300e34(chore: fix typos in code comments and a Java SDK example #7059, 2025-08-26) removed the snake_case flag alias fromconfig.ts;b804b1f48a(2026-01-16 welcome-screen redesign) removed the import and the{showMemoryUsage && <MemoryUsageDisplay />}rendering fromFooter.tsx; the kebab-case flag and theui.showMemoryUsagesetting are now absent from the tree entirely), design-doc ownership (none indocs/design/docs/plans).main(2bd0ff923e): same single hit; no drift from the survey.npm run build && npm run bundle && npm run typecheckgreen;npm run lint:cigreen; test-corpus re-grep on the landing checkout returned zero surviving references; no applicable targeted unit test (the surface had none). Self-audit: two clean passes.eslint.legacy-filenames.mjsentry (.tsxis outside the kebab-case rule's**/${name}.tsglobs — verified by grep), no i18n locale keys (the component renders formatted numbers and never callst()), no docs rows.中文说明
本 PR 做了什么
删除一个状态栏内存占用显示组件,它在代码库中已无任何引用。该组件曾定时轮询进程 RSS 并渲染格式化后的读数,但现在没有任何代码导入或挂载它——它在本仓库中的唯一痕迹就是它自己的声明。除此之外没有任何其他改动。
为什么需要
该组件随一个在页脚显示实时内存占用的调试 flag 一起引入。该 flag 的下划线别名已被一次后续清理有意移除,页脚中的渲染接线也在 2026 年 1 月的欢迎界面改版中被移除;此后该 flag 本身与对应的设置项也被完全废弃。只有这个显示组件文件被遗留了下来。如今既无 flag、无设置项、也无挂载点,全语料库搜索中该符号仅解析到它自己的声明。死代码是一种成本:每个读到它的人都得弄清是什么在用它,而这里的答案是"没有任何东西"。
评审者测试计划
如何验证
这是一次对无任何引用代码的纯删除。请验证消费者的缺失,而不是行为:
rg -n '\bMemoryUsageDisplay\b' packages integrations integration-tests scripts .github docs-site—— 本 PR 之后应无任何命中(之前唯一的命中是组件自身的声明)。npm run build && npm run bundle && npm run typecheck—— 本地在包含本改动的情况下全部通过(删除导出可能引发的纯类型问题会在这里暴露;typecheck 不在 CI 中运行)。npm run lint:ci—— 本地在包含本改动的情况下通过。没有用户可见的行为变化(没有任何东西挂载该组件),因此无需前后对比的 TUI 证据。
证据(改动前后)
N/A —— 非 UI 改动(死代码删除;没有任何东西渲染该组件)。
测试环境
环境(可选)
在基于上游
main的干净 worktree 中本地运行npm run build && npm run bundle && npm run typecheck与npm run lint:ci。风险与范围
formatMemoryUsage辅助函数保留——它有许多在用调用方。关联 Issue
属于 #10000 跟踪的死代码表面清理工作。
(机器细节见上方英文 "Machine details" 折叠块:id
memory-usage-display,第 1/5 类——功能移除后遗留的孤立文件。删除表面:packages/cli/src/ui/components/MemoryUsageDisplay.tsx(41 行),删除 41 行、新增 0 行。全语料库搜索恰好一处命中——组件自身声明。隐藏消费者核查:string-keys(show_memory_usage/showMemoryUsage/show-memory-usage在全树中已无残留)、build-graph、vi-mock、dyn-import、cli-flags(所属 flag 已被上游移除,不会造成 "Unknown argument" 失败);generated、mirrors、assets不适用。证明步骤:台账无墓碑;新近性——2025-05-30 由01768d7759(#606)引入,最近一次改动为 2025-10-23 的 Gemini-CLI v0.8.2 同步eb95c131be(本地为浅克隆,经 GitHub commits API 按路径查询完整历史定年);非发布包表面;解线历史为有意行为——8075300e34(#7059,2025-08-26)自config.ts移除下划线 flag 别名,b804b1f48a(2026-01-16 欢迎界面改版)自Footer.tsx移除导入与{showMemoryUsage && <MemoryUsageDisplay />}渲染;kebab 形式 flag 与ui.showMemoryUsage设置项如今在全树中均不存在;无设计文档认领。落地时已按最新上游main(2bd0ff923e)复核:仍为唯一命中,与调查时一致。验证:build + bundle + typecheck 通过,lint:ci通过,测试语料复扫零残留;无定向单元测试可跑(该表面本无测试)。无连带删除:无eslint.legacy-filenames.mjs条目(.tsx在该规则的**/${name}.ts展开之外,已用 grep 核实)、无 i18n 键(组件只渲染格式化数字,从不调用t())、无文档条目。)