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

   ### Problem
   
   `AgentCapabilityProbe` — the answer behind `GET /api/ai/agent-capabilities` 
— had **no test**. Its contracts carry a UI-shaping subtlety and a fork-bomb 
guard:
   
   | Contract | Subtlety |
   | --- | --- |
   | cache | one probe round (three `sh -c "command -v …"` forks) is cached 
**60 s**; the design doc explicitly calls per-request probing "a fork bomb one 
browser refresh away" |
   | rmqctl availability | reports unavailable when 
`studio.ai.conversation.rmqctl-enabled=false` **even if the binary is present** 
— reporting a present-but-disabled binary would make the composer offer an 
instance picker for tools that are switched off; the flag short-circuits so the 
binary is never forked |
   | per-instance cache | the cache is instance state, not static |
   
   ### Change
   
   Add `AgentCapabilityProbeTest` with seven tests. The TTL boundary is driven 
by a hand-walked `Clock` (no sleeping): the 59th second is still cached, the 
61st re-probes; a cached answer carries its probe timestamp; claude/qoder probe 
their own binaries; the config flags round-trip; two probe instances fork 
independently.
   
   ### Verification
   
   - New tests: **7/7 green** against unmodified code.
   - Discriminating mutations on `AgentCapabilityProbe` (build result 
verified): TTL check dropped so every call forks (**red**); the rmqctl flag no 
longer short-circuits (**red**); TTL stretched 1000× so expired answers are 
served (**red**).
   - Restored: 7/7 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