Exceptions in tool execute break the UI for the user
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3537123. --> Reported by: [jurgenhaas](https://www.drupal.org/user/168924) Related to !163 >>> <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>When using the AI Agent Explorer and run an agent that has an issue with a tool definition, e.g. if the context definition isn't accurate, Drupal throws an exception and the UI in the explorer is broken with an error message in the browser console. The user doesn't get any feedback, that the process failed.</p> <p>The same is likely to happen in other contexts, too, e.g. in the chat.</p> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <p>Let's try and catch such exceptions and provide the exception message as a response to the tool exception.</p>
issue