From 8e9c7544cf5dffe04ad9bf64a04314380d318bcc Mon Sep 17 00:00:00 2001 From: Soulter <905617992@qq.com> Date: Sun, 29 Jun 2025 15:54:32 +0800 Subject: [PATCH] fix: update type check for async generator in PipelineContext --- astrbot/core/pipeline/context.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/astrbot/core/pipeline/context.py b/astrbot/core/pipeline/context.py index 64a8762ed..d98f7c341 100644 --- a/astrbot/core/pipeline/context.py +++ b/astrbot/core/pipeline/context.py @@ -76,7 +76,7 @@ class PipelineContext: # 以前的 handler 会额外传入一个参数, 但是 context 对象实际上在插件实例中有一份 ready_to_call = handler(event, self.plugin_manager.context, *args, **kwargs) - if isinstance(ready_to_call, T.AsyncGenerator): + if inspect.isasyncgen(ready_to_call): _has_yielded = False try: async for ret in ready_to_call: