diff --git a/astrbot/core/astr_main_agent.py b/astrbot/core/astr_main_agent.py index 873303a17..426d28acf 100644 --- a/astrbot/core/astr_main_agent.py +++ b/astrbot/core/astr_main_agent.py @@ -1428,8 +1428,10 @@ async def build_main_agent( except Exception as exc: # noqa: BLE001 logger.error("Error occurred while applying file extract: %s", exc) + has_reply = any(isinstance(comp, Reply) for comp in event.message_obj.message) + if not req.prompt and not req.image_urls and not req.audio_urls: - if not event.get_group_id() and req.extra_user_content_parts: + if has_reply or req.extra_user_content_parts: req.prompt = "" else: return None diff --git a/astrbot/core/pipeline/process_stage/method/agent_sub_stages/internal.py b/astrbot/core/pipeline/process_stage/method/agent_sub_stages/internal.py index e8b0459fb..048174dfe 100644 --- a/astrbot/core/pipeline/process_stage/method/agent_sub_stages/internal.py +++ b/astrbot/core/pipeline/process_stage/method/agent_sub_stages/internal.py @@ -19,7 +19,7 @@ from astrbot.core.astr_main_agent import ( MainAgentBuildResult, build_main_agent, ) -from astrbot.core.message.components import File, Image, Record, Video +from astrbot.core.message.components import File, Image, Record, Reply, Video from astrbot.core.message.message_event_result import ( MessageChain, MessageEventResult, @@ -177,11 +177,15 @@ class InternalAgentSubStage(Stage): isinstance(comp, (Image, File, Record, Video)) for comp in event.message_obj.message ) + has_reply = any( + isinstance(comp, Reply) for comp in event.message_obj.message + ) if ( not has_provider_request and not has_valid_message and not has_media_content + and not has_reply ): logger.debug("skip llm request: empty message and no provider_request") return