zjncs opened a new issue, #5611:
URL: https://github.com/apache/rocketmq-dashboard/issues/5611

   ## Description
   
   The backend caps an AI message at 8192 characters — `AiMessageDTO.message` 
carries `@NotBlank @Size(max = 8192)` ("the same budget AiRunService enforces 
server-side so no caller can ..."). `AiConversationController` converts the 
violation into an in-stream refusal frame (`ai.request.invalid`), so the run 
never starts.
   
   But nothing client-side knows about the budget:
   
   - `Composer.tsx`'s textarea has no `maxLength`
   - `chatDraft.ts:buildMessageRequest` (and `draftToMessageRequest` through 
it) forwards any length
   
   ## Impact
   
   Pasting a long stack trace or log (>8192 chars) into the ops-assistant chat 
always fails with an unhelpful in-stream refusal; nothing client-side explains 
or prevents it. The user's text is lost from the composer on the failed send.
   
   ## Expected behavior
   
   - `buildMessageRequest` refuses to build an over-budget request (exported 
`AI_MESSAGE_MAX_LENGTH = 8192`, mirroring the DTO)
   - the composer textarea caps input at the same budget so the refusal path 
becomes a safety net rather than the user experience
   
   ## Environment
   
   - branch: master (0228dad5)
   - files: `web/src/pages/ai/chatDraft.ts`, 
`web/src/pages/ai/components/Composer.tsx`


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