fix: keep custom tool environments selectable

The custom Node.js and Python choices could appear unavailable until a candidate was already discovered, and selecting the source implicitly adopted the first candidate. The chooser now stays operable, waits for an explicit validated path, keeps cancellation quiet, and shows validation errors beside the affected runtime.

Candidate discovery now prioritizes active virtual environments and Conda before bounded user/system PATH and common Node/Python locations, while preserving canonical validation and deduplication.

Release note: 修复自定义 Node.js/Python 环境入口不可用的问题,并增加对 PATH、venv、Conda 和常见安装位置的解释器检测。
This commit is contained in:
mesalogo
2026-09-02 16:29:55 +08:00
parent be39665ca9
commit 4d9ab72778
12 changed files with 530 additions and 129 deletions
@@ -107,8 +107,10 @@ Python、虚拟环境或 Conda 环境时,也不能被 GoodBuddy 静默替换
### FR-3 自定义环境
- 探测 PATH 和常见安装位置中的有效候选。
- 探测当前虚拟环境、Conda 环境以及用户/系统常见解释器位置。
- 候选同时展示版本和规范化绝对路径。
- 用户可以选择未被探测到的可执行文件。
- “自定义环境”入口在没有候选时仍可操作,不自动选择首个候选。
- 保存前执行真实诊断。
- 已保存路径失效时保持用户选择并报错,不静默回退。