Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/backend/src/routing/proxy/provider-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export interface ForwardResult {
isChatGpt: boolean;
}

const PROVIDER_TIMEOUT_MS = 180_000;
const PROVIDER_TIMEOUT_MS = parseInt(process.env.PROVIDER_TIMEOUT_MS ?? '', 10) || 180_000;
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai bot Apr 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: Environment timeout parsing does not reject negative values, so AbortSignal.timeout() can throw and break all provider forwarding when the env var is misconfigured.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/backend/src/routing/proxy/provider-client.ts, line 32:

<comment>Environment timeout parsing does not reject negative values, so `AbortSignal.timeout()` can throw and break all provider forwarding when the env var is misconfigured.</comment>

<file context>
@@ -29,7 +29,7 @@ export interface ForwardResult {
 }
 
-const PROVIDER_TIMEOUT_MS = 180_000;
+const PROVIDER_TIMEOUT_MS = parseInt(process.env.PROVIDER_TIMEOUT_MS ?? '', 10) || 180_000;
 
 /**
</file context>
Suggested change
const PROVIDER_TIMEOUT_MS = parseInt(process.env.PROVIDER_TIMEOUT_MS ?? '', 10) || 180_000;
const parsedTimeout = Number(process.env.PROVIDER_TIMEOUT_MS);
const PROVIDER_TIMEOUT_MS = Number.isInteger(parsedTimeout) && parsedTimeout >= 0 ? parsedTimeout : 180_000;
Fix with Cubic


/**
* Strip vendor prefix from model name (e.g. "anthropic/claude-sonnet-4" → "claude-sonnet-4").
Expand Down