fix(skills): treat absent embedding_model payload field as model mismatch#3411
Merged
fix(skills): treat absent embedding_model payload field as model mismatch#3411
Conversation
…atch Legacy Qdrant points written before #3395 lack an `embedding_model` payload field. `model_has_changed` used `is_some_and`, which returns false for absent fields, so stale vectors from a previous model were never cleared and caused cosine scores of ~0.022 on every query. Change the match arm so `None` returns `true` when `config_model` is non-empty, forcing a collection rebuild when any point lacks the field. Also replace `effective_embedding_model` with `stable_skill_embedding_model` in `AgentSessionConfig::embed_model` so the runtime skill-sync uses the same collection version key as the startup sync, preventing oscillating rebuilds. Closes #3402
8dfb2d5 to
635b076
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
model_has_changedinzeph-memoryusedis_some_andwhich returnsfalsefor absentembedding_modelpayload fields. Legacy Qdrant points written before fix(skills): skip skill matcher in bare mode and stabilize embed model name #3395 have no such field, so stale vectors from a previous embedding model were permanently retained, producing cosine scores of ~0.022 on every query.AgentSessionConfig::embed_modelusedeffective_embedding_modelinstead ofstable_skill_embedding_model, causing the runtime skill-sync to use a different collection version key than startup sync and re-introducing the oscillating rebuild loop.Changes
crates/zeph-memory/src/embedding_registry.rs:Nonearm inmodel_has_changednow returnstruewhenconfig_modelis non-empty, forcing a clean rebuild when any point lacks theembedding_modelfield.crates/zeph-core/src/agent/session_config.rs: replacedeffective_embedding_modelwithstable_skill_embedding_modelforembed_model.Test plan
cargo nextest run --workspace --lib --bins)model_has_changed_absent_field_with_config_model_is_trueandmodel_has_changed_absent_field_with_empty_config_model_is_falseCloses #3402