[codex] Add index-versioned query cache#35
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 42bc919878
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| for attr in ("model_name", "model_id", "model", "_model_name"): | ||
| value = getattr(self.backend, attr, None) | ||
| if isinstance(value, str) and value: | ||
| return value | ||
| return type(self.backend).__name__ |
There was a problem hiding this comment.
Derive cache model ID from active embedder model
_cache_model_id() only inspects model_name/model_id/model/_model_name, then falls back to the backend class name, but the shipped backends track the active embedding model in fields like EMBEDDER_MODEL (and MLX can change it at runtime via set_model_ids). In that case the cache key does not change when the embedder model changes, so repeated queries can reuse vectors generated by the previous model, producing retrieval in the wrong embedding space after a model switch.
Useful? React with 👍 / 👎.
Summary
Validation