diff --git a/astrbot/core/core_lifecycle.py b/astrbot/core/core_lifecycle.py index f0e8e2144..ee40187f5 100644 --- a/astrbot/core/core_lifecycle.py +++ b/astrbot/core/core_lifecycle.py @@ -190,7 +190,6 @@ class AstrBotCoreLifecycle: task.cancel() for plugin in self.plugin_manager.context.get_all_stars(): - logger.info(f"正在终止插件 {plugin.name} ...") try: await self.plugin_manager._terminate_plugin(plugin) except Exception as e: diff --git a/astrbot/core/pipeline/process_stage/method/llm_request.py b/astrbot/core/pipeline/process_stage/method/llm_request.py index 353d9d3df..674a7fd79 100644 --- a/astrbot/core/pipeline/process_stage/method/llm_request.py +++ b/astrbot/core/pipeline/process_stage/method/llm_request.py @@ -58,9 +58,9 @@ class LLMRequestSubStage(Stage): if event.get_extra("provider_request"): req = event.get_extra("provider_request") - assert isinstance( - req, ProviderRequest - ), "provider_request 必须是 ProviderRequest 类型。" + assert isinstance(req, ProviderRequest), ( + "provider_request 必须是 ProviderRequest 类型。" + ) if req.conversation: req.contexts = json.loads(req.conversation.history) @@ -80,7 +80,6 @@ class LLMRequestSubStage(Stage): conversation_id = await self.conv_manager.get_curr_conversation_id( event.unified_msg_origin ) - req.session_id = event.unified_msg_origin if not conversation_id: conversation_id = await self.conv_manager.new_conversation( event.unified_msg_origin @@ -134,6 +133,10 @@ class LLMRequestSubStage(Stage): logger.debug("上下文长度超过限制,将截断。") req.contexts = req.contexts[-self.max_context_length * 2 :] + # session_id + if not req.session_id: + req.session_id = event.unified_msg_origin + try: need_loop = True while need_loop: diff --git a/astrbot/core/pipeline/whitelist_check/stage.py b/astrbot/core/pipeline/whitelist_check/stage.py index 85f911a60..b140d23ba 100644 --- a/astrbot/core/pipeline/whitelist_check/stage.py +++ b/astrbot/core/pipeline/whitelist_check/stage.py @@ -15,6 +15,9 @@ class WhitelistCheckStage(Stage): "enable_id_white_list" ] self.whitelist = ctx.astrbot_config["platform_settings"]["id_whitelist"] + self.whitelist = [ + str(i).strip() for i in self.whitelist if str(i).strip() != "" + ] self.wl_ignore_admin_on_group = ctx.astrbot_config["platform_settings"][ "wl_ignore_admin_on_group" ] @@ -53,7 +56,7 @@ class WhitelistCheckStage(Stage): return if ( event.unified_msg_origin not in self.whitelist - and event.get_group_id() not in self.whitelist + and str(event.get_group_id()).strip() not in self.whitelist ): if self.wl_log: logger.info( diff --git a/astrbot/core/star/star_manager.py b/astrbot/core/star/star_manager.py index 75a18317c..2d610f15c 100644 --- a/astrbot/core/star/star_manager.py +++ b/astrbot/core/star/star_manager.py @@ -596,7 +596,7 @@ class PluginManager: asyncio.get_event_loop().run_in_executor( None, star_metadata.star_cls.__del__ ) - else: + elif hasattr(star_metadata.star_cls, "terminate"): await star_metadata.star_cls.terminate() async def turn_on_plugin(self, plugin_name: str): diff --git a/astrbot/core/utils/io.py b/astrbot/core/utils/io.py index c996cadbd..5bd5d7c77 100644 --- a/astrbot/core/utils/io.py +++ b/astrbot/core/utils/io.py @@ -103,7 +103,7 @@ async def download_image_by_url( with open(path, "wb") as f: f.write(await resp.read()) return path - except aiohttp.client.ClientConnectorSSLError: + except (aiohttp.ClientConnectorSSLError, aiohttp.ClientConnectorCertificateError): # 关闭SSL验证 ssl_context = ssl.create_default_context() ssl_context.set_ciphers("DEFAULT") @@ -152,7 +152,7 @@ async def download_file(url: str, path: str, show_progress: bool = False): f"\r下载进度: {downloaded_size / total_size:.2%} 速度: {speed:.2f} KB/s", end="", ) - except aiohttp.client.ClientConnectorSSLError: + except (aiohttp.ClientConnectorSSLError, aiohttp.ClientConnectorCertificateError): # 关闭SSL验证 ssl_context = ssl.create_default_context() ssl_context.set_ciphers("DEFAULT") diff --git a/dashboard/src/views/ExtensionMarketplace.vue b/dashboard/src/views/ExtensionMarketplace.vue index 9e8587a6f..6fbce072a 100644 --- a/dashboard/src/views/ExtensionMarketplace.vue +++ b/dashboard/src/views/ExtensionMarketplace.vue @@ -63,14 +63,13 @@ import 'highlight.js/styles/github.css'; - +
{{ readmeDialog.error }}