fix(agents): pass run timeoutMs to OpenAI SDK HTTP client to override 10-min default#63797
fix(agents): pass run timeoutMs to OpenAI SDK HTTP client to override 10-min default#63797zozo123 wants to merge 1 commit into
Conversation
… 10-min default The OpenAI SDK defaults to a 600s HTTP timeout that silently terminates local inference requests exceeding 10 minutes regardless of user-configured agent timeouts. Thread `httpTimeoutMs` from the embedded run's `timeoutMs` through `resolveEmbeddedAgentStreamFn` into the `OpenAI`, `AzureOpenAI`, and completions client constructors so the SDK timeout matches the configured run timeout. Closes openclaw#63663 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Closing this PR because the author has more than 10 active PRs in this repo. Please reduce the active PR queue and reopen or resubmit once it is back under the limit. You can close your own PRs to get back under the limit. |
Greptile SummaryThis PR threads an The core logic is sound: Confidence Score: 5/5Safe to merge — all remaining findings are P2 suggestions and the core fix is correct. The implementation correctly overrides the SDK default for OpenAI, AzureOpenAI, and completions transports. Using the total run timeoutMs as the per-request HTTP ceiling is consistent with how the runAbortController handles the actual wall-clock abort. The only gap (WebSocket HTTP fallback missing wrapWithTimeout) is pre-existing and does not affect the targeted local-inference use case. No P0/P1 issues. stream-resolution.ts — minor gap on the WebSocket-to-HTTP fallback path (lines 118–123).
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 60f3924da2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const { httpTimeoutMs } = params; | ||
| const wrapWithTimeout = (fn: StreamFn): StreamFn => { | ||
| if (httpTimeoutMs === undefined) return fn; | ||
| return (m, context, options) => fn(m, context, { ...options, httpTimeoutMs }); | ||
| }; |
There was a problem hiding this comment.
Apply HTTP timeout to WebSocket-selected stream path
The new timeout wrapper is defined here but the shouldUseWebSocketTransport branch still returns a raw stream function before wrapWithTimeout is applied, so httpTimeoutMs is never injected for OpenAI WebSocket mode. In practice, when that WebSocket path degrades to HTTP fallback (fallbackToHttp in openai-ws-stream.ts) or when WS is selected but unavailable, the fallback request options still lack httpTimeoutMs, so the OpenAI SDK can continue using its 600s default and terminate long runs early.
Useful? React with 👍 / 👎.
Summary
httpTimeoutMsderived from the agent run'stimeoutMsinto theOpenAI,AzureOpenAI, and completions client constructorsCloses #63663