yyqdbngt opened a new pull request, #2868: URL: https://github.com/apache/rocketmq-dashboard/pull/2868
## Summary - Add a `toolExecuteRequestRef` execution-generation counter to the AI tool runner - `selectTool()` and `loadTools()` now invalidate any in-flight execution (and reset its spinner), and `handleExecuteTool()` only applies a result/message if its generation is still current - Add a page regression test: start a tool execution, switch the selected tool while it is in flight, and verify the stale result is discarded ## Why Tool execution is async but the modal only guarded against *double submits* (the `toolExecuting` state flag), not against the tool changing while a request was in flight. Switching tools (or the cluster, which reloads the catalog) called `setToolResult(undefined)` for the new tool, and the in-flight request then resolved into that slot — the user saw tool A's result rendered under tool B, and the spinner state could also desynchronize (stuck on or cleared early). ## Testing - `./node_modules/.bin/vitest run src/pages/ai/__tests__/AiPage.test.tsx` → 14 passed (1 new) - `./node_modules/.bin/tsc --noEmit` → clean - `./node_modules/.bin/eslint src/pages/ai/index.tsx src/pages/ai/__tests__/AiPage.test.tsx` → 0 errors -- 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]
