Skip to content

feat(platform): refuse an embedding provider that cannot embed - #3527

Merged
yannickmonney merged 1 commit into
mainfrom
feat/embedding-form-cannot-embed
Sep 27, 2026
Merged

yannickmonney merged 1 commit into
mainfrom
feat/embedding-form-cannot-embed

Conversation

@yannickmonney

@yannickmonney yannickmonney commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

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 declared unsupported, and Z.ai shipped a curated embedding-3 width while declaring unknown.

Change.

  • Declarations, with evidence. Anthropic now declares embedding: unsupported. The line above it in provider.yml cites 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 declares supported, since its catalog ships the curated width. A new guard in load_system_config.test.ts checks two rules: supported goes exactly with a curated catalog width, and every shipped unsupported carries an https:// 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/recommendations now answers {recommendations, providers: [{providerSlug, support}]} for every provider the org resolves, shipped or its own. A recommendation from a provider that does not declare supported is never offered. The recommendations field keeps its old shape; providers is new. ProviderEmbeddingSupport is exported from @tale/shared/schemas/providers.

  • Form (org-embedding-section.tsx). Two separate states, in en/de/fr:

    • Cannot embed (modelUnsupported / modelUnsupportedHint) applies when the declaration says unsupported. It wins even if the listing carries an embedding-tagged entry. The row shows no field, and the shared Save stays off.
    • No curated width (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 none refusal and the old modelUnlistedHint. 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 the embedding row in "What a connector declares".

  • Manual layer. DATA-F2b and DATA-F2c are 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 in reference/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 an unsupported declaration that cites that vendor's docs. The guard enforces the citation.

Refs #2991 (this PR does both remaining halves: the refusal for unsupported and the two separate empty states).

Checklist

  • bun run check passes: 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.
  • Translations: services/platform/messages/{en,de,fr}.yml (3 keys removed, 3 added); no de-CH override applies.
  • Docs: 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.tsx against the old org-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.ts with the old provider.yml files: the new guard fails (expected [ 'anthropic' ] to deeply equal []).
  • admin.test.ts: two new cases on the real shipped connector tree. Anthropic is unsupported and never recommended, DeepSeek is unknown, and OpenAI is supported with its pick. Every provider is reported even when the org has no direct key.
  • embedding_recommendations.test.ts: the restored providerEmbeddingOptions cases.

Ran locally, all green:

  • platform test:ui on app/features/settings/data-residency, providers/hooks/provider-reads.test.tsx and app/lib/backend (47 + 144 tests)
  • platform server project on backend/domains/knowledge, lib/shared/providers, load_system_config.test.ts and lib/i18n (442)
  • tsc --noEmit for @tale/platform and @tale/shared
  • oxlint --type-aware on the changed files
  • services/docs tests (105, including section anchors)
  • bun run lint:manual, plus check-guide.ts on data-residency.md

Not run: backend/integration-check.ts gains an assertion that the recommendations read lists anthropic: unsupported over the real wire. It needs a disposable Postgres, and CI does not run backend:integration.

Manual: DATA-F12, plus the updated DATA-F2b and DATA-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.

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.
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.

1 participant