From 08fb65bfbcd2bd503d3c191c03309a49e6f6233c Mon Sep 17 00:00:00 2001 From: sfreeman422 Date: Mon, 29 Jun 2026 11:34:00 -0400 Subject: [PATCH 1/2] Bumped timeout to 30 seconds for openai since calls may take awhile --- packages/backend/src/config/openai.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/backend/src/config/openai.ts b/packages/backend/src/config/openai.ts index 6616e09b..4aeeca97 100644 --- a/packages/backend/src/config/openai.ts +++ b/packages/backend/src/config/openai.ts @@ -33,7 +33,7 @@ const parseIntWithDefault = (value: string | undefined, defaultValue: number): n }; export const getOpenAIClientConfig = (): OpenAIClientConfig => ({ - timeoutMs: Math.max(1, parseIntWithDefault(process.env.OPENAI_TIMEOUT_MS, 10_000)), + timeoutMs: Math.max(1, parseIntWithDefault(process.env.OPENAI_TIMEOUT_MS, 30_000)), retries: Math.max(0, parseIntWithDefault(process.env.OPENAI_RETRIES, 3)), backoffBaseMs: Math.max(0, parseIntWithDefault(process.env.OPENAI_BACKOFF_BASE_MS, 500)), circuitBreakerFailures: Math.max(1, parseIntWithDefault(process.env.CIRCUIT_BREAKER_FAILURES, 5)), From 5de0d8921e435b69348be2ccd923d7d3b746cd73 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 29 Jun 2026 18:02:19 +0000 Subject: [PATCH 2/2] docs: align OpenAI timeout default --- docs/resilient-openai.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/resilient-openai.md b/docs/resilient-openai.md index c0dc5b86..2623c68d 100644 --- a/docs/resilient-openai.md +++ b/docs/resilient-openai.md @@ -13,7 +13,7 @@ broader Moonbeam service. | Feature | Default | | -------------------------------------------------------- | ---------------------------------- | -| Per-request timeout | 10 s | +| Per-request timeout | 30 s | | Automatic retries with exponential backoff + full jitter | 3 retries | | `Retry-After` header honored on 429 responses | yes | | Circuit breaker | opens after 5 consecutive failures | @@ -47,7 +47,7 @@ All variables are optional. Defaults are shown. | Variable | Default | Description | | ------------------------------- | ------- | ------------------------------------------------------------- | | `FEATURE_FLAG_RESILIENT_OPENAI` | `true` | Set to `false` to bypass the wrapper entirely. | -| `OPENAI_TIMEOUT_MS` | `10000` | Maximum ms to wait for a single request before aborting. | +| `OPENAI_TIMEOUT_MS` | `30000` | Maximum ms to wait for a single request before aborting. | | `OPENAI_RETRIES` | `3` | Maximum retry attempts on transient errors. | | `OPENAI_BACKOFF_BASE_MS` | `500` | Base interval (ms) for exponential backoff with full jitter. | | `CIRCUIT_BREAKER_FAILURES` | `5` | Consecutive failures needed to open the circuit. |