You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "Aias00 (via GitHub)" <gi...@apache.org> on 2026/08/03 07:56:09 UTC
[PR] [ISSUE #811] Use configured API base URL for AI chat stream [rocketmq-dashboard]
Aias00 opened a new pull request, #812:
URL: https://github.com/apache/rocketmq-dashboard/pull/812
### What is changed
- Build the AI chat SSE endpoint from the shared `API_BASE_URL` config instead of hard-coding `/api/ai/chat`.
- Extend the SSE API test to verify streaming chat respects a configured API base path.
Fixes #811
### Verification
- npm test -- --run src/api/ai.test.ts
- npm run build
--
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: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [ISSUE #811] Use configured API base URL for AI chat stream [rocketmq-dashboard]
Posted by "Aias00 (via GitHub)" <gi...@apache.org>.
Aias00 closed pull request #812: [ISSUE #811] Use configured API base URL for AI chat stream
URL: https://github.com/apache/rocketmq-dashboard/pull/812
--
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: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [ISSUE #811] Use configured API base URL for AI chat stream [rocketmq-dashboard]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #812:
URL: https://github.com/apache/rocketmq-dashboard/pull/812#discussion_r3702296455
##########
web/src/api/ai.ts:
##########
@@ -135,7 +136,7 @@ export async function chatStream(
onChunk: (text: string) => void,
signal?: AbortSignal,
) {
- const response = await fetch('/api/ai/chat', {
+ const response = await fetch(`${API_BASE_URL}/ai/chat`, {
Review Comment:
`${API_BASE_URL}/ai/chat` can produce a double-slash (e.g. `/studio-api//ai/chat`) if `API_BASE_URL` is configured with a trailing `/`. This can break routing for some proxies/servers. Consider normalizing the join (trim trailing `/` from `API_BASE_URL` and ensure the path starts with a single `/`), or use a small URL-join helper so the result is always exactly one slash between segments.
##########
web/src/api/ai.test.ts:
##########
@@ -28,6 +28,8 @@ import {
type McpTool,
} from './ai';
+vi.mock('../config', () => ({ API_BASE_URL: '/studio-api' }));
Review Comment:
The module under test (`./ai`) imports `../config` at module evaluation time. Declaring `vi.mock('../config', ...)` after importing `./ai` relies on Vitest’s mock-hoisting behavior and can be brittle across module systems/settings. To make the test ordering unambiguous, move the `vi.mock('../config', ...)` above the `./ai` import, or switch to dynamically importing `./ai` after the mock is set up.
--
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: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [ISSUE #811] Use configured API base URL for AI chat stream [rocketmq-dashboard]
Posted by "Aias00 (via GitHub)" <gi...@apache.org>.
Aias00 commented on PR #812:
URL: https://github.com/apache/rocketmq-dashboard/pull/812#issuecomment-5175216382
Superseded by consolidated PR #940, which contains this change and has passing checks. Closing this narrower PR to keep review focused.
--
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: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org