From ac4097e9a10a813f36370474b2a4eea460f14ebb Mon Sep 17 00:00:00 2001 From: ARIA Date: Fri, 21 Aug 2026 00:43:42 +0200 Subject: [PATCH] =?UTF-8?q?android=20gateway:=20raise=20MAX=5FMESSAGE=5FLE?= =?UTF-8?q?NGTH=20to=201M=20so=20long=20replies=20(and=20complete=20HTML?= =?UTF-8?q?=20artifacts)=20aren't=20chunked=20across=20fence-reopened=20me?= =?UTF-8?q?ssages=20=E2=80=94=20the=20stream=20consumer=20defaults=20to=20?= =?UTF-8?q?4096=20when=20the=20adapter=20sets=20no=20cap,=20and=20WS=20has?= =?UTF-8?q?=20no=20message-size=20limit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gateway-plugin/adapter.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gateway-plugin/adapter.py b/gateway-plugin/adapter.py index abb960f..22b259e 100644 --- a/gateway-plugin/adapter.py +++ b/gateway-plugin/adapter.py @@ -869,6 +869,13 @@ class AndroidAdapter(BasePlatformAdapter): ``MessageEvent``s for ``handle_message()``. """ + # WS has no message-size limit. The stream consumer resolves its per-chat + # chunking budget via ``max_message_length_for_chat`` -> this attribute + # (defaulting to 4096 when unset), which would split long replies — and + # complete HTML artifacts — across multiple fence-reopened messages. A + # large cap disables that chunking so a reply arrives as a single message. + MAX_MESSAGE_LENGTH = 1_000_000 + def __init__(self, config, **kwargs): platform = Platform("android") super().__init__(config=config, platform=platform)