You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TextCrossEncoder.add_custom_model checks duplicate names case-sensitively, while model selection and description lookup compare lowercase names. Registering a case-only variant is accepted but resolves to the earlier entry, silently selecting its original source. Case-only aliases of built-in names are affected as well.
Use the same lowercase comparison during registration and raise the existing duplicate-name ValueError. Document that model names must be unique regardless of case. Tests cover built-in and custom names, four case variants, registry preservation on rejection, and actual lazy construction of distinct custom models with case-variant names and the expected sources. This aligns with the existing TextEmbedding.add_custom_model behavior rather than changing model lookup semantics.
Validation
Before the production fix: 6 failed, 3 passed in the new regression module.
After the fix: 20 passed, 5 deselected, including existing common/custom-model unit tests, with sockets disabled. The five deselected tests download and run models.
mypy: no issues in 66 source files; pyright: zero errors/warnings with the isolated interpreter.
Ruff 0.3.4 lint and format checks, plus git diff --check: passed.
Full downloaded-model suite, GPU runs and the full CI matrix were not run locally. Focused offline regressions are the alternative validation.
All Submissions
Followed the Contributing guidelines.
Checked all open PRs and related closed PRs for the same change as of 2026-10-09.
New-feature and new-model checklist items are not applicable to this bug fix. No pre-commit hook was installed for this uncommitted preview; its configured Ruff checks were run directly.
AI assistance: the patch and tests were prepared with Codex and reviewed and approved for submission by the contributor.
No separate issue has been opened.
Additional offline public-API verification: register differently cased names with different sources, then construct TextCrossEncoder with lazy_load and a local model path. The baseline accepts the alias but selects the first source; the patch rejects the duplicate and still constructs the original model correctly. No ONNX inference was run.
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: bfd9b2a6-5c26-42fb-9036-65cd5edcab7f
📥 Commits
Reviewing files that changed from the base of the PR and between 2a859a5 and a8dfe94.
📒 Files selected for processing (1)
tests/test_custom_models.py
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
📝 Walkthrough
Walkthrough
TextCrossEncoder.add_custom_model now checks for duplicate model names without regard to letter case. Tests verify that a custom model registered as Org/Model can be retrieved as org/model, and that case variants of built-in and custom names raise ValueError.
No merge-blocking issue is identified; proceed with normal checks.
Pre-merge checks | 4 | 1
❌ Failed checks (1 warning)
Check name
Status
Explanation
Resolution
Docstring Coverage
Docstring coverage is 42.86% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 3 files.
Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name
Status
Explanation
Description check
The description clearly explains the case-insensitive duplicate-registration bug, the fix, affected behavior, tests, and validation results.
Title check
The title concisely and accurately identifies the main change: rejecting case-insensitive duplicate cross-encoder registrations.
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
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
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.
TextCrossEncoder.add_custom_model checks duplicate names case-sensitively, while model selection and description lookup compare lowercase names. Registering a case-only variant is accepted but resolves to the earlier entry, silently selecting its original source. Case-only aliases of built-in names are affected as well.
Use the same lowercase comparison during registration and raise the existing duplicate-name ValueError. Document that model names must be unique regardless of case. Tests cover built-in and custom names, four case variants, registry preservation on rejection, and actual lazy construction of distinct custom models with case-variant names and the expected sources. This aligns with the existing TextEmbedding.add_custom_model behavior rather than changing model lookup semantics.
Validation
All Submissions
New-feature and new-model checklist items are not applicable to this bug fix. No pre-commit hook was installed for this uncommitted preview; its configured Ruff checks were run directly.
AI assistance: the patch and tests were prepared with Codex and reviewed and approved for submission by the contributor.
No separate issue has been opened.
Additional offline public-API verification: register differently cased names with different sources, then construct TextCrossEncoder with lazy_load and a local model path. The baseline accepts the alias but selects the first source; the patch rejects the duplicate and still constructs the original model correctly. No ONNX inference was run.