[AgenticChat] Agentic chat does not escape user prompt which leads to a broken UI

Problem to solve

Agentic chat's user prompts don't escape angle bracket characters which allow users to enter arbitrary HTML and in turn that breaks the user messages bubbles in chat.

When users enter prompts containing HTML characters (such as < and >), these characters are not properly escaped. This allows arbitrary HTML to be rendered in the chat interface, breaking the layout and appearance of user message bubbles.

Screenshots or videos

unexpected_markdown_rendering.mov

Potential solution

Escape < and > using lodash's escape utility to disallow arbitrary HTML in user messages. User can still enter Markdown which will allow them to format text and insert code blocks in a prompt.

Edited by 🤖 GitLab Bot 🤖