The event for tool selection fails where contextValue is not set
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3573769. --> Reported by: [marcus_johansson](https://www.drupal.org/user/385947) Related to !237 >>> <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>We have a problem that Tool API doesn't actually sometimes set the context value until it executes, since it wants to normalize this.</p> <p>This means that when we want to show the selections in some debugger, they are not available, because they are not set yet on the AgentToolPreExecuteEvent, since its not executed yet. This can lead to fatal errors on for instance <a href="https://www.drupal.org/project/ai_agents_debugger">https://www.drupal.org/project/ai_agents_debugger</a></p> <h4 id="summary-steps-reproduce">Steps to reproduce</h4> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <p>Change so that the even checks the actual picks from the AI response instead.</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