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)