Repository navigation
Validate custom output names before model registration - #777
tuanzirwar wants to merge 1 commit into
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughCustomTextEmbedding.add_model now raises ValueError when output_name is a non-string value or an empty string. Tests verify that rejected values leave both registries unchanged, valid retries work, and None and non-empty strings are accepted and preserved. Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~5 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to Custom model registration rejects invalid output names without leaving a partial registration. No actionable merge risk remains after normal checks. Security Architecture ReviewSecurity architecture risk: ⚪ Minimal · up to Rejecting invalid values before registration prevents failed attempts from changing shared state. Valid values retain their existing behavior, and the change introduces no new access or privileges. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
Thanks for following up on this, and for #756! I'm going to close this one. Empty and non-string values already fail when the model loads, with |
Passing an empty string or a non-string
output_namecurrently registers a custom model without validating the value. The invalid entry remains in the registry, and retrying with the same model name is rejected as already registered.This follows up on the registration-validation request in the review of #756: #756 (review). The check is missing from the merged implementation and the current main branch.
Validate
output_nameinCustomTextEmbedding.add_modelbefore either registry is modified. AcceptNoneand non-empty strings, preserving the exact name without trimming whitespace.Regression tests cover four invalid values, unchanged existing registry entries, successful retry with the same name, and three accepted values. These tests do not download models.
Validation:
The five tests requiring model downloads were not run locally.