Loyal-Young opened a new pull request, #5185: URL: https://github.com/apache/rocketmq-dashboard/pull/5185
## What changed Recognize a blank SSE line when its two line endings use different valid styles. The AI stream reader now handles LF followed by CRLF, as well as the other CR/LF combinations, without treating one CRLF as two line endings. This keeps adjacent `agent` and `done` frames separate. Fixes #5184. The [WHATWG event-stream parsing rules](https://html.spec.whatwg.org/multipage/server-sent-events.html#event-stream-interpretation) allow CRLF, LF, and CR line endings independently. ## Verification - Reproduced the `LF+CRLF` failure on the previous implementation: an `agent` JSON payload was joined with the following `done` payload and rejected as malformed. - `npx vitest run src/api/ai.test.ts` — 31 passed, including the mixed-ending cases and a single-CRLF guard. - `npx tsc -b` — passed. - `npx eslint src/api/ai.ts src/api/ai.test.ts` — passed. - `git diff --check` — passed. ## AI assistance An AI assistant helped inspect the stream boundary matcher, draft the focused change, and write the regression tests. The failure was reproduced before the fix, and the checks above were run afterward. -- 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]
