From 4b39f294d98728f48d7c1778924be7319897c0f9 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 22 Jul 2026 12:14:20 +0000 Subject: [PATCH] Raise the encapsulated OHTTP request cap from 16 MiB to 20 MiB The Image Studio sends reference images inline (base64) and allows up to 10 attachments, so multi-image edit requests can legitimately exceed the old cap sized for a single ~10 MiB image. 20 MiB covers a ~14 MiB raw payload after base64/JSON overhead while still bounding enclave memory use. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01Pr2LKM6cnW5wbGo6DeRCZp --- tee_gateway/controllers/ohttp_controller.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tee_gateway/controllers/ohttp_controller.py b/tee_gateway/controllers/ohttp_controller.py index 463ca83..adb6d51 100644 --- a/tee_gateway/controllers/ohttp_controller.py +++ b/tee_gateway/controllers/ohttp_controller.py @@ -88,10 +88,11 @@ _SSE_CONTENT_TYPE = "text/event-stream" # Cap on the encapsulated request size. The inner payload is a chat-completion -# JSON body and may include base64 image attachments; 16 MiB covers roughly a -# 10 MiB raw image after base64/JSON overhead while still bounding enclave -# memory use for malicious or accidentally huge payloads. -_MAX_ENCAPSULATED_REQUEST_BYTES = 16 * 1024 * 1024 +# JSON body and may include base64 image attachments; 20 MiB covers roughly a +# 14 MiB raw image — or several attached reference images — after base64/JSON +# overhead while still bounding enclave memory use for malicious or +# accidentally huge payloads. +_MAX_ENCAPSULATED_REQUEST_BYTES = 20 * 1024 * 1024 # Fields that can re-identify a client and have no role in inference. We drop # them before forwarding to the inner handler — keeping them inside the