youngkermit8-coder opened a new issue, #1929:
URL: https://github.com/apache/rocketmq-dashboard/issues/1929

   ## Description
   When RMQ_LLM_TOKEN is configured and the request omits apiKey, 
LlmConfigService.testConfig should probe the provider with the environment 
token because that token is authoritative at runtime. If the database still 
contains an older key, normalizeWithStoredApiKey currently keeps the stored 
value instead.
   
   ## Reproduction
   1. Persist a general-settings API key such as sk-test.
   2. Configure RMQ_LLM_TOKEN as env-token.
   3. Call testConfig with no request apiKey.
   4. Capture the LlmConfigVO passed to OpenAiCompatibleLlmClient.listModels.
   
   On rocketmq-studio commit 103555a, the captured key is sk-test instead of 
env-token. A focused regression test fails with: expected env-token but was 
sk-test.
   
   ## Root cause
   normalizeWithStoredApiKey only uses the environment token as a fallback for 
a blank stored key. This contradicts getConfig, where the environment token 
always overrides the persisted key, and can make the settings connection test 
report failure against a credential that is not used at runtime.
   
   ## Expected behavior
   When an environment token is present and the request does not explicitly 
provide a key, provider validation should use the environment token while 
continuing to preserve the database key during saves.
   
   ## Validation target
   Add a regression test covering an environment token plus a different stored 
key, and run LlmConfigServiceTest and Checkstyle.


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