Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure
TypeScript
fix(mcp-host): classify ticket_expired as a retryable admission failure (#739)
Alfredo Lopezb8e17aa7a4ad
diff --git a/mcp-host/package-lock.json b/mcp-host/package-lock.jsonindex 191a73589..41e2ae311 100644--- a/mcp-host/package-lock.json+++ b/mcp-host/package-lock.json@@ -1,12 +1,12 @@{"name": "clerum-mcp-host",- "version": "0.1.432",+ "version": "0.1.433","lockfileVersion": 3,"requires": true,"packages": {"": {"name": "clerum-mcp-host",- "version": "0.1.432",+ "version": "0.1.433","license": "SEE LICENSE IN LICENSE","dependencies": {"@anthropic-ai/sdk": "^0.32.0",diff --git a/mcp-host/package.json b/mcp-host/package.jsonindex df69fee31..0bcc8bba6 100644--- a/mcp-host/package.json+++ b/mcp-host/package.json@@ -1,6 +1,6 @@{"name": "clerum-mcp-host",- "version": "0.1.432",+ "version": "0.1.433","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/codexSubscription.ts b/mcp-host/src/llm/codexSubscription.tsindex 1f98acf8b..3ca222dee 100644--- a/mcp-host/src/llm/codexSubscription.ts+++ b/mcp-host/src/llm/codexSubscription.ts@@ -440,6 +440,21 @@ export class CodexSubscriptionProvider implements SingleTurnProvider {...(providerDispatched !== undefined ? { providerDispatched } : {}),}}+ // control-api's 403 for a redeem that arrived after the execution ticket's+ // `exp`, passed through by the proxy. The request waited in admission and+ // never reached the provider: a capacity race, not a defect. Retryable, so+ // the next attempt re-authorizes with a fresh ticket; the failover class is+ // `provider_unavailable`. `ticket_replayed` and `ticket_invalid` are+ // defects and stay terminal in the generic arm below (#739).+ if (code === 'ticket_expired') {+ return {+ code: LlmErrorCode.ApiCallFailed,+ retryable: true,+ message: 'execution ticket expired before redeem; re-authorize',+ providerCode: code,+ ...(providerDispatched !== undefined ? { providerDispatched } : {}),+ }+ }if (code === 'provider_unavailable' || code === 'connection_unavailable') {return {code: LlmErrorCode.ModelOverloaded,diff --git a/mcp-host/src/llm/grokSubscription.ts b/mcp-host/src/llm/grokSubscription.tsindex 781695e2c..3adfd3a2d 100644--- a/mcp-host/src/llm/grokSubscription.ts+++ b/mcp-host/src/llm/grokSubscription.ts@@ -310,6 +310,21 @@ export class GrokSubscriptionProvider implements SingleTurnProvider {...(providerDispatched !== undefined ? { providerDispatched } : {}),}}+ // control-api's 403 for a redeem that arrived after the execution ticket's+ // `exp`, passed through by the proxy. The request waited in admission and+ // never reached the provider: a capacity race, not a defect. Retryable, so+ // the next attempt re-authorizes with a fresh ticket; the failover class is+ // `provider_unavailable`. `ticket_replayed` and `ticket_invalid` are+ // defects and stay terminal in the generic arm below (#739).+ if (code === 'ticket_expired') {+ return {+ code: LlmErrorCode.ApiCallFailed,+ retryable: true,+ message: 'execution ticket expired before redeem; re-authorize',+ providerCode: code,+ ...(providerDispatched !== undefined ? { providerDispatched } : {}),+ }+ }if (code === 'provider_unavailable' || code === 'connection_unavailable') {return {code: LlmErrorCode.ModelOverloaded,