fix: use current provider selection when regenerating chat message - #9402
Open
wcqqq1214 wants to merge 1 commit into
Open
fix: use current provider selection when regenerating chat message#9402wcqqq1214 wants to merge 1 commit into
wcqqq1214 wants to merge 1 commit into
Conversation
Basic retry sent an empty provider, so the backend fell back to the stale persisted provider. Fall back to the current UI selection, matching send behavior. Closes AstrBotDevs#9400
wcqqq1214
force-pushed
the
fix/chat-regenerate-provider-fallback
branch
from
July 26, 2026 10:45
2cd1e82 to
da12e3e
Compare
3 tasks
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.
Fixes #9400.
On the chat page, clicking the basic Retry button did not read the provider currently selected in the UI. It emitted a
retryevent with no selection, sohandleRegenerateMessagepassed empty strings asselected_provider/selected_model. The backend then fell back to the provider persisted for the session (provider_perf_chat_completion), which was the original failing/renamed provider — so switching to a valid provider and retrying still failed with未找到指定的提供商.Sending a new message already resolves the current selection via
getSelectedProviderSelection(); regenerate now does the same when no explicit selection is passed.Modifications / 改动点
dashboard/src/components/chat/Chat.vue: inhandleRegenerateMessage, fall back togetSelectedProviderSelection()(current UI selection) when no explicitselectionis provided. The "retry with a specific model" path (retryWithModel, which passes an explicit selection) is unchanged, and the fallback is evaluated lazily so its side effects don't run on that path.This is NOT a breaking change. / 这不是一个破坏性变更。
Screenshots or Test Results / 运行截图或测试结果
End-to-end verification with a real backend + WebUI in a headless browser, intercepting the actual
regeneraterequest body. Two chat providers were configured; the UI hadgood_providerselected.Before the fix (reverted temporarily to confirm reproduction):
After the fix:
vue-tsc --noEmitpasses.Checklist / 检查清单
Summary
Bug Fixes: