Repository navigation
fix(db): include local no-API-key providers in Qdrant embedding-model list - #11995
Merged
diegosouzapw merged 1 commit intoAug 29, 2026
Merged
Conversation
… list (#11949) The embedding-models route only treated a provider connection as "configured" when it had a real apiKey or authType "oauth". Local/self-hosted providers (ollama-local, lm-studio, vllm, etc.) connect through the connections route with authType "apikey" but no apiKey — the connect form never asks for one (src/shared/constants/providers/local.ts) — so an active local connection's embedding models (embeddinggemma, nomic-embed-text, bge-m3 for ollama-local) never surfaced in the dropdown even though the connection tested "Ativo". Reuse the existing canonical providerAllowsOptionalApiKey() helper (src/shared/constants/providers.ts) — already used for the identical requiresApiKey check in src/app/api/providers/[id]/test/route.ts and across the Zod validation schemas — instead of hardcoding a provider id list.
This was referenced Sep 7, 2026
Merged
muhamadgalihsaputra
pushed a commit
to niyatna/NiyatnaRoute
that referenced
this pull request
Sep 27, 2026
… list (cheaper-inference#11949) (cheaper-inference#11995) Local no-API-key providers (ollama-local, lm-studio, vllm, etc.) were invisible in the Qdrant embedding-model dropdown because configuredProviders required a real apiKey or OAuth. Extended the filter to also include providerAllowsOptionalApiKey(connection.provider) — the same canonical helper already used for the identical check elsewhere. TDD: 21/21 integration tests pass (was 20/21 before the fix).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
The Qdrant embedding-model dropdown (
GET /api/settings/qdrant/embedding-models) onlytreated a provider connection as "configured" when it had a non-empty
apiKeyorauthType === "oauth". Local/self-hosted providers —ollama-local,lm-studio,vllm, etc. (src/shared/constants/providers/local.ts) — connect throughsrc/app/api/providers/route.tswithauthType: "apikey"and noapiKey(theconnect form never asks for one), so an active, tested-and-"Ativo" local connection's
embedding models (
embeddinggemma,nomic-embed-text,bge-m3forollama-local,registered in
open-sse/config/embeddingRegistry.ts) never appeared in the dropdown.Reported from the WhatsApp support channel.
Root cause
configuredProvidersinsrc/app/api/settings/qdrant/embedding-models/route.tswasbuilt from
activeConnections.filter(...)requiring either a real key or OAuth, withno branch for providers that don't require a key at all.
Fix
Extended that filter to also include a connection when
providerAllowsOptionalApiKey(connection.provider)is true — the existing canonicalhelper in
src/shared/constants/providers.ts, already used for the identicalrequiresApiKeycheck insrc/app/api/providers/[id]/test/route.ts:930and acrossevery
src/shared/validation/schemas/*.tsZod schema. No new hardcoded provider-idlist was introduced; a remote provider that genuinely requires a key (e.g.
openaiwith no key on its connection) is still excluded, unchanged.
TDD evidence (Hard Rule #18)
Added two tests to
tests/integration/qdrant-routes.test.ts:GET /api/settings/qdrant/embedding-models — includes an active local no-API-key provider (#11949)— fails before the fix (
AssertionError: should list ollama-local embedding models for an active, key-less local connection, confirmed by running it against thepre-fix route.ts), passes after.
GET /api/settings/qdrant/embedding-models — still excludes a remote provider with no key— regression guard proving the fix does not just drop the filter for remote providers.
Full file:
node --import tsx/esm --test tests/integration/qdrant-routes.test.ts→21/21 passing after the fix (was 20/21, the new test failing, before it).
Gates run (green)
npm run typecheck:core— cleannpm run typecheck:noimplicit:core— cleannpx eslint --suppressions-location config/quality/eslint-suppressions.json <changed files>— 0 errors (2 newno-explicit-anysites introduced by the new tests were typed against a localEmbeddingModelOptionLikeinterface instead of widening the frozen suppression count)npm run check:complexity-ratchets— OK (2672/2774 cyclomatic, 1192/1223 cognitive — both under baseline)node scripts/check/check-file-size.mjs— OKnode scripts/check/check-test-discovery.mjs— OKScope: only the route, the canonical-helper import, the new/typed tests, and the
changelog fragment — no other files touched.
Closes #11949