Frun1na opened a new issue, #6549: URL: https://github.com/apache/rocketmq-dashboard/issues/6549
### Before Creating the Bug Report - [x] I have searched the [open issues](https://github.com/apache/rocketmq-dashboard/issues) of this repository and believe that this is not a duplicate. - [x] This is a defect in RocketMQ Studio, not a usage question and not a defect in another Apache RocketMQ repository. - [x] I can reproduce this on the current `rocketmq-studio` branch, or I have stated the exact version I am running below. ### Studio Version branch: `rocketmq-studio` git commit id: `779b8c0e` deployed as: reproduced by a component test against that commit (the affected code is the web client) ### Runtime Environment OS: Ubuntu on WSL2 MySQL: not applicable — the defect is in the web client's settings tab browser: not applicable — reproduced in a jsdom unit test (vitest + Testing Library) ### Connected RocketMQ Cluster RocketMQ version: not applicable — reproduced with a stubbed LLM configuration API in a unit test access mode: not applicable deployment: not applicable ### Describe the Bug When the AI assistant configuration cannot be loaded, Settings → AI 助手 renders the configuration form anyway, with every field empty and the API key slot prompting for a key (`web/src/pages/settings/AiAssistantTab.tsx:159-176`): ```tsx Promise.all([getLlmConfig(), getLlmModels().catch(() => null)]) .then(([config, models]) => { ... applyConfig(config, ...); }) .catch(() => { if (!cancelled) message.error(t('llm.loadFailed')); }) ``` `applyConfig` never runs, so `apiKeyConfigured` stays false and the tab claims that no provider, model or API key is set up — the failure is only a toast, and there is no retry. The load endpoints are admin-only on the server (`AuthInterceptor.isAdminOnlyGetPath` includes `/api/llm/config` and `/api/llm/models`, answering 403 "Admin permission required"), so a reader opening the tab always sees that blank configuration, and the server's reason is discarded. The list components already handle this shape (`AlertRuleAssetList` renders an error notice with a retry above its table), and the home page's assistant load failure is handled the same way in #6082. ### Steps to Reproduce Reproduced by a component test rather than against a server: 1. Render the settings tab with `GET /api/llm/config` rejecting (a reader's 403). 2. The tab shows a toast and an empty configuration form; nothing states why the configuration is missing and there is no way to retry the load. ### What Did You Expect to See? The tab should say that the configuration could not be read (with the reason the request failed with) and offer a retry, instead of presenting an unreadable configuration as an empty one. ### What Did You See Instead? A blank configuration form that claims nothing is configured, plus a transient toast; the server's "Admin permission required" never reaches the operator. ### Additional Context - A fix with a regression test follows in a pull request. - The case is pinned by a unit test that fails without the fix: `Unable to find an element with the text: Admin permission required`. ### Are You Willing to Submit a Pull Request? - [x] Yes, I am willing to submit a pull request. -- 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]
