You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "123123213weqw (via GitHub)" <gi...@apache.org> on 2026/09/16 15:11:42 UTC

[PR] fix(ai): validate message properties before confirming a send preview [rocketmq-dashboard]

123123213weqw opened a new pull request, #4470:
URL: https://github.com/apache/rocketmq-dashboard/pull/4470

   ### Which Issue(s) This PR Fixes
   
   No issue: this is a small input-validation gap found while reading the tool handlers. Happy to file one if you would rather track it.
   
   ### Brief Description
   
   The `rmq.message.send` tool previewed a message without parsing its properties, so a malformed property string passed the confirmation step and failed only when the send was executed. The preview is what the operator reads before approving the write, so it has to reject the same input the execution path rejects: `preview` now parses the properties, which raises the same error the confirm step would, before the operator is asked to approve anything.
   
   This is revived from a branch whose pull request was closed when `rocketmq-studio` was folded into `master` and the base branch was deleted, and keeps its red/green pair.
   
   ### How Did You Test This Change?
   
   ```
   cd server && mvn -B -ntp test -Dtest=MessageSendToolHandlerTest
   [INFO] Tests run: 14, Failures: 0, Errors: 0, Skipped: 0
   ```
   
   Test coverage: `MessageSendToolHandlerTest` asserts that a preview with an unparseable property string fails at preview time with the property error, instead of returning a plan that only fails on execution.
   
   A note for the larger AI-domain picture: the tool layer has been restructured since the earlier AI pull requests (`ops/ai/tool` is now split into `catalog`, `contract`, `core`, `filter`, `handler`, `service`, `support`, and `AiPayloadGuard` covers tool-invocation payloads). Most of those older branches are obsolete as a result, so I am not resubmitting them; this one is still applicable to the current handler.
   
   ### Checklist
   
   - [x] One coherent change; unrelated modifications are not bundled in
   - [x] Commit subject follows Conventional Commits (`fix:`)
   - [x] Tests added or updated for non-trivial changes, test methods named `...Test`
   - [x] New UI text has both Chinese and English entries under `web/src/i18n/` — not applicable, no UI text added
   - [x] Architecture constraints stay green (`mvn test` runs the ArchUnit checks)
   - [x] New source files carry the ASF license header — no new source files
   - [x] Documentation touched where behaviour changed — none describes the preview contract
   


-- 
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] fix(ai): validate message properties before confirming a send preview [rocketmq-dashboard]

Posted by "lizhimins (via GitHub)" <gi...@apache.org>.
lizhimins merged PR #4470:
URL: https://github.com/apache/rocketmq-dashboard/pull/4470


-- 
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] fix(ai): validate message properties before confirming a send preview [rocketmq-dashboard]

Posted by "123123213weqw (via GitHub)" <gi...@apache.org>.
123123213weqw commented on PR #4470:
URL: https://github.com/apache/rocketmq-dashboard/pull/4470#issuecomment-5757306163

   All three points are in — thanks for the precise review, and for naming the neighbouring handlers that already do this; it made the shape obvious.
   
   - **Test naming (the blocker).** Renamed to `malformedPropertiesFailDuringPreviewAndExecutionTest`. You are right that the checklist box did not match the diff — it does now.
   - **`parseProperties(input.properties());`** carries a one-line comment saying the call is validation-only and the parsed value is rebuilt in `execute`, so nobody deletes it as dead code.
   - **The assertion** imports `org.apache.rocketmq.studio.ops.ai.tool.core.ToolExecutionException` rather than spelling it out inline.
   
   ```
   $ cd server && mvn -B -ntp test -Dtest=MessageSendToolHandlerTest
   [INFO] Tests run: 14, Failures: 0, Errors: 0, Skipped: 0
   [INFO] BUILD SUCCESS
   ```
   
   On the issue: I have no preference — I can open a short one if you want the trail, or leave it as is. Your call.
   


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