Copilot commented on code in PR #810:
URL:
https://github.com/apache/rocketmq-dashboard/pull/810#discussion_r3702131736
##########
web/src/pages/studio/LlmSettings.tsx:
##########
@@ -182,7 +160,11 @@ const LlmSettingsPage: React.FC = () => {
const config = await configPromise;
if (!ownsRequest()) return;
if (config) {
- const provider = config.provider || 'openai';
+ const providerDef = resolveProvider(config.provider);
+ const provider = providerDef.key;
+ const supportedConfig = config.provider === provider;
+ const apiBase = supportedConfig ? config.apiBase || '' :
providerDef.defaultBaseUrl;
+ const model = supportedConfig ? config.model || '' :
providerDef.defaultModel;
selectedProviderRef.current = provider;
setSelectedProvider(provider);
setEnabled(config.enabled || false);
Review Comment:
When loading a config with an unsupported provider, the UI normalizes
`provider`/`apiBase`/`model` to OpenAI defaults but still keeps `enabled` from
the saved config. This can show the toggle as enabled even though the backend
is still configured with an unsupported provider until the user saves, which is
misleading and can trigger failing model calls.
This issue also appears on line 233 of the same file.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]