From 4128fbf3bf9325b2c790067efeeb42d83a56e3e4 Mon Sep 17 00:00:00 2001 From: admin Date: Mon, 14 Sep 2026 17:27:49 +0800 Subject: [PATCH] =?UTF-8?q?fix(extension):=20=E6=89=A7=E8=A1=8C=E5=99=A8?= =?UTF-8?q?=E5=AE=88=E5=8D=AB=E4=B8=8E=E6=B3=A8=E5=85=A5=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E2=80=94=E2=80=94active=5Fstore=20=E4=B8=8D=E5=AD=98=E5=9C=A8+?= =?UTF-8?q?=E5=8D=A0=E4=BD=8D=E8=AF=AF=E5=88=A4=E5=B7=B2=E6=B3=A8=E5=85=A5?= =?UTF-8?q?=E9=80=82=E9=85=8D=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 验收实测:176 启动日志『has no attribute active_store』(注入 跳过),且占位守卫按 type is ExtensionExecutor 判断——TL 接线的 适配器正是该类,已注入也会被误判 503。修复:注入走 get_store(); 守卫改判 _real is None(真正未注入)。 Co-Authored-By: Claude Fable 5 --- bioflow_service/app/context.py | 2 +- bioflow_service/app/services/bioflow/extensions.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/bioflow_service/app/context.py b/bioflow_service/app/context.py index acef6fd..cb880a8 100644 --- a/bioflow_service/app/context.py +++ b/bioflow_service/app/context.py @@ -168,7 +168,7 @@ async def init_context(db_path: str | None = None) -> Context: from .services.bioflow.extension_exec import ExtensionExecConfig, ExtensionExecutor as RealExecutor cfg = ExtensionExecConfig() real = RealExecutor(cfg) - store = ext_mod.active_store() + store = ext_mod.get_store() if store is not None: ext_mod.inject_real_executor(real, store) logger.info("extension executor wired (image suffix=%s)", cfg.docker_tag_suffix) diff --git a/bioflow_service/app/services/bioflow/extensions.py b/bioflow_service/app/services/bioflow/extensions.py index 52fa937..9918318 100644 --- a/bioflow_service/app/services/bioflow/extensions.py +++ b/bioflow_service/app/services/bioflow/extensions.py @@ -525,8 +525,10 @@ class ExtensionStore: )) executor = self.executor or ExtensionExecutor() - if isinstance(executor, ExtensionExecutor) and type(executor) is ExtensionExecutor: - # 占位执行器(Dev-B 未接入):明确 503 语义,绝不伪装成 trial_failed 触发修复循环 + if isinstance(executor, ExtensionExecutor) and executor._real is None: + # 占位执行器(未注入真实执行器):明确 503 语义, + # 绝不伪装成 trial_failed 触发修复循环。 + # 注意:TL 接线后的适配器也是 ExtensionExecutor 实例,但 _real 已注入。 raise ExtensionRunError( "扩展执行器未接入(extension_exec.py 由 Dev-B 实现;" "接口签名见 extensions.ExtensionExecutor)"