Files
gbrain/src
cf2deedfc6 fix(embed): label content_chunks.model with the model that produced the vector (#1717)
The embed paths (embedPage, embedAll, embedAllStale) and the inline
import/sync embed paths built ChunkInput[] without a model field, so the
engines' upsertChunks defaulted content_chunks.model to the hardcoded
DEFAULT_EMBEDDING_MODEL instead of the gateway-configured model that
actually produced the vector.

- New core helper resolveEmbeddingModelLabel() in src/core/embedding.ts
  (returns the resolved gateway model, undefined when unconfigured).
- embed.ts: stamp the label on (re)embedded chunks in all three paths;
  chunks preserved from a prior embed keep their existing model so a
  mixed-model page isn't relabeled wholesale.
- import-file.ts: stamp the label on inline-embedded markdown chunks and
  re-embedded code chunks; reused (incremental) code-chunk embeddings
  carry their existing model label forward.

Takeover of PR #1803 (rebased onto master over the pace-mode changes;
helper moved into core so import-file.ts can share it).

Co-authored-by: harjothkhara <harjothkhara@users.noreply.github.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-21 14:42:17 -07:00
..