fix(extension): 执行器守卫与注入修复——active_store 不存在+占位误判已注入适配器

验收实测:176 启动日志『has no attribute active_store』(注入
跳过),且占位守卫按 type is ExtensionExecutor 判断——TL 接线的
适配器正是该类,已注入也会被误判 503。修复:注入走 get_store();
守卫改判 _real is None(真正未注入)。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-09-14 17:27:49 +08:00
co-authored by Claude Fable 5
parent 68b45c60a0
commit 4128fbf3bf
2 changed files with 5 additions and 3 deletions
+1 -1
View File
@@ -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)
@@ -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)"