Skip to content

Commit e8da859

Browse files
Remove markdown from chat names (#1738)
<!-- Ensure the title clearly reflects what was changed. Provide a clear and concise description of the changes made. The PR should only contain the changes related to the issue, and no other unrelated changes. --> Fixes OPS-3202
1 parent 10985cf commit e8da859

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

packages/server/api/src/app/ai/chat/ai-mcp-chat.controller.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import {
2525
import { ModelMessage, UserModelMessage } from 'ai';
2626
import { FastifyReply } from 'fastify';
2727
import { StatusCodes } from 'http-status-codes';
28+
import removeMarkdown from 'markdown-to-text';
2829
import {
2930
createChatContext,
3031
deleteChatHistory,
@@ -263,7 +264,7 @@ export const aiMCPChatController: FastifyPluginAsyncTypebox = async (app) => {
263264
}
264265

265266
const rawChatName = await generateChatName(userMessages, projectId);
266-
const chatName = rawChatName.trim() || DEFAULT_CHAT_NAME;
267+
const chatName = removeMarkdown(rawChatName).trim() || DEFAULT_CHAT_NAME;
267268

268269
await updateChatName(chatId, userId, projectId, chatName);
269270

0 commit comments

Comments
 (0)