unbridled-41 opened a new issue, #5939:
URL: https://github.com/apache/rocketmq-dashboard/issues/5939
### Studio Version
branch: `rocketmq-studio` @ `7e7aa344` (the revision verified; the branch is
based on it)
deployed as: not required to reproduce
### Runtime Environment
Reproduced with the backend tests (`cd server && mvn -o -B -ntp test
-Dtest='ToolDryRunAuditTest'`).
### Connected RocketMQ Cluster
Not required.
### Describe the Bug
A mutating AI/MCP tool call with `dry_run: true` stops at the mutation
filter's plan:
```java
if (context.dryRun()) {
String token = tokenService.issue(context);
return new MutationOutput<>(MutationOutput.Status.PLANNED,
context.instanceId(), plan, token, null);
}
```
but the outermost audit filter records every non-throwing call identically:
```java
this.record(context, "SUCCESS", null);
```
So `POST /api/ai/tools/rmq.topic.delete/execute {"dry_run":true}` - and the
same call through MCP - wrote the same row as a real deletion:
`operation=DELETE_TOPIC, target=rmq.topic.delete, detail=null, result=SUCCESS`.
An auditor answering "who deleted topic X" reads rows for calls that deleted
nothing, and nothing in `/api/audit-logs` or its CSV export tells them apart.
### Steps to Reproduce
1. Call a mutating tool with `dry_run: true` (any client; the hosted agent
does it by default before applying).
2. Compare the audit row with the one a real apply produces: identical apart
from the timestamp.
### What Did You Expect to See?
The audit row distinguishes a preview from an applied change.
### What Did You See Instead?
The preview was recorded as a successful mutation.
### Evidence
- `server/.../ops/ai/tool/filter/ToolAuditFilter.java`,
`server/.../ops/ai/tool/filter/ToolMutationFilter.java`,
`server/.../ops/ai/tool/contract/common/MutationOutput.java`.
- `cd server && mvn -o -B -ntp test -Dtest='ToolDryRunAuditTest'` - the new
case fails before the fix (the recorded detail is null).
### Impact
The audit trail cannot be used to answer whether a destructive operation was
applied, which is its main use for AI-driven changes.
### Acceptance Criteria
- A planned (dry-run) call is recorded with a marker that says it applied
nothing, and an executed call keeps the empty detail, with regression tests for
both.
**Corresponding PR:** #ISSUEPR#
--
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]