mirror of
https://github.com/garrytan/gbrain.git
synced 2026-07-28 14:59:47 +00:00
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>