Standardize file paths for custom model routers.#13078
Conversation
|
I'm starting a first review of this pull request. You can view the conversation on Warp. I completed the review and no human review was requested for this pull request. Comment Powered by Oz |
There was a problem hiding this comment.
Overview
This PR changes new custom model router saves to derive lowercased, sanitized YAML filenames from router names.
Concerns
- Distinct router names can now normalize to the same filename, and the save path still overwrites without checking for an existing file.
Verdict
Found: 0 critical, 1 important, 0 suggestions
Request changes
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
| let sanitized = name | ||
| .to_lowercase() | ||
| .replace(|c: char| !c.is_alphanumeric() && c != '-', "_"); | ||
| dir.join(format!("{sanitized}.yaml")) |
There was a problem hiding this comment.
Foo Bar and foo_bar both become foo_bar.yaml), and the later std::fs::write will silently overwrite the existing router file; reject or disambiguate existing paths before writing.
No description provided.