refactor(cli): remove unused useInputHistoryStore hook - #10041
Conversation
|
Thanks for the PR!
Moving on to code review. 🔍 中文说明感谢贡献!
进入代码审查 🔍 — Qwen Code · qwen3.8-max Reviewed at |
Code reviewBefore reading the diff, my independent plan for an unmounted hook was: delete the hook file, delete the test that exists only to cover it, and drop any lint-allowlist row exempting it — nothing else. The PR does exactly that, file for file:
No critical blockers, no convention violations, no drive-by changes. I re-grepped No sequence diagram or files table — a three-file pure deletion doesn't earn them. CI test evidenceFrom the PR's own CI on the reviewed commit (fetched via API, not re-run — the unit matrix takes ~30 min and is still in flight; the finalize workflow updates the table below once it settles). Everything completed so far is green; the three platform Final CI results for
One row per check name (latest run); skipped checks omitted; failures sort first. / 每个检查名一行(取最新一次运行),省略 skipped,失败项排在最前。 Not verified: local No sandboxed-lane line: there is no behavioural claim to settle — the claim is structural ("nothing references this"), and it is settled by the grep plus the CI suite. Real-scenario TUI testing: N/A (nothing user-visible changes). 中文说明代码审查读 diff 之前,我对"删除未挂载 hook"的独立方案是:删 hook 文件、删仅为覆盖它而存在的测试、删掉为其豁免的 lint 允许列表条目——仅此而已。本 PR 恰好逐项做到:
无阻断性问题、无规范违规、无顺手改动。我对全树(任意大小写、任意文件类型)重新 grep 了 无时序图与文件表——三个文件的纯删除不需要这些。 CI 测试证据来自该 PR 自身在受审提交上的 CI(经 API 获取,未重新运行——单元测试矩阵约需 30 分钟,仍在进行中;finalize 工作流会在其结束后就地更新上表)。目前已完成的检查全部通过;三个平台的 未验证:PR 描述中本地 无沙箱验证触发语:没有需要裁决的行为性论断——本 PR 的论断是结构性的("没有任何东西引用它"),已由 grep 与 CI 套件裁决。真实场景 TUI 测试:N/A(无用户可见变化)。 — Qwen Code · qwen3.8-max Reviewed at |
|
Confidence: 3/5 — clean review, but the fork-refactor guardrail needs a maintainer's sign-off. This is the kind of PR I'd merge without hesitation if the guardrail didn't apply: my independent plan for an unmounted hook was exactly what landed — hook file, its dedicated test, and the one allowlist row, nothing more — and the diff matches it file for file with zero churn. The dead-code claim isn't taken on faith; I re-grepped the full tree myself and the references are confined to the three deleted files, and the live The only open item is CI: the three platform Why I'm not approving: cross-repository PRs whose title is a 中文说明置信度:3/5 —— 审查本身干净,但 fork-refactor 守卫规则要求维护者签字。 如果没有守卫规则,这是我会毫不犹豫合入的一类 PR:我对"未挂载 hook"的独立方案与最终落地的 diff 逐文件一致——hook 文件、其专属测试、那一条允许列表条目,仅此而已,零顺手改动。死代码论断不是照单全收:我自行对全树重新 grep,确认引用仅存在于被删除的三个文件中;仍在使用的 唯一未决项是 CI:受审时三个平台的 不批准的原因:标题为 — Qwen Code · qwen3.8-max Reviewed at |
|
⏸️ Deferring to @chiga0 — this is a cross-repository PR with a 中文说明⏸️ 转交 @chiga0 —— 本 PR 为跨仓库(fork)提交且标题为 — Qwen Code · qwen3.8-max |
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
中文说明
— qwen3.8-max via Qwen Code /review (v0.22.0)
|
🤝 Takeover engaged: the autofix loop now manages this PR — it will address new review feedback and resolve base conflicts until the label is removed or the round cap is reached. Remove the 中文说明🤝 已接管:autofix 循环现在管理此 PR —— 将持续处理新的评审反馈与 base 冲突,直到移除标签或达到轮次上限。移除 |
|
🤖 Reviewed the latest feedback — no changes needed. Why, point by point: · 已审阅最新反馈——无需改动。逐点说明原因如下: Autofix review round: no action neededThis round made no code changes — the new feedback contains no actionable findings. Feedback triage
Local state verificationThe PR remains a purely subtractive change (412 deletions, 0 additions) removing the unused No commit was created this round. 中文说明Autofix 审查轮次:无需操作本轮未做任何代码变更——新反馈中没有任何可执行的发现。 反馈分类
本地状态核实本 PR 仍然是一个纯删减型变更(删除 412 行、新增 0 行),移除了未使用的 本轮未创建任何提交。 Base-conflict check · 基分支冲突检查: no conflict with main. · 与 main 无冲突。 🧠 Handled by Qwen Code · model/模型 |
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
中文说明
— qwen3.8-max via Qwen Code /review (v0.22.0)
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
No issues found. LGTM! ✅
中文说明
未发现问题。LGTM!✅
— qwen3.8-max via Qwen Code /review (v0.22.0)
|
🤖 Reviewed the latest feedback — no changes needed. Why, point by point: · 已审阅最新反馈——无需改动。逐点说明原因如下: Autofix address-review — no action this round (PR #10041)TriageThe only new feedback point is review [rv:5026387615] from the automated reviewer: a downgrade from Approve to Comment citing "CI failing: Test (windows-latest, Node 22.x)". Its findings ledger is empty (0 findings posted), so there is no code-level finding to address. Disposition: declined with evidence below. Why no change is madeThe downgrade reason is stale and not actionable on this branch:
OutcomeNo code changes this round. The branch stays at 中文说明Autofix address-review — 本轮不做任何修改(PR #10041)分类唯一的新反馈点是自动审查器的评审 [rv:5026387615]:以 "CI failing: Test (windows-latest, Node 22.x)" 为由,将批准(Approve)降级为评论(Comment)。其发现清单为空(发布了 0 条发现),因此没有需要处理的代码级发现。处置:基于以下证据拒绝(decline)。 不做修改的原因该降级理由已过期,且在本分支上无法采取行动:
结论本轮不做任何代码修改。分支保持在 Base-conflict check · 基分支冲突检查: no conflict with main. · 与 main 无冲突。 🧠 Handled by Qwen Code · model/模型 |
|
Released in v0.22.2. |
What this PR does
Removes an input-history hook that is no longer referenced anywhere in the codebase, together with the test that existed solely to cover it and the legacy filename-allowlist entry that exempted it. The hook was written to manage prompt-input history independently of chat history (surviving
/clear), but nothing in the application mounts or calls it; its only references were its own unit test and one allowlist row. The input history actually in use is provided by a separate hook that the prompt component mounts. Nothing else changes.Why it's needed
Dead surface is a cost: every contributor who reads it has to work out what wires it up, and the answer here is "nothing". The hook arrived with an upstream sync and was never wired in this repository's history — no production caller, no string-keyed registry entry, no dynamic import path. Its dedicated test exists only to cover the hook itself, so it goes with it, and the filename-allowlist row that exempted the now-removed files is deleted in the same change to avoid leaving a stale entry behind.
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 '\buseInputHistoryStore\b' packages integrations integration-tests scripts .github docs-site— expect zero hits after this PR (before it the only references were the hook, its test, and the allowlist row). Note the live, unrelateduseInputHistoryhook (noStore) is untouched and remains mounted by the prompt component.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 (the removed allowlist row no longer exempts any surviving file, verified by stem check).No user-visible behavior changes, so no before/after TUI evidence applies.
Evidence (Before & After)
N/A — non-UI change (dead-code deletion; nothing mounted or called this hook).
Tested on
Environment (optional)
Local
npm run build && npm run bundle && npm run typecheckandnpm run lint:ciin a clean worktree offupstream/main.Risk & Scope
.qwenfiles; if a consumer were ever found, reverting the single commit restores everything.Linked Issues
Part of the dead-surface cleanup tracked in #10000.
Machine details (find-simplifications)
use-input-history-store— class 1, dead hook with its dedicated test and its filename-allowlist row.packages/cli/src/ui/hooks/useInputHistoryStore.ts(118 lines),useInputHistoryStore.test.ts(293 lines), and one row ineslint.legacy-filenames.mjs— 412 lines deleted, 0 added (git diff --numstat)..github,.husky,.vscode,patches, root build/lint manifests, tracked.qwenfiles) resolves to exactly three references — the hook's own declaration (production, in-file), its dedicated test (test-only), and theeslint.legacy-filenames.mjsallowlist row (lint scaffolding). Zero production consumers. The exported return-type interface is used only as the hook's own return type. Hidden-consumer checklist rows run:string-keys(theINPUT_HISTORY_STOREdebug-logger name appears only in-file),build-graph,generated,vi-mock,mirrors,dyn-import— all clean;cli-flags/assetsnot applicable. No integration-test or snapshot reference (second pass without test exclusions); no design-doc or plan mention. The live input-history implementation is the distinctuseInputHistoryhook mounted by the prompt component — untouched here.console→debugLoggermigration, ~7 months back, well past the 90-day gate), published-surface escape (territory ispackages/cli/src— landable, notpackages/core/channels/SDK/acp-bridge), full-corpus grep, own-file check, hidden-consumer checklist, test-only check, unwire history (never wired — born dead), design-doc ownership (none).upstream/main(a6d30ebc6b): same three references, no new consumer, branch base fetched successfully before cutting.npm run build && npm run bundle && npm run typecheckgreen;npm run lint:cigreen; targeted vitest skipped by design (the deletion carries the surface's only test — no applicable targeted unit test; corpus re-grep on the landing checkout returned zero surviving references). Allowlist stem check confirms no surviving file shares theuseInputHistoryStorestem. Self-audit: two clean passes.useInputHistoryallowlist row (a separate live hook) is untouched.中文说明
本 PR 做了什么
删除一个在代码库中已无任何引用的输入历史 hook,以及仅为覆盖它而存在的测试和为它豁免命名的旧文件名允许列表条目。该 hook 原本用于独立于聊天历史管理输入历史(不受
/clear影响),但应用中没有任何地方挂载或调用它;它唯一的引用就是它自己的单元测试和一条允许列表条目。真正在使用的输入历史由另一个独立的、被输入框组件挂载的 hook 提供。除此之外没有任何其他改动。为什么需要
死代码是一种成本:每个读到它的人都得弄清是什么在用它,而这里的答案是“没有任何东西”。该 hook 随一次上游同步进入本仓库,在整个历史中从未被接线——没有生产调用者、没有字符串键注册项、没有动态导入路径。它专属的测试只为覆盖该 hook 本身而存在,因此一并删除;为这些文件豁免命名的允许列表条目也在同一改动中删除,以免留下过期条目。
评审者测试计划
如何验证
这是一次对无任何引用代码的纯删除。请验证消费者的缺失,而不是行为:
rg -n '\buseInputHistoryStore\b' packages integrations integration-tests scripts .github docs-site—— 本 PR 之后应无任何命中(之前仅有的引用即该 hook、其测试与允许列表条目)。注意:仍在使用、与之无关的useInputHistory(无Store后缀)hook 未被触碰,仍被输入框组件挂载。npm run build && npm run bundle && npm run typecheck—— 本地在包含本改动的情况下全部通过(删除导出可能引发的纯类型问题会在这里暴露;typecheck 不在 CI 中运行)。npm run lint:ci—— 本地在包含本改动的情况下通过(被删除的允许列表条目不再豁免任何仍存在的文件,已按主干核查确认)。由于没有用户可见的行为变化,无需前后对比的 TUI 证据。
证据(改动前后)
N/A —— 非 UI 改动(死代码删除;该 hook 从未被挂载或调用)。
测试环境
环境(可选)
在基于
upstream/main的干净 worktree 中本地运行npm run build && npm run bundle && npm run typecheck与npm run lint:ci。风险与范围
.qwen文件)验证;万一未来发现消费者,回滚这一个提交即可完整恢复。关联 Issue
属于 #10000 跟踪的死代码清理工作。
机器细节见上方英文 “Machine details (find-simplifications)” 折叠块:候选编号
use-input-history-store(第 1 类:死 hook 连同其专属测试与文件名允许列表条目),共删除 412 行、新增 0 行;全语料库搜索证明引用恰为 hook 自身声明、其专属测试与允许列表条目三处;调查协议各步骤及落地前的重新核验(基准为刚拉取的upstream/main)均已执行;构建、打包、类型检查与lint:ci全部通过;因删除本身带走了该表面唯一的测试,按流程跳过定向 vitest,改以落地检出上的语料库复扫(零残留引用)兜底;无快照、无 i18n 键、无文档行等连带清理项,相邻的useInputHistory(另一个在用的 hook)允许列表条目未被触碰。