-
Notifications
You must be signed in to change notification settings - Fork 1k
fix: 模型下载完成后自动选择该模型 #956
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
fix: 模型下载完成后自动选择该模型 #956
Conversation
Previously, after downloading a model, the selection would revert to the first available model (usually tiny). Now it automatically selects the just-downloaded model. Fixes #939 Co-Authored-By: Claude Opus 4.5 <[email protected]>
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the final PR Bugbot will review for you during this billing cycle
Your free Bugbot reviews will reset on January 24
Details
Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
| for enum_val in available: | ||
| if enum_val.value == downloaded_model_value: | ||
| combo.setCurrentText(enum_val.value) | ||
| break |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrong field compared, downloaded model never auto-selected
High Severity
The comparison enum_val.value == downloaded_model_value will never match because model["value"] contains strings like "faster-whisper-large-v2" while FasterWhisperModelEnum values are "large-v2". The code uses model["value"] but it needs to use model["label"].lower() to get the matching format. As a result, the downloaded model is never auto-selected, defeating the entire purpose of this fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR aims to fix a bug where after downloading a model, the selection would incorrectly default to "tiny" instead of automatically selecting the newly downloaded model.
Changes:
- Modified the
_on_model_download_finishedcallback to automatically select the downloaded model instead of trying to restore the previous selection
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| for enum_val in available: | ||
| if enum_val.value == downloaded_model_value: |
Copilot
AI
Jan 11, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The downloaded model value will never match the enum values. The model["value"] contains values like "faster-whisper-tiny", "faster-whisper-large-v2", etc., but FasterWhisperModelEnum enum values are "tiny", "large-v2", etc. (without the "faster-whisper-" prefix). The comparison enum_val.value == downloaded_model_value will always be false, so the newly downloaded model will never be selected.
To fix this, you need to extract the model name by removing the "faster-whisper-" prefix from the downloaded model value before comparing, or use the existing model_map logic that's already defined at lines 562-564 to properly map between the two formats.
| for enum_val in available: | |
| if enum_val.value == downloaded_model_value: | |
| # 将下载的模型值规范化为枚举使用的形式(去掉前缀 "faster-whisper-") | |
| downloaded_model_name = downloaded_model_value | |
| prefix = "faster-whisper-" | |
| if downloaded_model_name.startswith(prefix): | |
| downloaded_model_name = downloaded_model_name[len(prefix) :] | |
| for enum_val in available: | |
| if enum_val.value == downloaded_model_name: |
Summary
修复 #939 中 @philpw99 提到的 bug:下载模型后设定会变成 tiny。
问题原因:下载完成后代码尝试恢复之前的选择,如果失败就默认选第一个(tiny)。
修复:下载完成后自动选择刚下载的模型。
Test plan
🤖 Generated with Claude Code
Note
Ensures the settings select the newly downloaded Faster Whisper model instead of reverting to a default.
model_card.comboBoxand sets the current selection to the downloaded model via itsvaluetinyselectionWritten by Cursor Bugbot for commit a79ac9c. This will update automatically on new commits. Configure here.