Skip to content

fix: make /rtk verify and show actually probe the rtk binary - #1

Open
xelr233 wants to merge 1 commit into
sleepinginsummer:mainfrom
xelr233:pr/fix-rtk-probe
Open

fix: make /rtk verify and show actually probe the rtk binary#1
xelr233 wants to merge 1 commit into
sleepinginsummer:mainfrom
xelr233:pr/fix-rtk-probe

Conversation

@xelr233

@xelr233 xelr233 commented Aug 15, 2026

Copy link
Copy Markdown

摘要

修复插件识别不到已安装 rtk 的 bug:/rtk verify/rtk show 之前只读 state.rtkResolved 缓存(初始 undefined),永远输出 "not probed yet",而真正的探测只在 tools/pre-execute 里发生——用户若从不执行 bash 就永远探测不到。

变更

  • resolveRtk(signal, force=true) 绕过 60s 缺失缓存,/rtk verify/rtk show 强制重新探测
  • 探测失败时 verify 明确报告 rtk binary: NOT FOUND on PATH
  • 新增 5 个单测(verify/show 探测、NOT FOUND、重探测、help 列出 verify)
  • 修复 npm test 脚本(Node 24 下 node --test test/ 的 MODULE_NOT_FOUND)

测试

  • node --test test/*.test.js → 25 pass / 0 fail

verify/show only read the cached probe state, which stays undefined
until the first bash call, so an installed rtk was always reported as
"not probed yet" (the verify hint even told users to re-run a command
that never probes). Force a fresh probe (cache bypass) in both commands
and report the resolved path or NOT FOUND.

Also fix the npm test script for Node 24 (node --test test/ fails with
MODULE_NOT_FOUND) and add command tests covering verify/show probing.
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.

1 participant