lizhimins opened a new pull request, #4855:
URL: https://github.com/apache/rocketmq-dashboard/pull/4855

   ## What this PR does
   
   Two related fixes for the AI conversation surface, plus test-suite 
stabilization.
   
   ### 1. `fix(ai): ungate platform proxy tools and make conversation streaming 
smooth`
   
   **MCP tool layer (server)**
   
   - `rmq.proxy.list` / `rmq.proxy.config` no longer require `PROXY_DISCOVERY` 
on the bound instance. Both are platform-level tools (no `instanceId` argument) 
whose handlers aggregate every manageable instance through the heartbeat-syncer 
group, so their data scope never depended on the bound instance — but the 
capability gate did. Since `PROXY_DISCOVERY` is only granted to 
`PROXY_LOCAL`/`PROXY_CLUSTER` instance types, deployments whose instances are 
direct-attached got a permanent `TOOL_CAPABILITY_UNSUPPORTED` even with proxies 
running. They now join `rmq.audit.list` / `rmq.alert.rule.list` as ungated 
deployment-wide tools.
   - `rmq.instance.metrics` accepts the sole shared data source whose bindings 
include the target instance, still preferring a dedicated one; ambiguous or 
missing bindings keep answering 409.
   
   **Streaming render path (web)**
   
   - Transcript bubbles and their blocks are memoised. A streaming tick 
re-renders the page at display rate; before this change every frame re-ran 
ReactMarkdown over every persisted answer and reconciled every finished tool 
card (up to 32 KiB of `<pre>` each). The reducers only replace the block that 
changed, so unchanged blocks keep their identity and now skip the work.
   - The follow-scroll uses instant jumps while streaming: the effect re-runs 
once per animation frame, and starting a fresh `smooth` scroll on every frame 
stacks concurrent scroll animations. Idle arrivals keep the smooth behaviour.
   - The composer context-token estimate memoises its persisted half on the 
timeline rows instead of regex-scanning every persisted answer per frame.
   - The operator's question shows immediately while its run streams. The live 
stream carries no `user` frame and the persisted transcript only refetches when 
the run finishes, so the question stayed invisible for the whole run — minutes 
on long tool-heavy answers. `useAgentRun` now keeps the admitted prompt as an 
optimistic user bubble, dropped in the same commit as the end-of-run refetch 
swaps in the persisted row (kept when the refetch fails, like the live blocks; 
a re-attach finds the row already persisted).
   
   ### 2. `test(web): stabilize table-page tests against spin-overlay and 
instance-load races`
   
   - antd Spin keys `.ant-spin-blur` on an internal state that follows the 
Table `loading` prop one commit behind, and that class sets `pointer-events: 
none` over the whole body — a click right after a `findByText` on row text 
intermittently lands in that window under parallel load. Table-driving page 
tests now use `userEvent.setup({ pointerEventsCheck: 0 })`, the convention four 
existing test files already follow.
   - The consumer/topic CSV import tests waited on the pagination summary text, 
which the page-header subtitle carries from the very first render (total starts 
at 0): the upload raced the instance list and `handleImportFile` bailed on its 
`selectedInstanceId` guard. They now wait for the instance-scoped page fetch.
   - The static `message`/`notification` holders are body-level and survive RTL 
cleanup; the global test setup now destroys both after each test.
   
   ## Verification
   
   - server: `mvn test` 3149/3149 green (rebased tree)
   - web: `vitest` 1283/1283 green, 4 consecutive full-suite runs after the 
stabilization commit; `tsc -b` and eslint clean
   - deployed and exercised end-to-end: proxy tools return live proxy 
endpoints, metrics queries resolve through the shared data source, second 
questions render instantly while streaming with zero long tasks during the 
stream window
   


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