Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure
TypeScript
fix(mcp-host): read a Grok 413 without a JSON code as payload_too_large (#739)
Alfredo Lopezf9f44feaaf81
diff --git a/mcp-host/package-lock.json b/mcp-host/package-lock.jsonindex 73ee20ae7..f4c6f849e 100644--- a/mcp-host/package-lock.json+++ b/mcp-host/package-lock.json@@ -1,12 +1,12 @@{"name": "clerum-mcp-host",- "version": "0.1.417",+ "version": "0.1.418","lockfileVersion": 3,"requires": true,"packages": {"": {"name": "clerum-mcp-host",- "version": "0.1.417",+ "version": "0.1.418","license": "SEE LICENSE IN LICENSE","dependencies": {"@anthropic-ai/sdk": "^0.32.0",diff --git a/mcp-host/package.json b/mcp-host/package.jsonindex 57805d1ca..9d1730067 100644--- a/mcp-host/package.json+++ b/mcp-host/package.json@@ -1,6 +1,6 @@{"name": "clerum-mcp-host",- "version": "0.1.417",+ "version": "0.1.418","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/grokLlmProxyClient.ts b/mcp-host/src/llm/grokLlmProxyClient.tsindex d2e988cd0..f405f35ad 100644--- a/mcp-host/src/llm/grokLlmProxyClient.ts+++ b/mcp-host/src/llm/grokLlmProxyClient.ts@@ -115,7 +115,15 @@ export class GrokLlmProxyClient {return this.streamOnce(input, false)}const payload = (await response.json().catch(() => ({}))) as Record<string, unknown>- const code = typeof payload.error === 'string' ? payload.error : 'provider_unavailable'+ // A 413 with no JSON code comes from the gateway in front of the proxy+ // (nginx `client_max_body_size`): a size refusal of this request, never a+ // provider outage (#739). A code the 413 carries still wins.+ const code =+ typeof payload.error === 'string'+ ? payload.error+ : response.status === 413+ ? 'payload_too_large'+ : 'provider_unavailable'throw new GrokProxyError(code, grokProxyErrorMessage(code, response.status))}if (!response.body) {