Repository navigation
feat(desktop): 工具链接受链接到主目录外的环境程序,宿主沿布局路径观测各级目录(#2316) - #2321
Merged
Merged
Conversation
- Core 固定版本升到 Lithe-core-rust#177 分支提交 33e6b60:工具定义可写 executableLinksOutsideHome(toolDefinitions 0 内的补充),程序链接到主目录外时, 按主目录下的布局路径探测和启动,中间目录必须留在主目录内。 - observeToolHome 改用 observeChain,记录布局路径上的每一级目录和程序的链接目标, Core 才能核对中间目录;只观测程序本身时,jre/bin/vm 这类路径缺 jre 的事实, Core 以 unsafePath 拒绝。 - 新增回归测试:真实符号链接的环境在定义允许时按布局路径选中、导出指向环境, 定义不允许时仍拒绝。 - 功能矩阵 plugin-injected-toolchains 补充说明与证据,状态仍 pending。
This was referenced Nov 23, 2026
Closed
xiaoyumuxi
marked this pull request as ready for review
November 23, 2026 05:12
This was referenced Nov 23, 2026
xiaoyumuxi
added a commit
that referenced
this pull request
Nov 23, 2026
8 of 11 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
关联 Issue / Linked issue
PR 类型 / Type
改动说明 / What changes
背景 / Why
项目外的虚拟环境(
python -m venv、uv、Poetry、Hatch 建在缓存目录里的环境)和 Homebrew 式的安装,bin/下的程序通常是指向基础安装的符号链接,目标在环境目录外。Core 目前只接受链接目标在主目录内的程序,所以这类环境不能固定、不能经homeVariable或发现规则选中,追踪里显示unsafePath。Core #177 新增了工具定义字段
executableLinksOutsideHome(toolDefinitions0 内的补充,不升能力版本):定义写了true时,程序可以链接到主目录外,Core 按主目录下的布局路径探测和启动,不用链接目标,所以程序仍能找到自己所在的环境;布局路径上的每一级中间目录必须实际是目录、规范化后在主目录内,并且不在工作区里。宿主要给 Core 这些中间目录的事实。
observeToolHome自 761e6f8(#2193)起只观测主目录、程序本身和pathPrepend目录,像jre/bin/vm这样的布局缺jre一级的事实,Core 只能按 fail closed 以unsafePath拒绝。改动 / Changes
scripts/desktop/build-desktop-core.sh:PINNED_CORE_REVISION升到 Core [Bug] Windows 0.3.0 bundled JDTLS exits before initialization and hides the underlying error #177 分支提交33e6b60(feat/toolchain-leaf-links-outside-home),并加注释。[Bug] Windows 0.3.0 bundled JDTLS exits before initialization and hides the underlying error #177 合入后换成 main 上的提交,做法同 feat(desktop): 插件设置区域的工具行可作工具选择器,在原处选择工具链安装 #2312 → fix(desktop): Core 固定版本从 #174 分支提交 a50cea1 换到 main dcb3d77 #2315。desktop/internal/toolchain/provider.go:observeToolHome对每个匹配当前平台的布局改用observeChain(home, 布局路径),记录路径上每一级目录和程序的链接目标;主目录与pathPrepend的观测不变。三个调用方(load.go的证据主目录和命令主目录、provider.go的提供者安装)都走这里,所以固定、fixed:{home}、homeVariable、发现规则和提供者上报的安装都覆盖到。desktop/internal/toolchain/environment_link_other_test.go(!windows):用合成清单testdata/runtime.plugin.json(dev.example.runtime:vm,布局jre/bin/vm)建一个环境,jre/bin/vm是指向另一个目录里基础程序的真实符号链接,只有布局路径的探测会答复版本。executableLinksOutsideHome: true:选中的程序是环境下的布局路径,版本 7.1,Home和导出的FICTIONAL_VM_HOME都指向环境。shared/platform-feature-matrix/features/plugin-injected-toolchains.json:补充 2026-11-23 的说明,在 macOS 证据里加上新测试;两端状态仍是pending。不在本 PR 范围内 / Out of scope
executableLinksOutsideHome: true。旧宿主的 Core 不认识这个字段,会拒绝整个清单,所以要等包含本 PR 的桌面端发版后,再在插件仓库发预发布版。类型专属:feat
多平台对齐
改动在 macOS 和 Windows 共用的
desktop/internal/toolchain。Windows 的 venv 里Scripts\python.exe通常是复制而不是链接,所以较少走到这条路径;在 Windows 上创建符号链接需要额外权限,新测试只在非 Windows 平台编译。范围检查 / Scope checks
功能矩阵 / Feature matrix
shared/platform-feature-matrix/features/plugin-injected-toolchains.json:补充说明和 macOS 证据路径,两端实现状态仍是partial、验证状态仍是pending(没有原生窗口和 Windows 验证)./scripts/platform-feature-matrix/verify-platform-feature-matrix.sh和./scripts/platform-feature-matrix/verify-platform-feature-matrix-change.sh origin/main HEAD.artifacts/下生成的矩阵视图插件归属 / Plugin ownership
develop-lithe第三节“插件归属与宿主零依赖”的自查命令,结果为空testdata/runtime.plugin.json(dev.example.runtime),在测试里加上新字段;没有读取具体插件,没有使用真实插件 IDshared/i18n/;插件的构建步骤、资源路径和补丁没有写进docs/ci-builds.md、Agent Note 或 SkillUI 验证 / UI evidence
N/A:没有界面变化。
统一日志系统 / Structured logging
N/A:没有新增或改动生命周期里程碑、终态、降级或失败路径的日志。拒绝原因仍通过已有的工具链追踪显示。
界面文案 / i18n
N/A:没有新增用户可见文字。
逻辑归属 / Logic placement
性能与内存 / Performance and memory
lstat),在工具链加载的后台任务里执行,不在主线程。事实数量仍远低于 Core 的上限 8192(宿主提供者路径 16384)设置 / Settings
N/A:没有新增或修改设置项。
插件契约 / Plugin contract
toolDefinitions0 内的补充,API-23):feat(toolchain): 工具定义可用 executableLinksOutsideHome 接受链接到主目录外的程序 Lithe-IDEA/Lithe-core-rust#177scripts/desktop/build-desktop-core.sh的PINNED_CORE_REVISION已升到包含该契约的 Core 提交33e6b60([Bug] Windows 0.3.0 bundled JDTLS exits before initialization and hides the underlying error #177 分支);桌面端测试经scripts/desktop/desktop-go.sh读到的就是这份契约。[Bug] Windows 0.3.0 bundled JDTLS exits before initialization and hides the underlying error #177 合入后换到 main 上的提交sdk-e2e.mjs:没有修改插件后端协议,只是清单里工具定义的新可选字段发行包与资源 / Bundle and resources
N/A:没有新增或修改运行时资源、缓存、下载物或构建步骤。
无用代码与重构 / Dead code and refactoring
observe仍用于主目录和pathPrepend目录验证 / Verification
GOFLAGS=-tags=vivahead scripts/desktop/desktop-go.sh test ./internal/toolchain/ -run TestAnEnvironmentProgramLinkedOutsideItsHomeStartsFromItsLayoutPath -count=1,把observeToolHome临时改回只观测程序trace reason = unsafePath,the environment was not selected(修复前失败)observeChainGOFLAGS=-tags=vivahead scripts/desktop/desktop-go.sh test ./internal/toolchain/ -count=1GOFLAGS=-tags=vivahead scripts/desktop/desktop-go.sh test ./... -count=1localshell的TestClosingAnIntegratedShellRightAfterACommandHangsUpItsJobs/zsh偶发失败外全部通过,该测试与本改动无关,重跑通过GOFLAGS=-tags=vivahead scripts/desktop/desktop-go.sh vet ./internal/toolchain/make fmt-check(desktop/)rg命令./scripts/platform-feature-matrix/verify-platform-feature-matrix.sh./scripts/platform-feature-matrix/verify-platform-feature-matrix-change.sh origin/main HEADCore 一侧的测试(字段准入、三个解析用例:环境链接到主目录外按布局启动、链接到主目录的兄弟目录、进入工作区或跳过
bin时拒绝)见 Core #177。未能执行的检查和原因:
提交前确认 / Final checks
main(cc1600283)创建;目标分支main.build/、target/、dist/、.artifacts/等产物,没有凭据、个人路径和未脱敏的日志或截图