From 85b7f104dfda9dd29bb15a6dc30a6ebd73532163 Mon Sep 17 00:00:00 2001 From: Soulter <37870767+Soulter@users.noreply.github.com> Date: Sat, 29 Nov 2025 23:15:19 +0800 Subject: [PATCH] fix: remove unnecessary provider check (#3846) fixes: #3815 --- .../process_stage/method/agent_sub_stages/third_party.py | 7 +++++-- astrbot/core/pipeline/process_stage/stage.py | 8 -------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/astrbot/core/pipeline/process_stage/method/agent_sub_stages/third_party.py b/astrbot/core/pipeline/process_stage/method/agent_sub_stages/third_party.py index a54aa52d3..cf7f4d3da 100644 --- a/astrbot/core/pipeline/process_stage/method/agent_sub_stages/third_party.py +++ b/astrbot/core/pipeline/process_stage/method/agent_sub_stages/third_party.py @@ -91,9 +91,12 @@ class ThirdPartyAgentSubStage(Stage): (p for p in self.conf["provider"] if p["id"] == self.prov_id), {}, ) - if not self.prov_id or not self.prov_cfg: + if not self.prov_id: + logger.error("没有填写 Agent Runner 提供商 ID,请前往配置页面配置。") + return + if not self.prov_cfg: logger.error( - "Third Party Agent Runner provider ID is not configured properly." + f"Agent Runner 提供商 {self.prov_id} 配置不存在,请前往配置页面修改配置。" ) return diff --git a/astrbot/core/pipeline/process_stage/stage.py b/astrbot/core/pipeline/process_stage/stage.py index 2eeefcf11..e19b8dc18 100644 --- a/astrbot/core/pipeline/process_stage/stage.py +++ b/astrbot/core/pipeline/process_stage/stage.py @@ -1,6 +1,5 @@ from collections.abc import AsyncGenerator -from astrbot.core import logger from astrbot.core.platform.astr_message_event import AstrMessageEvent from astrbot.core.provider.entities import ProviderRequest from astrbot.core.star.star_handler import StarHandlerMetadata @@ -63,12 +62,5 @@ class ProcessStage(Stage): if ( event.get_result() and not event.get_result().is_stopped() ) or not event.get_result(): - # 事件没有终止传播 - provider = self.ctx.plugin_manager.context.get_using_provider() - - if not provider: - logger.info("未找到可用的 LLM 提供商,请先前往配置服务提供商。") - return - async for _ in self.agent_sub_stage.process(event): yield