Let one gate decide every AI surface, so switching AI off actually removes all of it
The Tools card adopted the AI scripts on the host check alone, and api/ai.php only tested AI_ENABLED in front of ask, so a disabled subsystem still had rows to run and an endpoint that answered.
This commit is contained in:
@@ -70,10 +70,11 @@ $_vv_doc_vars = array_merge(vv_conf_vars(), [
|
||||
]);
|
||||
|
||||
// The assistant dock renders only where the AI tab itself would: HOST1, with AI_ENABLED true.
|
||||
// Same two conditions, checked the same way, so the page cannot offer a chat the endpoint will
|
||||
// refuse — api/ai.php 404s every action off HOST1 regardless of what this page draws.
|
||||
$_vv_ai_on = vv_is_ai_host()
|
||||
&& strtolower(trim(vv_conf_vars()['AI_ENABLED'] ?? 'false')) === 'true';
|
||||
// The same gate function, not a second copy of the condition, so the page cannot offer a chat
|
||||
// the endpoint will refuse — api/ai.php rejects every action on both counts regardless of what
|
||||
// this page draws. With it false the dock markup is never emitted, and every caller into the
|
||||
// dock is guarded by vvAiDockOn(), which reads the element's absence.
|
||||
$_vv_ai_on = vv_ai_ui_on();
|
||||
|
||||
// Setup mode — auto-open a conf file and force the editing sequence
|
||||
$vv_setup_conf = preg_match('/^[\w.]+\.conf$/', $_GET['vv_setup'] ?? '')
|
||||
|
||||
Reference in New Issue
Block a user