Repository navigation
fix(desktop): 卸载插件前等待构建、VCS 和调试会话退出 - #1921
Merged
Merged
Conversation
1lck
marked this pull request as ready for review
November 14, 2026 12:09
25 of 31 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
插件提供的构建、版本控制或调试进程仍在运行时卸载插件,旧流程只等待语言服务器和插件后端,再删除插件包与状态;构建清理发生在删包后的界面回调,VCS 和调试适配器没有加入卸载等待。在 Windows 上可能因可执行文件仍被占用而删包失败,在其他平台也可能重新写回已经删除的状态。
现在先阻断该插件的原生启动,取消并等待启动中的任务,再等待已运行的提供者与调试适配器退出,最后执行 Core 已有卸载计划中的文件删除。停止失败时保留插件包、批准记录和状态。
改动 / Changes
plugin_programs.go登记并取消构建/VCS 的原生启动;启动完成或迟到进程清理结束后才释放等待。已登记提供者清理失败时保留句柄,供下一次停止重试;无法确认的迟到启动清理失败继续阻断删除。Manager.Apply在stopPrograms失败时立即返回,保留后续文件和批准记录;其他步骤沿用 Core 的既有计划。pending。不在本 PR 范围内 / Out of scope
类型专属:fix
复现与根因
549696fdb)的卸载生命周期只传入语言服务器和后端停止;其他原生所有者没有参与删包前的等待。之后 Core 计划的执行器沿用“收集错误并继续步骤”,没有在原生停止失败时阻止文件删除。检查项
pluginmanager_test.go:TestUninstallPreservesFilesWhenProgramsCannotStop旧版失败为包和状态不存在、批准记录丢失;plugins_test.go:TestUninstallWaitsForTheDebugAdapter旧版失败为the package was removed before its adapter exited。提交前补充的TestEnableReopensVcsAfterCatalogRefresh先失败为build provider session is closed,再修复保留启动入口的恢复。.agents/notes/implemented/bug-fix/2026-11-13-viva-plugin-install-enables-and-uninstall-cleans-state.md记录。范围检查 / Scope checks
功能矩阵 / Feature matrix
shared/platform-feature-matrix/features/plugin-extension-management.json的证据与行为说明,两端状态如实保留partial/pending。origin/preview的能力变更门禁。.artifacts/下生成的矩阵视图。插件归属 / Plugin ownership
dev.lithe.test.*虚构清单与宿主可控的测试进程,不读取具体插件包、仓库或真实 ID。统一日志系统 / Structured logging
plugin_uninstall/debug 的统一操作失败边界;未新增 print、stderr 或新日志通道。界面文案 / i18n
N/A:没有新增或修改面向用户的文字,继续使用既有本地化错误与提示接口,未修改生成器或豁免。
逻辑归属 / Logic placement
plugins.installed.lifecycle;Go 只执行/等待原生进程和文件 I/O,不引入插件业务规则。性能与内存 / Performance and memory
设置 / Settings
N/A:未新增或修改设置项、设置页、工具配置来源或对话框选项。
插件契约 / Plugin contract
N/A:未修改 Core 契约、能力版本、插件后端协议、SDK、宿主方法或通知;无需 API 实施计划表或 Core pin 升级。
发行包与资源 / Bundle and resources
无用代码与重构 / Dead code and refactoring
验证 / Verification
TestEnableReopensVcsAfterCatalogRefresh修复前检查desktop-go.sh test -json ./... -count=1 -timeout=300s -p 2(逐项 HTML/JUnit)-race卸载、安装、调试清理与 detach 测试desktop-go.sh test -json ./... -count=1 -timeout=300s -p 2(逐项 HTML/JUnit)desktop-go.sh test -race ./internal/buildprovider ./internal/pluginmanager ./internal/pluginservice -count=1 -timeout=120sdesktop-go.sh test -race ./internal/workbench -run 'Test(Uninstall|ConfirmedInstall|DebugReleases|BuildRuntimeDetach|EnableReopensVcsAfterCatalogRefresh)' -count=1 -timeout=120sgit diff --check未能执行的检查和原因:
[skip ci];合并以本地验证为依据。提交前自检
未发现需要阻塞合并的问题。已检查原生句柄归属、状态目录创建前登记、迟到启动清理、UI/后台线程边界、失败保留与重新启用恢复;自检中发现的 VCS 恢复入口问题已补回归并修复。存量并发生命周期债务保留在 #1918,不关闭该 Issue。
提交前确认 / Final checks
059d878d4;目标分支 preview。