requestOptions.timeout is documented as a timeout value and users naturally set it in seconds (e.g. timeout: 300 for 5 minutes). However, packages/openai-adapters/src/apis/OpenAI.ts passes this value directly to the OpenAI JS SDK constructor, which expects milliseconds.
A user setting timeout: 300 gets a 300ms timeout instead of 300 seconds, causing immediate "Connection error" failures, especially with local models that need time to load and process prompts.
Location: packages/openai-adapters/src/apis/OpenAI.ts line 48:
timeout: config?.requestOptions?.timeout || undefined,
The OpenAI SDK default is 600000 (10 minutes in ms). When a user sets timeout: 300, it becomes 300ms - 2000x shorter than intended.
This is likely a root cause for many reports in #11818. See also #11954 where a user sets timeout: 1200 thinking it's seconds.
Fix: multiply by 1000 before passing to the SDK.
requestOptions.timeoutis documented as a timeout value and users naturally set it in seconds (e.g.timeout: 300for 5 minutes). However,packages/openai-adapters/src/apis/OpenAI.tspasses this value directly to the OpenAI JS SDK constructor, which expects milliseconds.A user setting
timeout: 300gets a 300ms timeout instead of 300 seconds, causing immediate "Connection error" failures, especially with local models that need time to load and process prompts.Location:
packages/openai-adapters/src/apis/OpenAI.tsline 48:The OpenAI SDK default is
600000(10 minutes in ms). When a user setstimeout: 300, it becomes 300ms - 2000x shorter than intended.This is likely a root cause for many reports in #11818. See also #11954 where a user sets
timeout: 1200thinking it's seconds.Fix: multiply by 1000 before passing to the SDK.