From 32e251c9cef4717a09dd817265e8bf4a84226074 Mon Sep 17 00:00:00 2001 From: Aniruddha Adak Date: Wed, 26 Aug 2026 22:01:35 +0530 Subject: [PATCH 1/2] fix(agent): run response hooks before yielding llm_result in skills_like fallback (#9788) In the skills_like tool requery fallback path, the runner yielded llm_result (sending the response to the user) before calling _complete_with_assistant_response, which triggers on_agent_done hooks. Plugins doing content safety review, sanitization, or rewriting could not affect text already sent. Moved the completion call before the yields. --- astrbot/core/agent/runners/tool_loop_agent_runner.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/astrbot/core/agent/runners/tool_loop_agent_runner.py b/astrbot/core/agent/runners/tool_loop_agent_runner.py index 8c91adbbfd..54b389ed07 100644 --- a/astrbot/core/agent/runners/tool_loop_agent_runner.py +++ b/astrbot/core/agent/runners/tool_loop_agent_runner.py @@ -936,6 +936,10 @@ async def step(self): logger.warning( "skills_like tool re-query returned no tool calls; fallback to assistant response." ) + # Complete the assistant response (including hooks) BEFORE + # yielding llm_result so response hooks run before the + # result is sent to the user (#9788). + await self._complete_with_assistant_response(llm_resp) if llm_resp.reasoning_content: yield AgentResponse( type="llm_result", @@ -958,7 +962,6 @@ async def step(self): ), ) - await self._complete_with_assistant_response(llm_resp) return else: llm_resp.tools_call_name = requery_resp.tools_call_name From 19fe56f111f04790dd93ddb3a6d0bfc6e7ef43e7 Mon Sep 17 00:00:00 2001 From: Aniruddha Adak Date: Wed, 26 Aug 2026 22:02:27 +0530 Subject: [PATCH 2/2] fix(config): always use global timezone instead of hidden profile value (#9706) Chat profiles can contain a hidden timezone field that is not exposed in the profile WebUI schema. This silently overrides the global timezone setting, leaving users unable to discover or change the effective timezone. Always read timezone from the global config to ensure consistent behavior. --- astrbot/core/astr_main_agent.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/astrbot/core/astr_main_agent.py b/astrbot/core/astr_main_agent.py index e168bbf400..e08d502d5b 100644 --- a/astrbot/core/astr_main_agent.py +++ b/astrbot/core/astr_main_agent.py @@ -1057,9 +1057,7 @@ async def _decorate_llm_request( skip_quote_image_caption=quote_images_already_captioned, ) - tz = config.timezone - if tz is None: - tz = plugin_context.get_config().get("timezone") + tz = plugin_context.get_config().get("timezone") _append_system_reminders(event, req, cfg, tz) await _apply_workspace_extra_prompt(event, req, plugin_context)