Skip to content

docs: exact remediation SQL for known issue #15 (embedding dimension mismatch) - #64

Merged
kartikmanimuthu merged 1 commit into
offloadmemory:mainfrom
fabicarvano:docs/known-issue-15-embedding-dim-fix-needed
Oct 19, 2026
Merged

kartikmanimuthu merged 1 commit into
offloadmemory:mainfrom
fabicarvano:docs/known-issue-15-embedding-dim-fix-needed

Conversation

@fabicarvano

Copy link
Copy Markdown
Contributor

The code-side guardrail for this already shipped (KNOWN_MODEL_DIMENSIONS lookup in embeddings.ts). What is still open is the actual database row for the affected tenant, which was never corrected because DB access was not available in the session that made the code fix.

That part cannot be fixed by a PR against this repo at all — it is deployment-specific data, not code. This PR just documents the exact SELECT/UPDATE needed directly in the known-issues entry, so whoever has DB access for the affected deployment can apply it without re-deriving the root cause from the writeup.

No re-embedding is required: since every insert at the wrong dimension failed outright, nothing was ever successfully written with it — this is a one-row config correction.

…edding dimension mismatch)

The code-side guardrail for this issue already shipped, but the actual
database row for the affected tenant was never corrected because DB
access was not available in the session that made the code fix. That
part cannot be fixed by a PR against this repo — it is deployment-
specific data — so this documents the exact SELECT/UPDATE needed, for
whoever has DB access to run directly from the known-issues entry
instead of re-deriving the root cause.
fabicarvano added a commit to fabicarvano/agentfork that referenced this pull request Oct 17, 2026

@kartikmanimuthu kartikmanimuthu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks @fabicarvano — this is the right shape for a problem that isn't really a code bug: documenting the exact SQL so whoever has database access can apply it without re-deriving the root cause from the writeup.

Agreed on the framing too: nothing was ever successfully written at the wrong dimension, so this is a one-row config correction rather than a re-embedding job. I verified the columns are Unsupported("vector(1024)") in all three places, so the premise holds.

Three small edits I'd like before merge, all in the documented SQL:

  • The UPDATE is broader than the SELECT justifies. The SELECT deliberately catches every provider whose dimension isn't 1024 — including ones that are correct for their own model (the OpenAI-compatible provider defaults to 3072). Forcing embeddingModel = 'amazon.titan-embed-text-v2:0' on each flagged row would silently rewrite a working provider's model, so it's worth saying "confirm the row is Titan before applying" explicitly.
  • Add a tenant filter (AND "tenantId" = '<tenant id>') to both statements — on a shared database this otherwise touches every tenant.
  • "embeddingDimensions" IS DISTINCT FROM 1024 is one null-safe predicate instead of IS NULL OR != 1024.

Approving — thanks for closing the loop on a data-level issue that a code PR can't fix.

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