{"record":{"id":"8f60ea45477d1401","repo":"abhigyanpatwari/GitNexus","slug":"cannot-sync-embeddings-this-index-stores-float-meta","errorCode":null,"errorMessage":"Cannot sync embeddings: this index stores FLOAT[${meta.embeddingDims}] vectors, but this run embeds at ${EMBEDDING_DIMS} dimensions. Run `gitnexus analyze --embeddings --force` to rebuild the column at the new width.","messagePattern":"Cannot sync embeddings: this index stores FLOAT\\[(.+?)\\] vectors, but this run embeds at (.+?) dimensions\\. Run `gitnexus analyze --embeddings --force` to rebuild the column at the new width\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"gitnexus/src/cli/embeddings-sync.ts","lineNumber":118,"sourceCode":"            `resolves ${identity.model} (${identity.provider}) at ${identity.dimensions}. ` +\n            'Run `gitnexus analyze --embeddings --force` to rebuild under the new identity.',\n        );\n      }\n      cliInfo(decision.log);\n      if (decision.action === 'resume') {\n        forceReembedNodeIds = decision.pendingNodeIds;\n        resumedFrom = decision.resumedFrom;\n      }\n    }\n\n    // The vector column is FLOAT[N] fixed when the index was built, and the\n    // pipeline deletes each batch's stale rows immediately before inserting the\n    // replacements — so a width change here deletes rows it cannot re-insert.\n    // `analyze` forces a full rebuild on the same mismatch; only a rebuild can\n    // retype the column, so this writer refuses instead. An absent recorded\n    // width is not a mismatch (see `embeddingDimsMismatch`).\n    if (embeddingDimsMismatch(meta.embeddingDims, EMBEDDING_DIMS)) {\n      throw new Error(\n        `Cannot sync embeddings: this index stores FLOAT[${meta.embeddingDims}] vectors, ` +\n          `but this run embeds at ${EMBEDDING_DIMS} dimensions. ` +\n          'Run `gitnexus analyze --embeddings --force` to rebuild the column at the new width.',\n      );\n    }\n\n    if (!isHttpMode()) {\n      const assessment = assessLocalEmbeddingRuntime();\n      if (assessment.status === 'blocked' || assessment.status === 'prefix-unloadable') {\n        throw new Error(assessment.message);\n      }\n      if (assessment.status === 'needs-install') {\n        cliInfo(`Local embedding runtime is not installed.`);\n        cliInfo(`Downloading it now from your npm registry into ${getEmbeddingRuntimeDir()} …`);\n        try {\n          await installEmbeddingRuntime(\n            {},\n            getEmbeddingInstallTimeoutMs(ANALYZE_EMBEDDING_INSTALL_TIMEOUT_MS),","sourceCodeStart":100,"sourceCodeEnd":136,"githubUrl":"https://github.com/abhigyanpatwari/GitNexus/blob/ac9a4e9abd8fd3058c070b72c23402a4f887929a/gitnexus/src/cli/embeddings-sync.ts#L100-L136","documentation":"The index's vector column was created at meta.embeddingDims but this run embeds at EMBEDDING_DIMS. Only a full rebuild can retype the column (a width change would delete rows it cannot re-insert), so the sync writer refuses rather than corrupt the table. An absent recorded width is not treated as a mismatch.","triggerScenarios":"Changing the embedding dimension setting after the LadybugDB column was created at the old width, then running embeddings sync — e.g. switching models with different output dimensions without forcing a rebuild.","commonSituations":"Model upgrades (e.g. 1536 → 3072 dims), switching to a smaller local model, or a teammate with different dimension env vars syncing into a shared index.","solutions":["Run `gitnexus analyze --embeddings --force` to rebuild the vector column at the new width.","Or revert the dimension/model configuration so EMBEDDING_DIMS matches meta.embeddingDims, then sync.","Pin the embedding model and dimensions in shared config/env so all runs agree.","Use a separate storage path for experiments with different dimensions."],"exampleFix":"// before\nEMBEDDING_DIMS=3072  # column built at 1536\n$ gitnexus embeddings-sync .   # width mismatch\n// after\n$ EMBEDDING_DIMS=3072 gitnexus analyze --embeddings --force","handlingStrategy":"validation","validationCode":"// Compare configured dims against the recorded column width before syncing:\nconst meta = loadIndexMeta(repo);\nconst dims = Number(process.env.EMBEDDING_DIMS);\nif (meta && typeof meta.embeddingDims === 'number' && meta.embeddingDims !== dims) {\n  await run('gitnexus analyze --embeddings --force'); // rebuild retypes the column\n}","typeGuard":null,"tryCatchPattern":"try {\n  await gitnexus.embeddingsSync(repo);\n} catch (err) {\n  if (err.message.includes('FLOAT[') && err.message.includes('dimensions')) {\n    await run('gitnexus analyze --embeddings --force');\n    await gitnexus.embeddingsSync(repo);\n  } else throw err;\n}","preventionTips":["Freeze the embedding dimension setting for the life of an index; change it only with a forced rebuild.","Keep model and dimensions configured together and version-controlled.","Document dimension changes as schema migrations requiring `analyze --embeddings --force`.","Validate the model's output dimension against your config before first index creation."],"tags":["embeddings","dimensions","schema","vector-column"],"backgroundTag":"tensor-shape-mismatch","analyzedSha":"ac9a4e9abd8fd3058c070b72c23402a4f887929a","analyzedAt":"2026-09-15T23:29:44.066Z","contentChangedAt":"2026-09-15T23:29:44.066Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}