Frun1na opened a new issue, #6826:
URL: https://github.com/apache/rocketmq-dashboard/issues/6826

   ### 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: a92c2314
   deployed as: reproduced by a unit test against that commit
   
   ### Runtime Environment
   
   OS: not applicable — the defect is in the AI page's runtime loading
   MySQL: not applicable — the defect is in the AI page's runtime loading
   browser (for UI issues): not required to observe it; the defect is in what 
the page renders after a failed load
   
   ### Connected RocketMQ Cluster
   
   not applicable — the failing request is `GET /api/llm/config`, which never 
reaches a cluster. Reproduced with a stubbed API in a unit test.
   
   ### Describe the Bug
   
   When the AI page cannot read the LLM runtime, the failure is a transient 
toast and nothing stays on the page: the composer's send button is dead and no 
surface explains why or offers a retry.
   
   `useLlmRuntime.load` catches the failure and only reports it through 
`onError` (`web/src/pages/ai/hooks/useLlmRuntime.ts:123-127`), which the page 
turns into `message.error(describeThrownMessage(error) || 
t('ai.runtimeLoadFailed'))` (`web/src/pages/ai/index.tsx:83`). `config` stays 
`null`, exactly as it was before the first response arrived — and every 
explanation the composer owns is behind `llmConfig`:
   
   - the "provider not ready" banner and its "go to settings" link render only 
for `!readOnlyRole && llmConfig && !llmReady` 
(`web/src/pages/ai/components/Composer.tsx:314`),
   - the provider status line and the not-ready tag both need `llmConfig` 
(`Composer.tsx:417` and `:427`),
   - and sending needs `llmReady`, which is false while `config` is null 
(`Composer.tsx:254`).
   
   So once `GET /api/llm/config` (or `/api/llm/models`) fails, an admin looking 
at `/ai` sees a disabled send button, no notice at all, and no way to retry — 
the page reads as "the provider was never configured", except that even that 
banner is missing.
   
   The same failure is reported properly on the two surfaces next to this one, 
which makes the AI page the remaining copy:
   
   - the settings tab keeps it on the page since #6550 — 
`AiAssistantTab.tsx:171-172` stores the failure and renders it instead of an 
empty form,
   - the home page gets the same treatment in #6082,
   - and on the AI page itself the *timeline* load failure already stays on the 
page with a retry (`index.tsx:189-205`). Only the runtime load is a toast.
   
   ### Steps to Reproduce
   
   Sign in as an admin, make `GET /api/llm/config` fail (a 500, a gateway 
hiccup or an offline console), then open `/ai`:
   
   1. The toast `Failed to load AI configuration` appears and disappears.
   2. The send button is disabled and Enter does nothing.
   3. No banner, no retry, no explanation remains.
   
   The unit test in the pull request does this with the API stubbed 
(`AiPage.test.tsx`: the page must render the failure and recover on Retry).
   
   ### What Did You Expect to See?
   
   The failure stays on the page next to the composer — an error alert carrying 
the server's message and a Retry button that reloads the runtime — the way the 
timeline load failure on this same page, the AI settings tab (#6550) and the 
home page (#6082) already behave.
   
   ### What Did You See Instead?
   
   A transient toast was the only trace of the failure. The page then showed a 
disabled send button with no explanation and no way to retry, and an operator 
cannot tell that state apart from a page whose provider is simply not 
configured.
   
   ### Additional Context
   
   A fix with a regression test follows in a pull request.
   
   ### 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]

Reply via email to