Repository navigation
fix(plugins): 统一宿主授权并修复 macOS 测试 - #1775
Merged
Merged
Conversation
1lck
marked this pull request as ready for review
November 6, 2026 08:30
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
macOS 宿主重复维护插件宿主 API 的隐式服务、旧授权集合及授权判断;当方法与请求携带的服务不一致时,旧分发器仍可能进入原生处理器。后续增加方法时,两份规则也容易漂移。
改动 / Changes
plugins.hostApi.describe和plugins.hostApi.authorize,复用现有宿主方法目录和能力规则提供授权信息。不在本 PR 范围内 / Out of scope
类型专属:fix
复现与根因
lithe/host/editor/applyEdits,直接向 macOS 分发器传入同一方法但service=workspace:旧实现只看方法授权,继续进入 handler;期望按方法和服务的真实对应关系拒绝。9175bd734)引入的 Swift 分发器在本地维护隐式服务及授权判断,没有复核方法与服务的对应关系。33a8cef83)接入批次计划时固定传入已同步;尚未收到浏览器最后一次编辑的干净文档被跳过。cancellingSaveAllDuringRemoteDrainDoesNotWrite在修复前失败,修复后保存、取消和重置三种情形通过。检查项
PluginPublicHostAPITests.aMethodCannotBeDispatchedUnderADifferentService;旧分发器下该断言失败,修复后通过。全量测试中的 Save All 回归在修复前失败、修复后通过。范围检查 / Scope checks
功能矩阵 / Feature matrix
plugin-backend-workspace-context.json的 Core 授权与共享夹具证据,以及run-save-toolchain.json的保存同步证据;两端实现及验证状态保持真实情况。统一日志系统 / Structured logging
AppCoreFallbackSelected和PluginsHostRequestFailed目录事件,Core 调用失败时拒绝授权并记录稳定错误类别。node scripts/logging/generate-log-events.mjs --check和node scripts/logging/verify-log-usage.mjs。界面文案 / i18n
L10n文案。node scripts/i18n/verify-app-language-localization.mjs与node scripts/i18n/generate-i18n.mjs --check。逻辑归属 / Logic placement
性能与内存 / Performance and memory
设置 / Settings
N/A:未新增或修改设置。
插件与共享契约 / Plugin and shared contracts
发行包与资源 / Bundle and resources
无用代码与重构 / Dead code and refactoring
验证 / Verification
aMethodCannotBeDispatchedUnderADifferentService./scripts/rust-core/verify-rust-core.sh./scripts/architecture/verify-core.sh、verify-shared-contracts.sh未能执行的检查和原因: Windows 原生及图形工作流未运行;Windows 插件宿主由 #1478 推进。修复前,完整 macOS 测试在原生模态验证后第一个 WebKit 用例提前结束;旧分发器的对照运行同样复现。模态验证已隔离进带期限的子进程,并增加后续 WebKit 加载的回归用例;修复后完整测试通过。
提交前确认 / Final checks
preview创建分支,目标为preview。