Unable to override the 'An error occurred while fetching messages' text
<!-- Please search existing work items before filing to avoid duplicates. --> <!-- Also check open feature request work items to avoid duplicating existing proposals. --> ## Summary The deepchat conversational UI displays hardcoded text — "An error occurred while fetching messages. Please try again." — when an error is caught while polling for additional messages in `getAllMessages()` (see `modules/ai_chatbot/js/deepchat-init.js`, the `.catch()` block). Site administrators cannot customize this language to match their product voice, branding, or support workflow (for example, "Something went wrong contacting our assistant — please retry, or contact support if the problem persists."). ## Problem ### Steps to reproduce * Configure the ai_chatbot module with an assistant that delegates to agents (so that `getAllMessages()` is invoked). * Trigger an error during agent polling (e.g. server returns a non-2xx response or a network failure occurs). **Expected result** Site administrators can customize the error response text to suit their needs. **Actual result** The hardcoded text "An error occurred while fetching messages. Please try again." is shown with no override capability. ## Proposed solution *(optional)* Add a new block configuration setting called "Error Message" (config key `error_message`) to the DeepChatFormBlock, alongside the existing "Loading Message" and "Agent Delegation Message" settings in the Messages section. Pass it through to JS via `drupalSettings.ai_deepchat.error_message`, and use it as an override in the `.catch()` handler of `getAllMessages()`. Default behaviour is unchanged when the field is left blank. ## Workaround *(optional)* None. In our case, we're experiencing timeouts on some long running requests, like a huge LLM RAG summary response. We'd like this failure case to be friendlier, encouraging the user to try a narrower scope of query. ## Affected modules / components *(optional)* ai_chatbot ai_agents AI was used to draft this issue summary. It has been fully reviewed by myself and I submit to its accuracy.
issue