Skip to content

fix(open-router): load embedding models from the dedicated catalog - #763

Merged
haiphucnguyen merged 2 commits into
mainfrom
feature/fix-displaying-open-router-embedding-models
Oct 12, 2026
Merged

haiphucnguyen merged 2 commits into
mainfrom
feature/fix-displaying-open-router-embedding-models

Conversation

@haiphucnguyen

Copy link
Copy Markdown
Collaborator

Summary

Related Issue(s)

Type of Change

  • 🐛 Bug fix
  • ✨ New feature
  • 💥 Breaking change
  • 📝 Documentation
  • ♻️ Refactor (no functional change)
  • 🧪 Tests
  • 🔧 Chore / tooling / CI

What Changed & Why

  • Fetch OpenRouter embedding models from its embeddings endpoint.
  • Use embedding-specific discovery in the model picker.
  • Preserve filtered model listings as the fallback for other providers.

How to Test

./gradlew test

Screenshots / Recordings (if applicable)

Checklist

  • I have read the CONTRIBUTING guide
  • My branch is up to date with main
  • I ran ./gradlew spotlessApply and ./gradlew detekt locally
  • I ran ./gradlew test and all tests pass
  • I added/updated tests for my changes (if applicable)
  • I added/updated documentation (if applicable)
  • My commits are signed off (DCO) — git commit -s
  • This PR is focused on a single feature/fix

Additional Notes

- Fetch OpenRouter embedding models from its embeddings endpoint.
- Use embedding-specific discovery in the model picker.
- Preserve filtered model listings as the fallback for other providers.

BREAKING CHANGE: Extend ChatModelFactory with availableEmbeddingModels and OpenAiCompatibleTemplate with embeddingModelFetcher. Existing providers retain default filtering; no migration is required.
Copilot AI balanced review requested due to automatic review settings October 12, 2026 22:45

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Dedicated embedding results need embedding categorization to prevent valid models from being hidden by subsequent keyword filtering.

1 open finding
What changed in this PR

Adds dedicated OpenRouter embedding-model discovery while retaining existing fallback filtering.

Changes:

  • Adds provider-specific embedding model fetchers.
  • Queries OpenRouter’s embedding catalog.
  • Uses embedding-specific discovery in the desktop picker.
File Description
OpenAiCompatibleTemplate.kt Configures OpenRouter’s embedding endpoint.
OpenAiCompatibleModelFactory.kt Executes template-specific embedding discovery.
ChatModelFactory.kt Adds the embedding-model discovery API.
AIProviderSettingsSection.kt Uses embedding-specific discovery in the picker.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The core endpoint integration and fallback behavior lack automated coverage.

0 open findings

1 resolved since last review
Previously missed (1)

In code that hasn't changed since last review

Medium severity Add test coverage for OpenRouter embedding model discovery

shared-jvm/​src/​main/​kotlin/​io/​askimo/​core/​providers/​openaicompatible/​OpenAiCompatibleTemplate.kt:155

The new OpenRouter discovery path is not covered by a test, so regressions in the derived /v1/embeddings/models URL, authorization header, response parsing, or factory dispatch would only be caught against the live service. Please add a mock-server test that calls availableEmbeddingModels for the OpenRouter template and verifies the requested path plus the sorted, deduplicated embedding DTOs; also cover that templates without this fetcher retain the fallback behavior.

🧠 Review effort: Balanced

@haiphucnguyen
haiphucnguyen merged commit b87dff7 into main Oct 12, 2026
12 of 13 checks passed
@haiphucnguyen
haiphucnguyen deleted the feature/fix-displaying-open-router-embedding-models branch October 12, 2026 22:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants