Skip to content

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Aug 12, 2025

This PR adds support for custom base URLs in the Requesty provider, allowing users to connect to custom Requesty deployments (e.g., localhost or region-specific instances).

Changes

  • Added requestyBaseUrl field to provider settings schema
  • Updated RequestyHandler to use custom base URL when provided (defaults to https://router.requesty.ai/v1)
  • Updated fetcher functions to support custom base URL parameter
  • Added UI checkbox and text field for custom URL configuration (following the pattern from OpenRouter)
  • Updated webview message handler to pass base URL to model fetcher
  • Added tests for custom base URL functionality

How it works

  1. In the Requesty provider settings, users can now check "Use custom base URL"
  2. When checked, a text field appears where users can enter their custom Requesty URL
  3. If unchecked or the field is cleared, the provider reverts to the default Requesty URL

Testing

  • All existing tests pass
  • Added new test case for custom base URL initialization
  • Linting and type checks pass

Fixes #6983


Important

Adds support for custom base URLs in the Requesty provider, allowing users to specify a different API endpoint.

  • Behavior:
    • Adds requestyBaseUrl field to provider settings schema in provider-settings.ts.
    • Updates RequestyHandler in requesty.ts to use custom base URL if provided, defaulting to https://router.requesty.ai/v1.
    • Modifies getRequestyModels() in requesty.ts to accept a custom base URL.
    • Updates webviewMessageHandler in webviewMessageHandler.ts to pass base URL to model fetcher.
  • UI:
    • Adds checkbox and text field in Requesty.tsx for custom URL configuration.
  • Testing:
    • Adds test case in requesty.spec.ts for custom base URL initialization.
  • Misc:
    • Updates GetModelsOptions type in api.ts to include baseUrl for Requesty.

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

- Add requestyBaseUrl field to provider settings schema
- Update RequestyHandler to use custom base URL when provided
- Update fetcher functions to support custom base URL parameter
- Add UI checkbox and text field for custom URL configuration
- Update webview message handler to pass base URL to model fetcher
- Add tests for custom base URL functionality

Fixes #6983
@roomote roomote bot requested review from cte, jr and mrubens as code owners August 12, 2025 11:11
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. enhancement New feature or request labels Aug 12, 2025
Copy link
Contributor Author

@roomote roomote bot left a comment

Choose a reason for hiding this comment

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

Reviewing my own code is like debugging in a mirror - everything looks backward but somehow still broken.


const url = "https://router.requesty.ai/v1/models"
const apiBaseUrl = baseUrl || "https://router.requesty.ai/v1"
const url = `${apiBaseUrl}/models`
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Consider normalizing the URL to handle trailing slashes:
/models
This prevents potential double slashes if the base URL ends with a slash.

setApiConfigurationField("requestyBaseUrl", "")
}
}}>
{t("settings:providers.useCustomBaseUrl")}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is this intentional? The checkbox label says "Use custom base URL" but it could be more specific like "Use custom Requesty base URL" to match the field naming convention . This would provide better clarity when multiple providers are configured.

{requestyBaseUrlSelected && (
<VSCodeTextField
value={apiConfiguration?.requestyBaseUrl || ""}
type="url"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Consider adding URL validation before saving. While provides basic browser validation, you might want to ensure the URL is properly formatted (e.g., starts with http:// or https://) before allowing it to be saved.

})
})

it("initializes with custom base URL when provided", () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good test coverage for the custom base URL! Consider adding edge case tests for:

  • URL with trailing slash
  • Invalid URL format
  • Empty string handling when checkbox is unchecked

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Aug 12, 2025
@mrubens mrubens closed this Aug 12, 2025
@github-project-automation github-project-automation bot moved this from Triage to Done in Roo Code Roadmap Aug 12, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Aug 12, 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. size:M This PR changes 30-99 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Add custom URL option for Requesty provider

4 participants