fix(plugin): 修复坏插件模块声明击穿模块调度导致接口大面积报错

- projection 只接受映射类型的 get_module 声明,非法值跳过并记日志
- dispatcher 同步/异步路径防御非映射方法表,单个坏插件被隔离
- media 端点改用 application 层插件运行时门面,消除分层违规依赖
- 图片能力测试打桩 models.dev 目录边界,适配仓库内离线目录留空

Closes #6346
This commit is contained in:
jxxghp
2026-08-18 15:53:28 +08:00
parent dc23977b0c
commit 8d62f33155
8 changed files with 124 additions and 16 deletions
+2 -2
View File
@@ -68,11 +68,11 @@ _BUILTIN_MEDIA_SOURCES = (
def _registered_media_sources() -> list[_SchemaMediaSourceInfo]:
"""合并内置与启用插件声明的媒体来源,并按来源标识去重。"""
from app.runtime.extensions.plugin_manager import PluginManager
from app.application.plugin.runtime import get_plugin_manager
result = list(_BUILTIN_MEDIA_SOURCES)
seen = {source.media_source for source in result}
for raw_source in PluginManager().get_media_sources():
for raw_source in get_plugin_manager().get_media_sources():
try:
source = _SchemaMediaSourceInfo.model_validate(raw_source)
except Exception: