unbridled-41 opened a new pull request, #5944:
URL: https://github.com/apache/rocketmq-dashboard/pull/5944

   ### Which Issue(s) This PR Fixes
   
   Fixes #5943
   
   ### Problem / Evidence
   
   `GetAgentCapabilities` answers five flags and its own javadoc says why ("all 
five fields are required booleans, never null, so the UI can grey out engines 
and tool tiers that are absent instead of guessing"; 
`mcpEnabled`/`l3ToolsAllowed` "exist so the UI can explain a refusal instead of 
showing a mystery error"). Only `rmqctlAvailable` was read:
   
   ```
   Composer: disables an engine the server probed as absent
     -> the option kept its enabled class (red before this change)
   grep -rn "claudeAvailable\|l3ToolsAllowed" web/src  ->  the type declaration 
only
   ```
   
   So the composer offered engines whose binary the probe had found missing, 
and a server with `spring.ai.mcp.server.enabled=false` or 
`studio.ai.allow-l3-tools=false` refused tool calls with no notice - while the 
composer's quick actions include destructive operations.
   
   ### Root cause / Fix
   
   The capability contract was wired for one field. Return the whole probe 
(keeping the documented unknown-state discipline: every flag defaults to 
`true`, and a failed request does not turn a capability "missing"), disable the 
engine options the probe reported absent, and render a neutral notice when the 
MCP channel or the L3 tier is disabled.
   
   ### Priority and scoring
   
   **PRIORITY 50** — impact 18/40 (a failed run or an unexplained refusal for a 
state the API reports explicitly), blast radius 12/20 (every deployment with a 
missing CLI binary or a disabled tool tier), reproducibility 18/20 
(deterministic, pinned by tests), maintenance value 2/20.
   
   **FIX_CONFIDENCE 82** — the flags, their semantics and the rendering slots 
(`InfoBanner`, the select's options) already exist.
   
   ### Tests
   
   `cd web && npx vitest run 
src/pages/ai/components/__tests__/Composer.test.tsx 
src/pages/ai/hooks/useAgentCapabilities.test.ts 
src/pages/ai/__tests__/AiPage.test.tsx` -> `Test Files 3 passed, Tests 40 
passed`.
   
   | Test | Before | After |
   |---|---|---|
   | `Composer: disables an engine the server probed as absent` | FAIL (option 
stayed enabled) | PASS |
   | `Composer: keeps every engine selectable when the probe has not answered` 
| PASS (guard) | PASS |
   | `AiPage: explains a refused tool call when the server disabled the MCP 
channel` | compile/behaviour-red (no notice existed) | PASS |
   | `AiPage: explains a refused destructive tool when L3 tools are disabled` | 
same | PASS |
   | `useAgentCapabilities: reports the probed engine and tool switches, 
keeping unknown as available` | compile-red (hook returned a boolean) | PASS |
   
   AiPage's capability fixture now models a fully capable server 
(`l3ToolsAllowed` was `false` there; no test depended on it). `npx eslint` 
reports no errors; `npx tsc -b` passes.
   
   ### Risk
   
   A deployment that disables a tool tier now shows a persistent neutral 
notice, and an uninstalled engine cannot be selected; the unknown/failed-probe 
path is unchanged (permissive) and pinned by a test.


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