Error page when adding ai assistants when ai_agent module is not installed or uninstalled.
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3526029. -->
Reported by: [anjaliprasannan](https://www.drupal.org/user/3637917)
Related to !628
>>>
<h3 id="summary-problem-motivation">Problem/Motivation</h3>
<p>I was trying to add ai assistant and I do not have ai agent installed, that ran to the error below.</p>
<pre>The website encountered an unexpected error. Try again later.<br><br>Drupal\Component\Plugin\Exception\PluginNotFoundException: The "ai_agent" entity type does not exist. in Drupal\Core\Entity\EntityTypeManager->getDefinition() (line 139 of </pre><h4 id="summary-steps-reproduce">Steps to reproduce</h4>
<ul>
<li>Either not enable the ai_agents module or uninstall the ai_agents module.</li>
<li>try adding ai assistant at admin/config/ai/ai-assistant and fill the fields.</li>
<li>On save the form you get the error page</li>
<li>
</ul>
<h3 id="summary-proposed-resolution">Proposed resolution</h3>
<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>
<h3 id="summary-data-model-changes">Data model changes</h3>
> Related issue: [Issue #3516448](https://www.drupal.org/node/3516448)
issue