Frun1na opened a new pull request, #4645: URL: https://github.com/apache/rocketmq-dashboard/pull/4645
### Which Issue(s) This PR Fixes - Fixes #<BACKFILL> ### Brief Description The MCP message query tools could silently drop messages beyond the result budget: - `rmq.message.query_by_topic` stops at the 200-message topic-window limit, but its output gave no hint that rows were missing. - In `rmq.message.query`, the `key` path can stop at the same budget, and the `msgId`/`uniqueKey` paths were fine but the tool output had no way to distinguish exact from partial results. An agent (or CLI user) reading the tool output could wrongly conclude that a topic had no more matching messages — for example, when querying a busy topic for a broad tag, the first 200 rows look complete. This PR adds a boolean `truncated` field to the shared `ListOutput` contract and populates it for the two affected tools: - `truncated=true` when the result budget was reached before the query was exhausted (either the collector's `mayBeTruncated` flag, or the topic result-limit heuristic `size >= 200`). - The `msgId` and `uniqueKey` paths are exact lookups and always report `truncated=false`. - `ListOutput` serializes with `@JsonInclude(NON_NULL)`, so tools without a meaningful truncation notion (e.g. `rmq.message.query_by_offset`, list tools) keep emitting exactly the same JSON as before. The tool catalog `outputSchema` for both tools is updated with the new field and a description that tells the caller how to proceed (narrow the time range / use a more specific identifier). `rmqctl`'s generated catalog is regenerated with `make catalog-generate`. ### How Did You Test This Change? ``` $ cd server && mvn -B -ntp test -Dtest='MessageQueryToolHandlerTest,MessageQueryByTopicToolHandlerTest' [INFO] Tests run: 7 ... -- in ...MessageQueryToolHandlerTest [INFO] Tests run: 3 ... -- in ...MessageQueryByTopicToolHandlerTest [INFO] Tests run: 10, Failures: 0, Errors: 0, Skipped: 0 [INFO] BUILD SUCCESS ``` New tests cover both tools reporting `truncated=true` when the handler receives a `MessageQueryResult.truncated(...)` result, plus existing tests updated to assert `truncated=false` on the exact paths. ``` $ cd server && mvn -B -ntp test -Dtest='ToolOutputSchemaContractTest,MessageServiceTest,MessageQueryByOffsetToolHandlerTest' [INFO] Tests run: 24, Failures: 0, Errors: 0, Skipped: 0 [INFO] BUILD SUCCESS ``` The schema-contract test confirms the new `truncated` property matches the actual tool output shape, and the query-by-offset handler output is unchanged. ``` $ cd rmqctl && make catalog-verify && go test ./... # catalog-verify passes with the regenerated catalog_gen.go ``` - [x] I have added tests for my changes - [x] I have run the existing tests and they pass - [x] New source files carry the Apache license header (no new source files) -- 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]
