Add support for enabling/disabling individual AI providers via admin configuration UI
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3522830. --> Reported by: [prashant.c](https://www.drupal.org/user/1936756) Related to !586 >>> <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>Currently, there is no way to enable or disable configured AI providers in the system. All configured providers are treated as active once their configuration forms are filled, with no global or individual toggle to control their activation state. This limits administrative control, especially when multiple providers are configured and selectively enabling/disabling them is desirable (e.g., for testing, etc).</p> <h4 id="summary-steps-reproduce">Steps to reproduce</h4> <ul> <li>Navigate to /admin/config/ai or /admin/config/ai/providers.</li> <li>Observe that there is no way to enable or disable a configured provider.</li> <li>Open a specific provider configuration page, e.g., /admin/config/ai/providers/openai or /admin/config/ai/providers/gemini.</li> <li>Confirm that these pages also do not provide an option to enable/disable the provider.</li> </ul> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <p>Introduce an enable/disable checkbox for each configured provider.<br> Options for implementation:</p> <ol> <li>Provide a centralized list of all configured providers at /admin/config/ai/providers with checkboxes to enable or disable each.</li> <li>Alternatively, require each provider module (e.g., openai, gemini) to implement its own enable/disable toggle on its settings page (/admin/config/ai/providers/[provider]). But this does not seem to be a flexible one.</li> <li>The system should respect the enable/disable status when invoking a provider for tasks or inference.</li> </ol> <h3 id="summary-remaining-tasks">Remaining tasks</h3> <p>TBD</p> <h3 id="summary-ui-changes">User interface changes</h3> <p>TBD</p> <h3 id="summary-api-changes">API changes</h3> <p>None initially, unless we want to expose provider status via JSON: API, etc.</p> <h3 id="summary-data-model-changes">Data model changes</h3> <p>Configuration schema update to include an "enabled" boolean value for each provider.</p>
issue