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. I realised that this is infact not a good idea, and separated the settings.

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


Important

Adds support for configuring a custom OpenRouter Base URL for the OpenRouter embedder provider, with UI updates and tests.

  • Behavior:
    • Adds codebaseIndexOpenRouterEmbedderBaseUrl to codebase-index.ts for custom OpenRouter API URL configuration.
    • Updates ClineProvider.ts to handle codebaseIndexOpenRouterEmbedderBaseUrl in state management.
    • Modifies webview-ui/src/components/chat/CodeIndexPopover.tsx to include a text input for the OpenRouter Base URL.
  • Tests:
    • Adds tests in config-manager.spec.ts and orchestrator.spec.ts to validate OpenRouter Base URL handling and configuration changes.
    • Includes UI tests in CodeIndexPopover.auto-populate.spec.tsx for the new input field.
  • Localization:
    • Updates localization files in webview-ui/src/i18n/locales to include labels and placeholders for the OpenRouter Base URL in multiple languages.

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

- 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

All issues have been resolved. The PR is ready for merge.

  • service-factory.ts missing openRouterBaseUrl argument: Fixed - config.openRouterOptions.openRouterBaseUrl is now passed as the 5th argument to the OpenRouterEmbedder constructor.
  • Test structure issue in CodeIndexPopover.auto-populate.spec.tsx: Fixed - the describe block is now properly placed as a sibling at the top level.
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 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
taltas and others added 5 commits December 26, 2025 16:35
Co-authored-by: roomote[bot] <219738659+roomote[bot]@users.noreply.github.com>
… be seperate from Ollama.

- Mimic the way codebaseIndexOpenRouterSpecificProvider is done, but for the base url setting
…ved)

 - Remove unused variable from config manager
@taltas
Copy link
Author

taltas commented Dec 29, 2025

@roomote are you still seeing the following 2 issues

  • 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.
  • service-factory.ts missing openRouterBaseUrl argument: The constructor expects openRouterBaseUrl as the 5th parameter, but service-factory.ts only passes 4 arguments. Add config.openRouterOptions.openRouterBaseUrl as the 5th argument.

@roomote
Copy link
Contributor

roomote bot commented Dec 29, 2025

Fixaroo Clock   See task on Roo Cloud

Fixed the reported issue. Added config.openRouterOptions.openRouterBaseUrl as the 5th argument to the OpenRouterEmbedder constructor in service-factory.ts. All local checks passed.

View commit | Revert commit

@taltas taltas marked this pull request as ready for review December 29, 2025 09:54
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Dec 29, 2025
@roomote
Copy link
Contributor

roomote bot commented Dec 29, 2025

Rooviewer Clock   See task on Roo Cloud

Review complete. No issues found. The PR is ready for merge.

All previously flagged issues have been resolved:

  • Constructor parameter order: The openRouterBaseUrl parameter is correctly positioned as the 5th parameter in the OpenRouterEmbedder constructor, and service-factory.ts correctly passes all parameters in order.
  • Test structure: The orchestrator tests correctly expect testBaseUrl to be passed as the 5th argument.
  • Separate settings: The OpenRouter base URL uses its own setting (codebaseIndexOpenRouterEmbedderBaseUrl) separate from Ollama's base URL.

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

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:L This PR changes 100-499 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