Repository navigation
Description
Summary
In Settings › Data residency › Embedding model, an admin moves a saved embedding model to another provider, and the Save button behaves backwards:
- After the provider change, Save is on, although the model and the vector width are now empty. Clicking it only shows the toast "Fix the highlighted fields and try again."
- After a model is picked from the new provider's list, Save turns off and Discard stays on. Nothing on the page says why. The blocker is the empty vector width: its error is not shown, and the field's placeholder
1536reads like a value. - Typing the width turns Save back on.
Most embedding models in the gateway catalogs state no width. In a local listing, OpenRouter states a width for 1 of 42 and Vercel AI Gateway for 0 of 28. So this is the usual outcome when the provider changes.
The report
When changing the data residency settings from one embedding model to another the save button does not recognize the dirty state once the model is selected
What happens (main at 49ce42fdd, local run on 2026-10-31)
Setup:
- Two OpenAI-compatible gateways defined by the organization, "Gateway A" (
embed-a) and "Gateway B" (embed-b). - Each one's
/v1/modelslists two embedding models with no width:emb-alphaandemb-beta. - Saved configuration:
embed-a,emb-alpha, 1536. - The page was reloaded before the steps; each "Discard" returns to the saved state.
| Step | Save | Discard | Model | Vector width | Shown on the page |
|---|---|---|---|---|---|
Pick emb-beta from the same provider |
on | on | emb-beta |
1536 (kept) | nothing |
Discard, then pick provider embed-b |
on | on | "Choose a model" | empty | nothing |
| Click Save at that point | stays on | on | "Choose a model" | empty | toast "Fix the highlighted fields and try again."; "Enter the model tag." under Model; "Enter a supported vector width: 256, …, 4096." under Vector width |
Discard, then pick embed-b, then emb-beta |
off | on | emb-beta |
empty, placeholder 1536 |
nothing |
| Focus the width field and leave it | off | on | emb-beta |
empty | "Enter a supported vector width: 256, …, 4096." |
Type 1536 |
on | on | emb-beta |
1536 | nothing |
A component test against the same code gave the same states. It used catalogs of shipped origin, one entry with a stated width and one without:
- Save on with empty fields after the provider change.
- Save off after a pick without a width.
- Save on after a pick with a width.
"Other model…" is not affected. The tag field it opens re-runs the check when it mounts, so Save goes off while the tag is empty, as intended.
Why (main at 49ce42fdd)
Line numbers without a path refer to services/platform/app/features/settings/data-residency/components/org-embedding-section.tsx.
- Provider change (
:933-951).field.onChange(v)makes react-hook-form 7.72.1 run the schema on the form as it is at that moment. The old model and width are still in place, so it storesisValid: true.- The four
setValuecalls that then clear the credential, model, model source and width (:938-950) passshouldDirtyonly. AsetValuewithoutshouldValidatenever runs the schema again. - Save reads that stored value (
packages/ui/src/components/editor/use-form-editor.ts:230), so it is on while the model and width are empty. - A failed submit does not update
isValideither, so Save stays on after the toast.
- Model pick (
onPickModel,:616-642).setValue('model', …, { shouldValidate: true })(:627) runstrigger('model'). That recomputesisValidover the whole form, but writes only themodelfield's error.- The width is filled only when the catalog entry states one (
:631-639). Otherwise it stays empty and the schema's width rule fails (:451-460). Save turns off, and the width error is not written. - With the shared
useFormdefault modeonTouched(packages/ui/src/components/forms/use-form.ts:33), that error appears only after the field is focused and left.
- No reason on Save.
- The header's Save shows an
invalidReasonwhen the controller supplies one (packages/ui/src/components/editor/editor-actions.tsx:183-190). The contract (packages/ui/src/components/editor/types.ts:20-25) says this is so the reader learns what blocks the save "instead of meeting a dead button". - Neither
useFormEditornor the group composer (packages/ui/src/components/editor/compose-editors.ts:46-54) supplies one. Only the automation editor does (services/platform/app/features/automations/components/automation-editor.tsx:2081-2101).
- The header's Save shows an
- What the Model row says.
- For a pick from a list, the hint is "Embedding models this provider's listing carries; …" or "Embedding models the provider's catalog lists." (
:650-662). - The hint saying Tale knows no width for the provider and asking for it,
modelUncuratedHint, appears only when the Model row is a typed tag (:652-656). - The width input's placeholder is
1536(:1053).
- For a pick from a list, the hint is "Embedding models this provider's listing carries; …" or "Embedding models the provider's catalog lists." (
- Since when.
- Until ba3f848 (2026-10-09, feat(platform): store knowledge vectors in a table per width #4445, first released in v0.5.79), a provider change cleared the model only. That commit added
setValue('dimensions', '', …)(:950) and changed the test's expected width from 1536 to empty. - The test kept its old name, "clears the model pick when the provider changes and keeps the width" (
services/platform/app/features/settings/data-residency/components/data-residency-settings.test.tsx:1630; assertion at:1687-1689). - Before that commit, a pick without a width kept the previous width. That is read from the code; no older build was run.
- Until ba3f848 (2026-10-09, feat(platform): store knowledge vectors in a table per width #4445, first released in v0.5.79), a provider change cleared the model only. That commit added
Who meets it
Embedding-tagged entries in the catalog listing of the local stack (GET /api/app/providers/catalogs, 2026-10-31):
| Provider (catalog source) | Embedding models listed | With a stated width |
|---|---|---|
OpenRouter (openrouter-api) |
42 | 1 (qwen/qwen3-embedding-8b, 1536) |
Vercel AI Gateway (models-endpoint) |
28 | 0 |
OpenAI (static) |
1 | 1 |
Z.ai (static) |
1 | 1 |
The two local gateways (models-endpoint) |
2 each | 0 |
OpenRouter's embeddings listing publishes no width (services/platform/backend/core/lib/providers/catalog_fetch.ts:60-65). Widths come only from the shipped files (:425-451 there), and OpenRouter's file states one (configs/platform/system/models/openrouter/models.yml:381-399). So after moving to a gateway, picking almost any model leaves Save off.
Tests
data-residency-settings.test.tsx:1630-1690and:1692-1725check the field values after a provider change and after a pick without a width. Neither checks Save (isValid).- No test changes the provider of a saved configuration.
Constraints a change must respect
- The width is stated, never guessed. The field's hint says so, and a pick that states no width leaves the admin's own figure alone (
:628-639). - Refusals keep Save off. That covers a provider that cannot embed and one whose declarations or shipped catalog could not be read (
:131-177,:428-443). - An empty section stays valid. An untouched, empty section is valid while nothing is configured (
:396-420). - Decision: switching the embedding model to another model of the same width keeps the vectors the old model made #4935. A width kept across a provider change can mix vectors from two models of the same width. The decision there bears on whether the width should survive a provider change.
Options (no preference stated)
- Run validation again after the provider handler's clears, for example one
trigger()at the end orshouldValidateon the clears. Save would then be off right after a provider change. - Validate the whole form on a model pick (
trigger()without a field name). The width error would then appear beside the empty field when Save turns off. - Let
useFormEditorand the group composer supply aninvalidReason, so the header's Save says what blocks it. Every grouped settings page would get this. - Have
useFormEditorrecomputeisValidon every value change, or use modeonChangeorallfor this form. AsetValuewithoutshouldValidatecould then no longer leave Save stale. Other editors use the same pattern (see "Not examined"). - Keep the width across a provider change, as the test's name says, with Decision: switching the embedding model to another model of the same width keeps the vectors the old model made #4935 in mind. Or, when a pick states no width, show the "Tale knows no vector width" hint and drop the
1536placeholder.
Questions
- Should a provider change keep the previous width, or is clearing it, as ba3f848 does, the intended behavior?
- Should every grouped settings page say why Save is off, or only this section?
Not examined
- Other editors with the same pattern. These call
setValuewithshouldDirtyand withoutshouldValidate; whether those fields change validity was not checked. All are underservices/platform/app/features/:settings/sandboxes/workspace-cleanup-editor.tsxsettings/enterprise-sso/components/enterprise-sso-form.tsxsettings/governance/components/chat-tools-policy-editor.tsxsettings/governance/components/vision-model-editor.tsxsettings/governance/components/skill-sharing-policy-editor.tsxsettings/data-residency/components/org-storage-section.tsxprojects/components/project-task-reviewer-section.tsxprojects/components/project-overview.tsx
- A shipped gateway in the browser. OpenRouter and Vercel AI Gateway were not driven there; only the component test covered catalogs of shipped origin.
- Builds before v0.5.79.
Related
- Decision: switching the embedding model to another model of the same width keeps the vectors the old model made #4935: a switch to another model of the same width keeps the old vectors.
- Improvement: show which provider serves a model wherever one is picked or reported #5179: the Provider select here shows the slug (
embed-b), not the display name. - Epic: pilot findings, October 2026 — files and images in chat, skills, web reading, permissions #5044: pilot findings.
Activity
tale-code-bot commentedon Nov 1, 2026
Parts split off this issue, from task TALE-342:
fix(ui): a form editor's Save goes stale when code sets a field, or when a save fails.feat(ui): say why a form editor's Save is off. This is option 3 here.The two questions, as TALE-342 settles them:
The fix for this section:
fix/embedding-save-validity, head b7bfb50.1536placeholder.main.fix(platform): keep embedding Save in step with provider and model picks
fix(platform): keep embedding Save in step with provider and model picks
tale-code-bot commentedon Nov 1, 2026
Reopened: GitHub closed this issue by mistake. The body of merge train pull request #5262 named it with a closing keyword where it listed commits that wait for the next train, so GitHub closed it when #5262 merged into
mainat 16:00 UTC. #5262 did not carry the change.The change that closes this issue is commit e8b6e52 (
fix(platform): keep embedding Save in step with provider and model picks, task TALE-342). It sits on the stable merge traintrain: it is not inmainand not in v0.5.95. It reachesmainwith the next stable merge train, which departs at about 23:54 UTC today, and the merge of that train closes this issue.docs: write the v0.5.96 release notes
docs: write the v0.5.96 release notes