AI Provider settings should trickle down, if not explicitly set
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3548407. -->
Reported by: [marcus_johansson](https://www.drupal.org/user/385947)
>>>
<h3 id="summary-problem-motivation">Problem/Motivation</h3>
<p>We have this issue <span class="drupalorg-gitlab-issue-link project-issue-status-info project-issue-status-13"><a href="https://www.drupal.org/project/ai_agents/issues/3535760" title="Status: Needs work">#3535760: Make it possible to pick providers per agent</a></span>, that would make it possible to pick a AI configuration per agent. However right now you would be able to set one in the assistant if we use <span class="drupalorg-gitlab-issue-link project-issue-status-info project-issue-status-8"><a href="https://www.drupal.org/project/ai/issues/3543368" title="Status: Needs review">#3543368: Provider configuration on assistant, when run as agent, is not being sent to provider</a></span>.</p>
<p>This should also trickle down, so when both above issues are merged, the order should be:</p>
<ol>
<li>If a specific configuration exists, pick it.</li>
<li>If the parent has picked a configuration for you, use it.</li>
<li>Fall back to default "Chat with tools" provider.</li>
</ol>
<h3 id="summary-proposed-resolution">Proposed resolution</h3>
<p>Implement the loading according to the structure above. Depending on if <span class="drupalorg-gitlab-issue-link project-issue-status-info project-issue-status-13"><a href="https://www.drupal.org/project/ai_agents/issues/3535760" title="Status: Needs work">#3535760: Make it possible to pick providers per agent</a></span> is finished first or not, the two first one should be fixed.</p>
issue