Skip to content

fix(openai-adapters): convert request timeout to milliseconds#12453

Open
kgarg2468 wants to merge 1 commit into
continuedev:mainfrom
kgarg2468:kgarg/fix-openai-timeout-units
Open

fix(openai-adapters): convert request timeout to milliseconds#12453
kgarg2468 wants to merge 1 commit into
continuedev:mainfrom
kgarg2468:kgarg/fix-openai-timeout-units

Conversation

@kgarg2468
Copy link
Copy Markdown

@kgarg2468 kgarg2468 commented May 21, 2026

Summary

  • Convert requestOptions.timeout from Continue's documented seconds to the OpenAI SDK's milliseconds before constructing the client.
  • Preserve omitted timeouts so the SDK default still applies.
  • Preserve explicit 0 instead of treating it as unset.

Fixes #12450.

Testing

  • npm test -- --run src/apis/OpenAI.test.ts src/test/openai-adapter.vitest.ts
  • npm run build -- --pretty false

Summary by cubic

Convert requestOptions.timeout in openai-adapters from seconds to milliseconds for the openai SDK to fix incorrect request timeouts. Preserves the SDK default when unset and respects an explicit 0.

  • Bug Fixes
    • Convert seconds to milliseconds before constructing the openai client.
    • Omit the timeout when not provided so the SDK default applies.
    • Respect 0 (no timeout) and add unit tests for conversion, omitted, and zero cases.

Written for commit a7c5fef. Summary will update on new commits. Review in cubic

@kgarg2468 kgarg2468 requested a review from a team as a code owner May 21, 2026 05:54
@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label May 21, 2026
@github-actions
Copy link
Copy Markdown
Contributor


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

No issues found across 2 files

Re-trigger cubic

@ScrewTSW
Copy link
Copy Markdown

bot?

@kgarg2468
Copy link
Copy Markdown
Author

Not a bot account, but I did use an AI coding assistant to prepare this small timeout-units fix.

I also checked the cancelled Windows VSIX run: the VSIX package and artifact upload both completed, and the cancellation happened later during post-job cache cleanup, so I do not see a code change needed for that job. Happy to adjust anything else reviewers want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

OpenAI adapter passes timeout to SDK without unit conversion (seconds vs milliseconds)

2 participants