Taxonomy automator clears valid term values when the LLM returns HTML-encoded entities (e.g. &)
<!-- Please search existing work items before filing to avoid duplicates. --> ## Summary When an AI Automator targets a taxonomy/entity-reference field, valid LLM responses are silently discarded if the term name contains a character that the model returns HTML-encoded (e.g. an ampersand returned as `&amp;` instead of `&`). The value passes generation but is stripped in `verifyValue()` because the comparison against the real term names is an exact string match, so the field is never filled. <!-- Testing Setup (optional — to reproduce on a clean install): mkdir my-drupal-site && cd my-drupal-site ddev config --project-type=drupal11 --docroot=web ddev composer create-project drupal/cms ddev drush site:install --account-name=admin --account-pass=admin -y # Enable AI Dashboard and ai_api_explorer # Launch the site and open the AI dashboard to add an OpenAI or Anthropic key: ddev launch $(ddev drush uli /admin/config/ai) --> ## Steps to reproduce 1. Create a taxonomy vocabulary with a term whose name contains an ampersand, e.g. `Kids, Youth & Family`. 2. Add an entity reference (taxonomy) field to a content type and configure an AI Automator on it (Direct/"Taxonomy" rule), without "auto create" enabled. 3. Create/edit a node so the automator runs and the LLM selects that term. 4. Observe the LLM response value comes back HTML-encoded as `Kids, Youth &amp; Family`. ## Expected result The automator matches `Kids, Youth &amp; Family` to the existing term `Kids, Youth & Family` and fills the field with the correct term reference. ## Actual result `verifyValue()` performs `in_array($value, $values)` against the raw term names (`getTaxonomyList()` returns `$term->name`, i.e. the literal `&`). Since `"Kids, Youth &amp; Family" !== "Kids, Youth & Family"`, the value is removed in `AiAutomatorRuleRunner::generateResponse()` (`unset($values[$key])`) and the field is left empty. No error is shown to the user. `storeValues()` in the same class has the identical exact-match issue (`if ($value == $name)`), so even if verification passed, the tid lookup would fail to resolve the encoded value. ## Environment Drupal version: 10.6.11 Module version: 1.4.1 PHP version: 8.3 Provider: OpenAI Last known working version: 1.3.5 No watchdog entry is generated — the value is silently dropped, which makes this hard to diagnose without stepping through AiAutomatorRuleRunner::generateResponse(). <!-- If this issue description was significantly AI-generated (entire sections, not autocomplete), please note it in a comment below. See https://www.drupal.org/docs/develop/issues/issue-procedures-and-etiquette/policy-on-the-use-of-ai-when-contributing-to-drupal --> <!-- If you discover this is a duplicate of an existing issue, use: /duplicate #<issue> --> <!-- Component — uncomment the line(s) that apply (remove the surrounding comment markers):-->
issue