Skip to content

Conversation

@taltas
Copy link

@taltas taltas commented Dec 26, 2025

Related GitHub Issue

Closes: #9053

Description

Allow users to specify a custom OpenRouter API URL when selecting OpenRouter as the embedder provider in Code Index settings.

I attempted to follow the way oLlama did it's baseUrl config within the code indexing popover. My current PR shares the same baseUrlsetting (codebaseIndexEmbedderBaseUrl) as oLlama, so they both share the same state. The reason why I did it this way, was the way the setting was named codebaseIndexEmbedderBaseUrl, it gave me the impression that this should be shared state, or at least that was initial intention. I'm not sure if this is desired, but I'm betting most users aren't really switching between providers for code indexing like they might be for prompting. Willing to hear people out if they feel differently. You can see a demo of this below.

Screen.Recording.2025-12-25.at.7.10.12.pm.mov

High level code changes:

  • Adds UI with standard text input within CodeIndexPopover
  • Modifies interface accordingly
  • Adds UI locales for english (other languages to come)
  • Updates the config-manager with boiler plate
  • Update openrouter embedder code to use baseURL if available, otherwise use default.

TODO:

  • Add tests
  • Update locales for various languagees

Test Procedure

Tests TBD

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.

Screenshots / Videos

Before:
Screenshot 2025-12-25 at 7 07 41 pm

After:
Screenshot 2025-12-25 at 6 52 43 pm

Documentation Updates

  • Yes, documentation updates are required. See the section below describing which providers can have base urls:
Screenshot 2025-12-25 at 7 16 29 pm

Get in Touch

Discord: taltas1

- Adds UI with standard text input within CodeIndexPopover
- Modifies interface accordingly
- Adds UI locales for english (other languages to come)
- Updates the config-manager with boiler plate
- Update openrouter embedder code to use baseURL if available, otherwise use default.
@taltas taltas requested review from cte, jr and mrubens as code owners December 26, 2025 00:17
@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Dec 26, 2025
@taltas taltas marked this pull request as draft December 26, 2025 00:17
@dosubot dosubot bot added documentation Improvements or additions to documentation Enhancement New feature or request UI/UX UI/UX related or focused labels Dec 26, 2025
@roomote
Copy link
Contributor

roomote bot commented Dec 26, 2025

Rooviewer Clock   See task on Roo Cloud

Review complete. The constructor parameter order was fixed, but service-factory.ts still needs to pass openRouterBaseUrl as the 5th argument for the custom base URL feature to work.

  • service-factory.ts missing openRouterBaseUrl argument: The constructor now expects openRouterBaseUrl as the 5th parameter, but service-factory.ts only passes 4 arguments. Add config.openRouterOptions.openRouterBaseUrl as the 5th argument.
Previous reviews

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

</>
)}

{currentSettings.codebaseIndexEmbedderProvider === "openrouter" && (
Copy link
Contributor

Choose a reason for hiding this comment

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

The new UI block for OpenRouter base URL reuses the codebaseIndexEmbedderBaseUrl state, which is also used by Ollama. Ensure that sharing this field between providers is intentional to prevent accidental overwrites when switching providers.

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Dec 26, 2025
@taltas taltas marked this pull request as ready for review December 26, 2025 13:23
@roomote
Copy link
Contributor

roomote bot commented Dec 26, 2025

Rooviewer Clock   See task on Roo Cloud

Review complete. Found 1 issue that needs to be addressed before merging.

  • Constructor parameter order breaks service-factory.ts: The openRouterBaseUrl parameter was inserted before specificProvider in the constructor, but service-factory.ts was not updated to match. This means the custom base URL will never be used, and specificProvider will be misinterpreted as a URL.

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

@taltas taltas marked this pull request as draft December 26, 2025 13:24
Co-authored-by: roomote[bot] <219738659+roomote[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation 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. UI/UX UI/UX related or focused

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

[ENHANCEMENT] OpenRouter CustomURL in Embeddings

2 participants