Skip to content

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

TypeScript

fix: read an authorize gateway 413 as request_limit_exceeded (#731)

Alfredo Lopez5b72d608462f
diff --git a/mcp-host/package-lock.json b/mcp-host/package-lock.json
index ea8901b37..b040aaaa4 100644
--- a/mcp-host/package-lock.json
+++ b/mcp-host/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "clerum-mcp-host",
- "version": "0.1.400",
+ "version": "0.1.401",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-mcp-host",
- "version": "0.1.400",
+ "version": "0.1.401",
"license": "SEE LICENSE IN LICENSE",
"dependencies": {
"@anthropic-ai/sdk": "^0.32.0",
diff --git a/mcp-host/package.json b/mcp-host/package.json
index 5ab114477..41fba7d06 100644
--- a/mcp-host/package.json
+++ b/mcp-host/package.json
@@ -1,6 +1,6 @@
{
"name": "clerum-mcp-host",
- "version": "0.1.400",
+ "version": "0.1.401",
"description": "MCP Host - reads Host CRD and provides LLM access via OpenAI/Claude",
"main": "dist/main.js",
"engines": {
diff --git a/mcp-host/src/llm/providerAttemptAuthorizer.ts b/mcp-host/src/llm/providerAttemptAuthorizer.ts
index 0fd18520b..ef5d876d4 100644
--- a/mcp-host/src/llm/providerAttemptAuthorizer.ts
+++ b/mcp-host/src/llm/providerAttemptAuthorizer.ts
@@ -96,7 +96,15 @@ export class ProviderAttemptAuthorizer {
await this.options.refreshOnUnauthorized()
return this.authorizeOnce(body, false, signal)
}
- const code = typeof payload.error === 'string' ? payload.error : 'provider_unavailable'
+ // A 413 without a JSON code comes from the gateway in front of control-api
+ // (nginx `client_max_body_size`), not from control-api: it is a size
+ // refusal of this request, never a provider outage (#731).
+ const code =
+ typeof payload.error === 'string'
+ ? payload.error
+ : response.status === 413
+ ? 'request_limit_exceeded'
+ : 'provider_unavailable'
throw new CodexAuthorizeError(code, `authorize failed with ${response.status}`)
}
for (const key of LEAK_KEYS) {