Repository navigation
feat(platform): refuse an embedding provider that cannot embed - #3527
Merged
Merged
Conversation
The embedding form refused every shipped provider whose catalog listed
no embedding model, and let any other one through. It read "no curated
width here" as "cannot embed", so it refused Gemini and Qwen, which do
embed. The provider declaration that separates the two answers existed
but nothing read it.
Anthropic now declares embedding: unsupported, citing its own docs
("Anthropic does not offer its own embedding model"). Z.ai declares
supported, because its catalog ships a curated embedding-3 width. A guard
holds every shipped declaration to that evidence.
The recommendations read restores providerEmbeddingOptions and also
returns each provider's declared support. The form shows two states in
en/de/fr. "Cannot embed" leaves no field and keeps Save off. "No curated
width" opens the model tag and vector width fields, with a hint naming
the provider.
This was referenced Sep 28, 2026
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.
Summary
Problem. Settings › Data residency › Embedding model decided whether a provider could be chosen from its catalog alone. A shipped provider whose catalog listed no embedding model was refused, and every other provider was let through. That read "no curated width here" as "cannot embed". So the form refused Gemini and Qwen, which do embed. The connector declaration that separates the two answers (
embedding: supported | unsupported | unknown, #3219) was read by nothing. Its only consumer,providerEmbeddingOptions, was deleted as unused this morning (f1c5d42). Nothing declaredunsupported, and Z.ai shipped a curatedembedding-3width while declaringunknown.Change.
Declarations, with evidence. Anthropic now declares
embedding: unsupported. The line above it inprovider.ymlcites the vendor's docs: "Anthropic does not offer its own embedding model." (https://platform.claude.com/docs/en/build-with-claude/embeddings). Z.ai now declaressupported, since its catalog ships the curated width. A new guard inload_system_config.test.tschecks two rules:supportedgoes exactly with a curated catalog width, and every shippedunsupportedcarries anhttps://citation in the comment directly above it.Endpoint. I restored
providerEmbeddingOptions(lib/shared/providers/embedding_recommendations.ts) along with its tests.GET /api/app/knowledge/embedding/recommendationsnow answers{recommendations, providers: [{providerSlug, support}]}for every provider the org resolves, shipped or its own. A recommendation from a provider that does not declaresupportedis never offered. Therecommendationsfield keeps its old shape;providersis new.ProviderEmbeddingSupportis exported from@tale/shared/schemas/providers.Form (
org-embedding-section.tsx). Two separate states, in en/de/fr:modelUnsupported/modelUnsupportedHint) applies when the declaration saysunsupported. It wins even if the listing carries an embedding-tagged entry. The row shows no field, and the shared Save stays off.modelUncuratedHint) covers every other provider without catalog embedding models: shipped-but-empty (DeepSeek, Gemini, Qwen …), org-defined without an entry, and Azure. The row shows the tag field and the width field, and the hint names the provider.This replaces the catalog-inferred
nonerefusal and the oldmodelUnlistedHint. The pick states and the "catalog unavailable" refusal are unchanged.Docs.
self-hosted/configuration/data-residency.md(en/de/fr) now describes the two states.self-hosted/configuration/providers.md(en/de/fr) gains theembeddingrow in "What a connector declares".Manual layer.
DATA-F2bandDATA-F2care updated (a shipped provider without catalog models now takes a typed tag). There is a new box,DATA-F12("cannot embed" vs "no curated width", in all three locales), and a 🔶 row inreference/automation.md. The suite count in the readme is corrected to 23.Deliberate reversal, flagged for review. #3435 deliberately refused every shipped provider without a curated entry, "including the ones whose vendor does serve embeddings". This PR reverses that for providers not declared
unsupported, following the contract in the schema: "A connector must never be refused for want of evidence." DeepSeek, Moonshot, xAI, Nous and Vercel's gateway therefore now take a typed tag and width. If one of them truly cannot embed, the remedy is anunsupporteddeclaration that cites that vendor's docs. The guard enforces the citation.Refs #2991 (this PR does both remaining halves: the refusal for
unsupportedand the two separate empty states).Checklist
bun run checkpasses: I ran the scoped parts locally (see Test plan), and CI runs the whole gate.bun run lint:sast: the pre-commit opengrep pass ran on the staged TS; CI runs the full gate.services/platform/messages/{en,de,fr}.yml(3 keys removed, 3 added); node-CHoverride applies.docs/{en,de,fr}/self-hosted/configuration/{data-residency,providers}.md.README*: N/A. No env var, flag or command changed.Test plan
Tests that fail without the change:
data-residency-settings.test.tsxagainst the oldorg-embedding-section.tsx: 5 of 33 fail. They include the two new cases, "refuses a provider declared unable to embed, whatever its listing carries" and "asks for the model and its width by hand where no curated width ships".load_system_config.test.tswith the oldprovider.ymlfiles: the new guard fails (expected [ 'anthropic' ] to deeply equal []).admin.test.ts: two new cases on the real shipped connector tree. Anthropic isunsupportedand never recommended, DeepSeek isunknown, and OpenAI issupportedwith its pick. Every provider is reported even when the org has no direct key.embedding_recommendations.test.ts: the restoredproviderEmbeddingOptionscases.Ran locally, all green:
test:uionapp/features/settings/data-residency,providers/hooks/provider-reads.test.tsxandapp/lib/backend(47 + 144 tests)backend/domains/knowledge,lib/shared/providers,load_system_config.test.tsandlib/i18n(442)tsc --noEmitfor@tale/platformand@tale/sharedoxlint --type-awareon the changed filesservices/docstests (105, including section anchors)bun run lint:manual, pluscheck-guide.tsondata-residency.mdNot run:
backend/integration-check.tsgains an assertion that the recommendations read listsanthropic: unsupportedover the real wire. It needs a disposable Postgres, and CI does not runbackend:integration.Manual:
DATA-F12, plus the updatedDATA-F2bandDATA-F2c. I did not drive the form in a browser for this PR. The component tests render both states; the German and French rows are for the manual round.