youngkermit8-coder opened a new pull request, #1728: URL: https://github.com/apache/rocketmq-dashboard/pull/1728
## What changed - replace unbounded `BodyHandlers.ofString()` buffering with a custom 5 MiB body subscriber - cancel response-body delivery as soon as the limit is exceeded - apply the same limit to chat completions, model listings, and streaming upstream-error bodies - return the structured `llm.provider.response_too_large` gateway error on overflow - keep successful streaming responses incremental and preserve existing parsing/error behavior below the cap ## Why `OpenAiCompatibleLlmClient` previously materialized completion and model-list responses without a size limit. Its streaming error path also called `readAllBytes()`. The request timeout limited duration but not memory use, so a misconfigured, compromised, or local OpenAI-compatible endpoint could consume the Studio process heap with one arbitrarily large response. This is independent from #1719/#1721, which bounds CLI child-process output rather than HTTP provider responses. Closes #1724 ## Validation - baseline oversized-completion regression failed on exact upstream because no exception was raised - `OpenAiCompatibleLlmClientTest` — 17/17 passed, including completion overflow, exact-boundary, model-list overflow, and streaming-error overflow - related AI regression suite — 64/64 passed - `mvn -DskipTests package` — passed - Checkstyle — 0 violations - `git diff --check` — passed -- 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]
