Issue #3591379: Strip [SOURCES_USED] marker and markdown from session titles

The [SOURCES_USED] marker from the RAG source relevance system leaks into session titles because parseSourceRelevance() only strips it when sources are non-empty. Additionally, the title generation LLM sometimes returns markdown-formatted text.

Fix adds three layers of protection:

  1. Always strip [SOURCES_USED] from assistantMessage after parseSourceRelevance block.
  2. Strip marker from answer before title generation prompt.
  3. Strip marker from title output, convert markdown to HTML via CommonMark, then strip_tags() for clean plain text.

Closes #3591379

Merge request reports

Loading