Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add timeout to OpenAI Compatible Provider Client#9898

Merged
mrubens merged 3 commits intomainfrom
bug/fix_timeout_on_openAI_compatible_provider
Dec 9, 2025
Merged

Add timeout to OpenAI Compatible Provider Client#9898
mrubens merged 3 commits intomainfrom
bug/fix_timeout_on_openAI_compatible_provider

Conversation

@dcbartlett
Copy link
Contributor

@dcbartlett dcbartlett commented Dec 7, 2025

Related GitHub Issue

Closes: #

Description

Adds a timeout to the OpenAI Compatable Provider Client. This instructs the client to wait for the configured amount of timeout before giving up on the xhr request and marking it as an error.

Test Procedure

Run Added test.

npx vitest run api/providers/__tests__/base-openai-compatible-provider.spec.ts api/providers/__tests__/base-openai-compatible-provider-timeout.spec.ts api/providers/utils/__tests__/timeout-config.spec.ts

Manual testing can be done by using the provider with the cloud service and monitoring for timeout failures. The Client should recover more quickly and continue on with the agentic loop when a timeout occurs.

Pre-Submission Checklist

  • [-] Issue Linked: This PR is linked to an approved GitHub Issue (see "Related GitHub Issue" above).
  • Scope: My changes are focused on the linked issue (one major feature/fix per PR).
  • Self-Review: I have performed a thorough self-review of my code.
  • Testing: New and/or updated tests have been added to cover my changes (if applicable).
  • [-] Documentation Impact: I have considered if my changes require documentation updates (see "Documentation Updates" section below).
  • [-] Contribution Guidelines: I have read and agree to the Contributor Guidelines.

Documentation Updates


Important

Adds a configurable timeout to the OpenAI Compatible Provider Client, with tests to ensure correct behavior.

  • Behavior:
    • Adds timeout to OpenAI client in base-openai-compatible-provider.ts using getApiRequestTimeout().
    • Handles zero timeout as no timeout.
  • Tests:
    • New tests in base-openai-compatible-provider-timeout.spec.ts to verify timeout behavior.
    • Tests ensure correct timeout values are passed to OpenAI client.
  • Mocks:
    • Mocks getApiRequestTimeout in base-openai-compatible-provider-timeout.spec.ts to simulate different timeout scenarios.

This description was created by Ellipsis for 49a7ae1. You can customize this summary. It will automatically update as commits are pushed.

@dcbartlett dcbartlett requested review from cte, jr and mrubens as code owners December 7, 2025 06:34
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. Enhancement New feature or request labels Dec 7, 2025
@dcbartlett dcbartlett self-assigned this Dec 7, 2025
@roomote
Copy link
Contributor

roomote bot commented Dec 7, 2025

Rooviewer Clock   See task on Roo Cloud

Review complete. The changes since the last review have been verified and all tests pass.

Summary:

  • ✅ Timeout properly integrated into OpenAI client constructor via getApiRequestTimeout()
  • ✅ Comprehensive test coverage for timeout scenarios
  • ✅ New search_replace tool follows existing patterns with proper validation
  • ✅ Context management UI improvements with willManageContext helper and new components
  • ✅ All existing and new tests passing

No issues found.

Previous reviews

Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues.

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Dec 7, 2025
@dcbartlett dcbartlett force-pushed the bug/fix_timeout_on_openAI_compatible_provider branch from 6b77a9a to 49a7ae1 Compare December 8, 2025 20:21
Copy link
Collaborator

@hannesrudolph hannesrudolph left a comment

Choose a reason for hiding this comment

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

Approved: timeout is now passed to OpenAI-compatible client using validated config; tests cover default/custom/zero values.

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Dec 9, 2025
@mrubens mrubens merged commit 3356267 into main Dec 9, 2025
13 checks passed
@mrubens mrubens deleted the bug/fix_timeout_on_openAI_compatible_provider branch December 9, 2025 01:36
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Dec 9, 2025
@github-project-automation github-project-automation bot moved this from Triage to Done in Roo Code Roadmap Dec 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement New feature or request Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. lgtm This PR has been approved by a maintainer size:L This PR changes 100-499 lines, ignoring generated files.

Projects

No open projects
Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants