Fix duplicate deep chat intro message after clearing history on front-end themes
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3517604. --> Reported by: [rajab natshah](https://www.drupal.org/user/1414312) Related to !544 >>> <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>When clearing history, the deep chat intro message appears twice when used with front-end themes.</p> <p><strong>Before the fix:</strong><br> <a href="https://www.drupal.org/files/issues/2025-04-06/kb-helper-before-04-06-2025_06_50_PM.png"><img src="https://www.drupal.org/files/issues/2025-04-06/kb-helper-before-04-06-2025_06_50_PM.png" alt="" width="250px"></a></p> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <p>Remove</p> <pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; deepchatElement.addMessage({<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; role: 'assistant',<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; text: drupalSettings.ai_deepchat.first_message,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; });</pre><p> When the deep chat intro is the same as the first_message</p> <h3 id="summary-remaining-tasks">Remaining tasks</h3> <h3 id="summary-ui-changes">User interface changes</h3> <p><strong>After the fix:</strong><br> <a href="https://www.drupal.org/files/issues/2025-04-06/kb-helper-after-04-06-2025_06_52_PM.png"><img src="https://www.drupal.org/files/issues/2025-04-06/kb-helper-after-04-06-2025_06_52_PM.png" alt="" width="250px"></a></p> <h3 id="summary-api-changes">API changes</h3> <h3 id="summary-data-model-changes">Data model changes</h3>
issue