Copilot commented on code in PR #864:
URL: 
https://github.com/apache/rocketmq-dashboard/pull/864#discussion_r3704837693


##########
web/src/pages/studio/LlmSettings.tsx:
##########
@@ -387,31 +387,17 @@ const LlmSettingsPage: React.FC = () => {
   };
 
   const handleTestConnection = () => {
-    const requestProviderGeneration = providerInteractionGeneration.current;
     setTestLoading(true);
     setTestResult(null);
     form
       .validateFields()
       .then((values) => {
-        const testConfig = buildConfig(values, true);
+        const testConfig = buildConfig(values, enabled);
         testLlmConnection(testConfig)

Review Comment:
   `buildConfig` currently takes a parameter named `forceEnabled`, but it is 
now being used to *preserve* the current enabled state (`enabled`). This makes 
the API misleading and also introduces a potential dual-source-of-truth 
(validated `values` vs component `enabled` state) for what the payload’s 
`enabled` should be. Consider refactoring `buildConfig` to either (a) use 
`values.enabled` directly (no override), or (b) rename the parameter (e.g., 
`enabledOverride`) and make it optional so callers can explicitly override only 
when intended.



-- 
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]

Reply via email to