Skip to content

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

TypeScript

fix(codex): align authorization gateway image envelope limit

Alfredo Lopezae59117f46f2
diff --git a/deploy/base/control-plane/configmaps.yaml b/deploy/base/control-plane/configmaps.yaml
index 5b9b634d3..84adbb401 100644
--- a/deploy/base/control-plane/configmaps.yaml
+++ b/deploy/base/control-plane/configmaps.yaml
@@ -761,6 +761,9 @@ 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.
+ client_max_body_size 25165824;
limit_except POST {
deny all;
}
diff --git a/docs/architecture/codex-subscription-transport-contract.md b/docs/architecture/codex-subscription-transport-contract.md
index e39755c4e..a47e50f90 100644
--- a/docs/architecture/codex-subscription-transport-contract.md
+++ b/docs/architecture/codex-subscription-transport-contract.md
@@ -61,6 +61,10 @@ parser requires a valid platform identity on the visual completion route.
Admin and unauthenticated requests retain the ordinary configured body limit.
`CODEX_LLM_PROXY_MAX_VISUAL_BODY_BYTES` controls the visual transport ceiling;
`CODEX_LLM_PROXY_MAX_BODY_BYTES` continues to control ordinary requests.
+The internal authorization gateway also permits 24 MiB only at the exact
+`/api/v1/mcp-host/llm/provider-attempts/authorize` POST location. Other locations
+retain their prior limits, and the Authorization header and method restrictions
+are unchanged.
The proxy projects parts to Responses `input_text` and `input_image` items with
an inline data URL. The shape is grounded in the official Codex client
diff --git a/tests/e2e/integration/codex-subscription-contract-freeze.test.ts b/tests/e2e/integration/codex-subscription-contract-freeze.test.ts
index 6e60ca16a..342efb8ff 100644
--- a/tests/e2e/integration/codex-subscription-contract-freeze.test.ts
+++ b/tests/e2e/integration/codex-subscription-contract-freeze.test.ts
@@ -24,6 +24,22 @@ const architectureDocPath = join(
)
const validationDocPath = join(repoRoot, 'docs/testing/codex-subscription-validation.md')
+it('admits visual authorization envelopes only on the exact gateway route', () => {
+ const yaml = readFileSync(join(repoRoot, 'deploy/base/control-plane/configmaps.yaml'), 'utf8')
+ const gateway = yaml
+ .split('\n---')
+ .find(document => document.includes('name: nginx-workflow-approval-gateway'))!
+ expect(gateway).toBeTruthy()
+ const route = gateway.match(
+ /location = \/api\/v1\/mcp-host\/llm\/provider-attempts\/authorize \{([\s\S]*?)\n \}/
+ )?.[1]
+ expect(route).toContain('client_max_body_size 25165824;')
+ expect(route).toMatch(/limit_except POST\s*\{\s*deny all;/)
+ expect(route).toContain('proxy_set_header Authorization $http_authorization;')
+ expect(route).toContain('proxy_pass http://control_api_upstream;')
+ expect(gateway.match(/client_max_body_size/g)).toHaveLength(1)
+})
+
const REQUIRED_OPERATIONS = [
'oauth_browser',
'oauth_device',
diff --git a/tests/e2e/package-lock.json b/tests/e2e/package-lock.json
index ea0cfa63e..6c6c23be7 100644
--- a/tests/e2e/package-lock.json
+++ b/tests/e2e/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "clerum-e2e-tests",
- "version": "0.1.85",
+ "version": "0.1.86",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-e2e-tests",
- "version": "0.1.85",
+ "version": "0.1.86",
"devDependencies": {
"@types/jsonwebtoken": "^9.0.10",
"@types/node": "^22.0.0",
diff --git a/tests/e2e/package.json b/tests/e2e/package.json
index 81bd1e857..7f9f2ae67 100644
--- a/tests/e2e/package.json
+++ b/tests/e2e/package.json
@@ -1,6 +1,6 @@
{
"name": "clerum-e2e-tests",
- "version": "0.1.85",
+ "version": "0.1.86",
"private": true,
"type": "module",
"scripts": {