Agents failing to determine solvability forever stuck in "started" state
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3553458. -->
Reported by: [mglaman](https://www.drupal.org/user/2416470)
Related to !250
>>>
<h3 id="summary-problem-motivation">Problem/Motivation</h3>
<p>\Drupal\ai_agents\PluginBase\AiAgentEntityWrapper::determineSolvability dispatches AgentStartedExecutionEvent which creates the item. But failure to determine solvability leaves it in a started state.</p>
<h4 id="summary-steps-reproduce">Steps to reproduce</h4>
<p>Have a test token with no budget/quota left.</p>
<h3 id="summary-proposed-resolution">Proposed resolution</h3>
<p>Dispatch AgentStartedExecutionEvent after chat actually happens. Or use try/catch around `$return = $this->aiProvider->chat($input, $this->modelName, $tags);` to stop the agent.</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>
<h3 id="summary-data-model-changes">Data model changes</h3>
issue