zjncs opened a new pull request, #5680:
URL: https://github.com/apache/rocketmq-dashboard/pull/5680

   ### Problem
   
   `ToolExecutionService` — the single execution entry point every AI tool call 
goes through, with three doors (anonymous console, MCP transport, 
console-with-target) — had **no test**.
   
   ### Change
   
   Add `ToolExecutionServiceTest` with thirteen tests:
   
   | Contract | Pinned behaviour |
   | --- | --- |
   | console path | resolves the `instanceId` argument by name through the 
`InstanceResolver` and runs the invocation through the filter chain |
   | argument guard | a missing or blank `instanceId` is rejected **naming the 
tool**; an unknown instance name is rejected naming the id |
   | MCP binding | the caller's `instanceId` must **match the transport 
binding** — a mismatch is rejected echoing the *bound* instance back so a 
guessing agent self-corrects instead of probing candidate ids; a matching 
instance skips the resolver entirely; null authentication on the MCP path is 
rejected before anything runs |
   | failure discipline | a `BusinessException` from the pipeline is wrapped 
with its message; an unexpected failure is wrapped as the internal tool error 
with the original cause attached |
   | construction | a duplicate handler name, a handler missing from the 
catalog, and a catalog tool without a handler are each rejected — the catalog 
and the handler registry must cover each other exactly |
   | console target | `executeWithTarget` still demands an `instanceId` 
argument for non-exempt tools (the target only carries platform tools) |
   
   ### Verification
   
   - New tests: **13/13 green** against unmodified code.
   - Discriminating mutations on `ToolExecutionService` (build result 
verified): the MCP instance cross-check dropped (**red**); the 
null-authentication guard dropped (**red**); the missing-instanceId check 
dropped (**red**); the unexpected-failure wrapping dropped (**red**); the 
console-path instance lookup dropped (**red**).
   - Restored: 13/13 green. No product code changed.


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