fix: 保留插件开发热重载与代际候选 (#6483)

* fix(plugin): preserve development source admission

* test(plugin): cover runtime payload hot reload
This commit is contained in:
InfinityPacer
2026-08-27 20:16:24 +08:00
committed by GitHub
parent 011ebfbe5f
commit 8e7a553c1e
6 changed files with 184 additions and 8 deletions
+7 -3
View File
@@ -332,7 +332,7 @@ class PluginCatalogService:
base_plugins: list[Any],
markets: list[str],
) -> list[Any]:
"""每个仓库保留同一插件的最高兼容版本,供来源准入继续决策。"""
"""每个仓库和代际保留同一插件的最高版本,供来源准入继续决策。"""
higher_keys = {
(
plugin.repo_url,
@@ -357,9 +357,13 @@ class PluginCatalogService:
return markets.index(plugin.repo_url)
return len(markets)
result_by_source: dict[tuple[Optional[str], str], Any] = {}
result_by_source: dict[tuple[Optional[str], str, Optional[str]], Any] = {}
for plugin in sorted(all_plugins, key=repo_order):
key = (plugin.repo_url, normalize_physical_plugin_id(plugin.id))
key = (
plugin.repo_url,
normalize_physical_plugin_id(plugin.id),
plugin.package_version,
)
exists = result_by_source.get(key)
if not exists or self._version_compare(
plugin.plugin_version,
+6
View File
@@ -586,6 +586,12 @@ def select_plugin_candidate(
and local_selection.status is PluginSelectionStatus.INCOMPLETE
):
return local_selection
# 精确本地来源用于开发同步;未指定来源的启动与更新才参与在线版本协调。
if explicit_source and local_candidates is not None:
return local_selection or PluginSelection(
status=PluginSelectionStatus.UNAVAILABLE,
reason="所选本地仓库中没有该插件",
)
online = inventory.candidates_for(plugin_id)
if not online: