Repository navigation
feat(toolchains): surface managed plugin runtimes and prepare on demand - #2195
Merged
Merged
Conversation
This was referenced Nov 19, 2026
Merged
7 of 10 tasks
1lck
added a commit
that referenced
this pull request
Nov 19, 2026
main fails the gofmt check since #2195 aligned only part of the struct. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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
此前插件安装与自动更新在提交阶段会阻塞等待
EnsureRuntimes下载全部managedRuntimes依赖(体积可达数百 MB),导致安装耗时过长甚至失败回滚;同时,已就绪的绑定受管目录未能只读传入工具链自动发现,未绑定tool字段的受管依赖(例如只作为只读安装目录给语言服务器消费的依赖)也无法在工具链 > 插件自用运行时中被看见或单独核验修复。本次改动将“安装插件”与“下载/校验受管运行时”彻底解耦:插件在程序审批后直接快速提交;用户可以在
构建、执行、部署 > 工具链 > 插件自用运行时查看所有声明的受管运行时与依赖,在缺失时点击 下载并准备、在就绪后点击 校验并修复(支持既有国内镜像测速与容灾切换、SHA-256 校验);语言服务器首次启动时仍保留自动按需准备通道。改动 / Changes
preparePluginInstall/commitPluginInstall移除EnsureRuntimes调用与基于其分支的取消超时覆盖,保留BeginRuntimeInstallation安装准入协同。applyPluginAutoUpdate移除EnsureRuntimes阻塞步骤。ManagedToolchainFacts与PreparePluginRuntimes,在不启动插件后端的前提下只读扫描manager.Find,分别汇总已绑定工具的候选目录与未绑定工具的ManagedDependency列表。Tool.ManagedRuntime、Tool.ManagedRuntimeHomes、Tool.ManagedOnly、Options.ManagedHomes、Options.ManagedTools、Options.ManagedDependencies与ManagedDependency;prepareTool只读摄入非工作区受管候选目录;Load将未绑定受管依赖泛化投影为audience: plugin、category: runtime、ManagedOnly: true的只读条目(使用managedDependencyToolID确保长度不超 Coretoolchains.settingsView上限)。managedToolchainOptions,并在settingsToolchains新增PrepareRuntime触发受管运行时准备并重试失败的语言服务器、重载当前/对应作用域快照。ToolchainRuntimePreparer接口、准备进度状态与通知栏实时阶段提示(RuntimeProgressText)。desktop.toolchains.prepareRuntime);所有已就绪的ManagedRuntime条目在 当前生效 卡片右上角统一提供 校验并修复(desktop.toolchains.verifyRuntime)。ManagedOnly条目仅展示只读目录、版本、受管运行时(host:managed)来源及说明卡片,屏蔽手动单选 Pin 与添加安装目录入口。受管运行时,并消除当前生效 > 来源与layerTag重复显示相同标签的问题。TestManagedToolchainFactsFeedToolchainResolutionWithoutStartingBackend,验证绑定工具与未绑定依赖在准备前后的无后端只读探测和toolchain.Load投影,以及只读探针不破坏包清单清单完整性。TestToolchainManagedRuntimeButtonPreparesAndClearsProblem与TestToolchainManagedOnlyDependencyViewAndPrepare。不在本 PR 范围内 / Out of scope
类型专属:feat
多平台对齐
Lithe 的目标是 macOS 与 Windows 能力对齐。必须选下面一项:
范围检查 / Scope checks
功能矩阵 / Feature matrix
shared/platform-feature-matrix/features/plugin-managed-runtimes.json:两端的实现状态和验证状态、证据路径、owner、验证动作都如实填写;没有运行验证的保持pending./scripts/platform-feature-matrix/verify-platform-feature-matrix.sh;改了平台实现路径的,还运行了./scripts/platform-feature-matrix/verify-platform-feature-matrix-change.sh origin/main HEAD.artifacts/下生成的矩阵视图plugin-managed-runtimes.json插件归属 / Plugin ownership
develop-lithe第三节“插件归属与宿主零依赖”的自查命令,结果为空shared/i18n/;插件的构建步骤、资源路径和补丁没有写进docs/ci-builds.md、Agent Note 或 SkillmanagedRuntimes清单;本地亦已在重编桌面端结合已启用插件实机打开工具链设置页确认效果UI 验证 / UI evidence
./scripts/desktop/desktop-go.sh test ./internal/settingswindow/通过(覆盖TestToolchainManagedRuntimeButtonPreparesAndClearsProblem与TestToolchainManagedOnlyDependencyViewAndPrepare的交互、状态切换与双文渲染断言;未另跑截图导出用例)pending)统一日志系统 / Structured logging
rust/logging/events/<root>.json声明,再用生成的事件类型和 span 记录;没有NSLog、os_log/Logger、直接写 stderr、print或手写事件 ID(复用现有performedIn/operationFailedIn边界与"toolchain.prepareRuntime"动作命名)path、错误用error类型,动态通道段来自已校验的 IDscripts/logging/)已移除,等价检查恢复前在“验证”一节写明日志门禁未完成,不记为通过界面文案 / i18n
shared/i18n/补齐中英词条,运行node scripts/i18n/generate-i18n.mjs并提交生成结果,没有手改生成文件;Viva 代码通过desktop/internal/i18n/的接口读取shared/i18n/node scripts/i18n/verify-app-language-localization.mjs和node scripts/i18n/generate-i18n.mjs --check,没有放宽脚本或扩大豁免名单逻辑归属 / Logic placement
refactorIssue:未修改原有 Core 可共享解析规则,PlanManagedRuntimes/ToolchainRegistry/ToolchainSettingsView仍在 Core;宿主仅执行manager.Find原生文件探测并将未绑定依赖投影进列表结构性能与内存 / Performance and memory
ManagedToolchainFacts在设置后台 worker 中只做目录校验而不启动插件后端,且移除安装期阻塞下载后插件安装不增加磁盘等待或常驻子进程;未新增大型依赖或热路径改动设置 / Settings
插件契约 / Plugin contract
N/A:本 PR 不改动 Rust Core 仓库中的
shared/plugins/contract/v1/契约、能力版本、插件后端协议或宿主方法/通知。发行包与资源 / Bundle and resources
./scripts/desktop/verify/verify-runtime-bundle-immutability.shdocs/ci-builds.md“独立工作树的本地编译”一节写清路径、归属、生命周期和能否跨工作树复制(复用原有<plugin-root>/.state/<plugin-id>/runtimes/受管状态目录,未新增缓存路径)无用代码与重构 / Dead code and refactoring
refactor标签的 Issue,没有在本 PR 顺手处理:所改动路径未发现需要顺手清理或额外拆单的既有无用代码验证 / Verification
以下均在变基到
origin/main(95130bbc0)后的当前提交上实测通过:node scripts/i18n/generate-i18n.mjs --checken-US&zh-CN11782/11782 完整)node scripts/i18n/verify-app-language-localization.mjs./scripts/agent-notes/verify-agent-notes.sh./scripts/desktop/verify/verify-runtime-bundle-immutability.sh./scripts/platform-feature-matrix/verify-platform-feature-matrix.sh./scripts/platform-feature-matrix/verify-platform-feature-matrix-change.sh origin/main HEADrg命令)./scripts/desktop/desktop-go.sh test ./internal/toolchain/ ./internal/pluginservice/ ./internal/settingswindow/ ./internal/workbench/toolchain1.875s、pluginservice20.582s、settingswindow4.040s、workbench273.300s)未能执行的检查和原因:
scripts/logging/,等价检查恢复前该日志门禁未运行。plugin-managed-runtimes功能矩阵的windows.verificationStatus仍保持pending。提交前确认 / Final checks
main创建并已变基到最新origin/main;目标分支为main.build/、target/、dist/、.artifacts/等产物,没有凭据、个人路径和未脱敏的日志或截图