feat(ai): add rmq.message.trace tool to the AI tool catalog - #1127
feat(ai): add rmq.message.trace tool to the AI tool catalog#1127123123213weqw wants to merge 1 commit into
Conversation
RockteMQ-AI
left a comment
There was a problem hiding this comment.
Summary
The rmq.message.trace tool implementation looks clean and follows the existing tool handler patterns well. However, CI is failing due to a compilation error that needs to be fixed before this can be merged.
Findings
- [Critical]
MessageTraceToolHandler.java:48—messageProvider.getMessageTrace(msgId)is called with 1 argument, butMessageProvider.getMessageTracenow requires 2 arguments(String instanceId, String msgId). TheMessageProviderinterface was updated (likely by the instance-scoping PRs #1128/#1130) to require aninstanceIdparameter.
Fix
The execute() method needs to extract instanceId from the input map and pass it through:
@Override
public Object execute(Map<String, Object> input) {
String instanceId = (String) input.get("cluster"); // or a dedicated instanceId field
String msgId = (String) input.get("msgId");
TraceRecordVO trace = messageProvider.getMessageTrace(instanceId, msgId);
return project(msgId, trace);
}You may also need to update the tool's inputSchema in rmq-tools.yaml if the cluster field maps to instanceId.
Suggestions
- Consider adding a null check for
msgId— if it's missing from the input, the current code would passnullto the provider, which could cause an NPE deeper in the stack. - The
project()method could benefit from handling anulltrace gracefully (e.g., if the message ID is not found).
Automated review by github-manager-bot
|
Closing: this area belongs to Track 3 (AI Native), which already has a complete design in progress (see #1024). Further LLM/AI tool catalog changes should follow that design discussion instead of ad-hoc PRs. Thanks for the effort! / 关闭说明:该改动属于赛道三(AI Native)范围,赛道三已有完整的设计方案正在推进(见 #1024),AI 工具目录相关改动请跟随该设计讨论,不再单独接收零散 PR。感谢贡献! |
Extends the Studio AI tool catalog (shared by Web/AI/MCP/CLI — track 3 "AI Native") with a message trace tool.
rmq.message.tracebacked by the standardMessageProvider.getMessageTrace, surfacing the produce/consume/transaction timeline for a message id.rmq-tools.yaml) with input/output JSON Schema; requires cluster + msgId per the catalog convention.Related: #1024 (track 3 AI Native), #998 (MCP server and CLI).