AI Settings - Default Model needs refresh when Default Provider changes
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3521769. -->
Reported by: [mgifford](https://www.drupal.org/user/27930)
Related to !581 !595
>>>
<h3 id="summary-problem-motivation">Problem/Motivation</h3>
<p>It is a bit confusing right now when changing between different default providers here /admin/config/ai/settings</p>
<p>Sometimes I am able to have a Default Provider set with a Default Model which is from another provider.</p>
<p>I shouldn't be able to see:</p>
<p><img src="https://www.drupal.org/files/issues/2025-04-29/Screenshot%202025-04-29%20at%2010.06.38%E2%80%AFAM.png" alt="Wrong provider / model combination"></p>
<p>This shouldn't be possible:</p>
<p><img src="https://www.drupal.org/files/issues/2025-04-29/Screenshot%202025-04-29%20at%2010.06.54%E2%80%AFAM.png" alt="Error after saving with conflicting provider/model options. "></p>
<h4 id="summary-steps-reproduce">Steps to reproduce</h4>
<p>I'm not sure. Sometimes it works as expected. </p>
<h3 id="summary-proposed-resolution">Proposed resolution</h3>
<p>Reload the available models when the Default Provider changes.</p>
<h3 id="summary-remaining-tasks">Remaining tasks</h3>
<h3 id="summary-ui-changes">User interface changes</h3>
<h3 id="summary-api-changes">API changes</h3>
<p>None</p>
<h3 id="summary-data-model-changes">Data model changes</h3>
<p>None</p>
issue