Skip to content

Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure

TypeScript

fix(deploy): admit the 35 MiB Grok visual envelope on authorize and the proxy

Alfredo Lopezbf53749c94f5
diff --git a/control-api/package-lock.json b/control-api/package-lock.json
index c0d3f00d5..efe682948 100644
--- a/control-api/package-lock.json
+++ b/control-api/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "clerum-control-api",
- "version": "0.1.636",
+ "version": "0.1.637",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-control-api",
- "version": "0.1.636",
+ "version": "0.1.637",
"dependencies": {
"@clerum/display-field": "file:../packages/display-field",
"@clerum/grok-provider-attempt-contract": "file:../packages/grok-provider-attempt-contract",
diff --git a/control-api/package.json b/control-api/package.json
index 7bab7053e..52a7ddeb8 100644
--- a/control-api/package.json
+++ b/control-api/package.json
@@ -1,6 +1,6 @@
{
"name": "clerum-control-api",
- "version": "0.1.636",
+ "version": "0.1.637",
"description": "Internal Clerum control plane REST API + UI for managing CRDs and secrets",
"main": "dist/main.js",
"engines": {
diff --git a/control-api/src/routes/mcp-host/llmProviderAttempts.routes.ts b/control-api/src/routes/mcp-host/llmProviderAttempts.routes.ts
index 60f93168d..4cc98ff7b 100644
--- a/control-api/src/routes/mcp-host/llmProviderAttempts.routes.ts
+++ b/control-api/src/routes/mcp-host/llmProviderAttempts.routes.ts
@@ -1,4 +1,5 @@
import express, { type NextFunction, type Request, type Response, Router } from 'express'
+import { LIMITS as GROK_LIMITS } from '@clerum/grok-provider-attempt-contract'
import { LIMITS } from '@clerum/llm-provider-attempt-contract'
import { config } from '../../config.js'
import { asyncHandler } from '../../http/asyncHandler.js'
@@ -116,7 +117,11 @@ export function createMcpHostLlmProviderAttemptRoutes(gateway: K8sGateway): Rout
'/mcp-host/llm/provider-attempts/authorize',
...llmProviderAttemptAuthorizeRateLimits(),
requireMcpHostJwt,
- express.json({ limit: LIMITS.maxVisualRequestBodyBytes }),
+ // Shared by both providers: admit the larger visual envelope (Codex #660,
+ // Grok #784). Each authorizer then applies its own provider's limit.
+ express.json({
+ limit: Math.max(LIMITS.maxVisualRequestBodyBytes, GROK_LIMITS.maxVisualRequestBodyBytes),
+ }),
asyncHandler(async (req: Request, res: Response) => {
const claims = req.mcpHostJwt
if (!claims) {
diff --git a/deploy/base/control-plane/configmaps.yaml b/deploy/base/control-plane/configmaps.yaml
index 0e1b06964..300ba57ee 100644
--- a/deploy/base/control-plane/configmaps.yaml
+++ b/deploy/base/control-plane/configmaps.yaml
@@ -801,11 +801,13 @@ data:
location = /api/v1/mcp-host/llm/provider-attempts/authorize {
# V2 carries bounded inline images; keep the larger body allowance
# on this authenticated authorization route, not the whole gateway.
+ # The route is shared by both providers, so the value is the larger
+ # visual envelope: Grok 36700160 (#784) over Codex 25165824 (#660).
# It also covers the #731 non-image request cap (8 MiB) plus
# control-api's 16 KiB authorize envelope allowance, which nginx's
# 1m default would refuse before control-api sees it. nginx refuses
# to start when a location repeats this directive.
- client_max_body_size 25165824;
+ client_max_body_size 36700160;
limit_except POST {
deny all;
}
diff --git a/deploy/base/control-plane/grok-llm-proxy.yaml b/deploy/base/control-plane/grok-llm-proxy.yaml
index 557bf8425..6813ea39c 100644
--- a/deploy/base/control-plane/grok-llm-proxy.yaml
+++ b/deploy/base/control-plane/grok-llm-proxy.yaml
@@ -18,6 +18,11 @@ data:
GROK_LLM_PROXY_RUNTIME_PORT: "8080"
GROK_LLM_PROXY_ADMIN_PORT: "8081"
GROK_LLM_PROXY_PROBE_PORT: "9090"
+ # GROK_LLM_PROXY_MAX_BODY_BYTES is deliberately unset: the proxy derives it
+ # from LIMITS.maxRequestBodyBytes plus the envelope allowance (#731), and it
+ # governs ordinary and anonymous requests.
+ # V2 visual envelope (#784). Keep this equal to LIMITS.maxVisualRequestBodyBytes.
+ GROK_LLM_PROXY_MAX_VISUAL_BODY_BYTES: "36700160"
GROK_LLM_PROXY_MAX_STREAM_DURATION_MS: "1800000"
GROK_LLM_PROXY_MAX_DEADLINE_MS: "1800000"
GROK_LLM_PROXY_JWT_ISSUER: control-api