From 53df73deb1477d1b30dd799e70c965702cf3703a Mon Sep 17 00:00:00 2001 From: shangxueink <1919892171@qq.com> Date: Sun, 28 Dec 2025 16:46:45 +0800 Subject: [PATCH 1/2] perf(satori): increase websocket max message size to 10MB Add max_size parameter to websocket connection to handle larger messages and prevent connection drops when receiving large payloads from Satori platform. --- astrbot/core/platform/sources/satori/satori_adapter.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/astrbot/core/platform/sources/satori/satori_adapter.py b/astrbot/core/platform/sources/satori/satori_adapter.py index 46f9a4e0f..5fa09b304 100644 --- a/astrbot/core/platform/sources/satori/satori_adapter.py +++ b/astrbot/core/platform/sources/satori/satori_adapter.py @@ -142,7 +142,12 @@ async def connect_websocket(self): raise ValueError(f"WebSocket URL必须以ws://或wss://开头: {self.endpoint}") try: - websocket = await connect(self.endpoint, additional_headers={}) + websocket = await connect( + self.endpoint, + additional_headers={}, + max_size=10 * 1024 * 1024 # 10MB + ) + self.ws = websocket await asyncio.sleep(0.1) From cf3aa892c9e87384845e8e8cd80d282f196517ab Mon Sep 17 00:00:00 2001 From: Soulter <37870767+Soulter@users.noreply.github.com> Date: Mon, 29 Dec 2025 23:59:14 +0800 Subject: [PATCH 2/2] chore: ruff format --- astrbot/core/platform/sources/satori/satori_adapter.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/astrbot/core/platform/sources/satori/satori_adapter.py b/astrbot/core/platform/sources/satori/satori_adapter.py index 5fa09b304..10912dc8e 100644 --- a/astrbot/core/platform/sources/satori/satori_adapter.py +++ b/astrbot/core/platform/sources/satori/satori_adapter.py @@ -143,9 +143,9 @@ async def connect_websocket(self): try: websocket = await connect( - self.endpoint, + self.endpoint, additional_headers={}, - max_size=10 * 1024 * 1024 # 10MB + max_size=10 * 1024 * 1024, # 10MB ) self.ws = websocket