🐛Bugfix: model list provider mismatch, delete dialog errors, and password strength reset#3485
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
PR Description
Summary
Three independent bug fixes:
Fix incorrect model list when switching provider during batch add — The three model-list hooks (
useDashscopeModelList,useSiliconModelList,useTokenponyModelList) trigger their auto-fetch effect without checkingform.provider, so switching providers lets the previous provider's stale request overwrite the new provider's model list. Fix: each hook now checks thatform.providermatches before fetching.Fix model deletion dialog showing garbage rows when API key is invalid — When a provider request fails, the backend didn't pass
status_code, and the frontend rendered the error object as if it were model data, producing "ghost rows" in the delete dialog. Fix: the backend now attachesstatus_codeon caught exceptions, and the frontend usesprocessProviderResponseto detect errors and clear the polluted state instead of rendering it.Fix password strength indicator not resetting on re-entering register page —
resetFormnever cleared the localpasswordValuestate, so the strength indicator kept showing the previously entered password's strength. Fix: addedsetPasswordValue("")to the reset logic.Changes
frontend/hooks/model/{useDashscopeModelList,useSiliconModelList,useTokenponyModelList}.ts— validateform.providerbefore auto-fetchingbackend/services/providers/{dashscope,silicon,tokenpony}_provider.py— attachstatus_codeon caught exceptionsfrontend/app/[locale]/models/components/model/ModelDeleteDialog.tsx— useprocessProviderResponseto detect errors and clear statefrontend/components/auth/registerModal.tsx— clearpasswordValueon reset