From f36a7f602d3ec406363fd389e44f7583ebad87a6 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Tue, 13 Oct 2026 01:38:49 +0400 Subject: [PATCH] refac --- backend/open_webui/socket/apps.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/open_webui/socket/apps.py b/backend/open_webui/socket/apps.py index be3b308c12..876020be0e 100644 --- a/backend/open_webui/socket/apps.py +++ b/backend/open_webui/socket/apps.py @@ -31,7 +31,7 @@ from sqlalchemy import select, update log = logging.getLogger(__name__) NAMESPACE = '/apps' -MAX_PACKET = 1048576 +MAX_PACKET = 16 * 1024 * 1024 class JSON: @@ -45,7 +45,7 @@ class JSON: class JSONPacket(Packet): def decode(self, encoded_packet): if not isinstance(encoded_packet, str) or len(encoded_packet.encode()) > MAX_PACKET: - raise ValueError('Socket packet exceeds 1 MiB or is not JSON') + raise ValueError('Socket packet exceeds 16 MiB or is not JSON') if encoded_packet[:1] in ('5', '6'): raise ValueError('Binary app packets are not supported') return super().decode(encoded_packet) @@ -202,7 +202,7 @@ class AppConnection: self.requests.add(task) try: if not isinstance(packet, dict) or len(JSON.dumps(packet).encode()) > MAX_PACKET - 128: - raise HTTPException(413, 'App request exceeds 1 MiB') + raise HTTPException(413, 'App request exceeds 16 MiB') operation = packet.get('operation') arguments = packet.get('arguments', {}) if not self.verified or (not self.ready and operation != 'ping'): @@ -217,7 +217,7 @@ class AppConnection: value = await execute_request(app, operation, arguments, db) result = {'status': 200, 'data': value} if len(JSON.dumps(result).encode()) > MAX_PACKET - 128: - raise HTTPException(413, 'App response exceeds 1 MiB') + raise HTTPException(413, 'App response exceeds 16 MiB') return result except HTTPException as exc: return {'status': exc.status_code, 'error': exc.detail}