Copilot commented on code in PR #13899:
URL: https://github.com/apache/apisix/pull/13899#discussion_r3892957711


##########
apisix/control/v1.lua:
##########
@@ -108,6 +116,36 @@ local function get_checker_type(checks)
 end
 
 
+-- A plugin can run active health checks of its own on nodes that belong to no
+-- upstream -- ai-proxy-multi probes every LLM instance and skips the unhealthy
+-- ones when it picks a target. Those checkers are keyed by the resource key 
plus
+-- a JSON path, a layout only the plugin knows, so ask the plugin for them
+-- instead of guessing. What a checker stands for is the plugin's business too:
+-- it names itself in `meta`, reported verbatim.
+local function add_plugin_healthcheck_info(infos, value)
+    local plugins = value.value.plugins
+    if not plugins then
+        return
+    end
+
+    for name, plugin_conf in pairs(plugins) do
+        local plugin_obj = plugin.get(name)
+        if plugin_obj and plugin_obj.list_healthcheck_targets then

Review Comment:
   Disabled plugin configs must not be queried here. APISIX skips 
`_meta.disable = true` plugins at runtime and deliberately accepts their 
otherwise schema-invalid configuration (`apisix/plugin.lua:1024-1036`), so this 
unconditional callback can report checkers that never run or even fail 
`/v1/healthcheck` when a disabled config has a malformed `instances` value. 
Skip disabled configs before invoking the hook.



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