fix(desktop): handle custom model ids with multiple colons#2387
fix(desktop): handle custom model ids with multiple colons#2387dwoodwardgb wants to merge 1 commit intopingdotgg:mainfrom
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ 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 |
ApprovabilityVerdict: Approved Straightforward bug fix that corrects parsing of model IDs containing multiple colons (e.g., AWS Bedrock ARNs) by splitting only on the first colon. Limited scope, clear intent, and low risk. You can customize Macroscope's approvability policy. Learn more. |
What Changed
Only split custom model name on first colon, not subsequent ones.
Why
Some AWS bedrock model arns have multiple
:characters (i.e.us.anthropic.claude-haiku-4-5-20251001-v1:0), which causes the split to throw away the third part which causes the model to be unselectable in the UI.UI Changes
Checklist
Note
Low Risk
Low risk UI bugfix that only changes how
provider:modelkeys are parsed during model selection; behavior should be identical for normal slugs but could misbehave if a model key ever lacks a colon.Overview
Fixes model selection in the chat model picker for providers whose model IDs contain additional
:characters (e.g. Bedrock ARN-style IDs).Introduces
parseModelKey()that splits the compositeprovider:modelSlugkey on the first colon only, and uses it for keyboard jump selection, combobox value changes, and Enter-to-select on the highlighted item.Reviewed by Cursor Bugbot for commit 4e892a2. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Fix model selection in
ModelPickerContentto handle model IDs containing colonsModel slugs that contain colons (e.g. custom model IDs) were being split incorrectly, causing the provider and slug to be parsed wrong. A new
parseModelKeyhelper splits only on the first colon, preserving the rest of the slug intact. This fix applies to all three selection paths: jump selection, combobox selection, and enter-to-select from search.Macroscope summarized 4e892a2.