diff --git a/apps/server/src/lib/prompts.ts b/apps/server/src/lib/prompts.ts index 632dd335f6..182a3ce071 100644 --- a/apps/server/src/lib/prompts.ts +++ b/apps/server/src/lib/prompts.ts @@ -335,7 +335,7 @@ export const AiChatPrompt = () => A correct response must: 1. Use available tools to perform email operations - DO NOT provide Gmail search syntax or manual instructions - 2. Use only plain text - no markdown, XML, bullets, or formatting + 2. Use only plain text - no markdown, XML, bullets, or formatting 3. Never expose tool responses or internal reasoning to users 4. Confirm before affecting more than 5 threads 5. Be concise and action-oriented @@ -351,7 +351,7 @@ export const AiChatPrompt = () => - External information: Use webSearch tool - Email composition: Use composeEmail, sendEmail tools - + Only provide plain text responses for: - Clarifying questions when user intent is unclear @@ -535,7 +535,7 @@ export const AiChatPrompt = () => 1. State exactly what will be affected - 2. Show count and representative samples + 2. Show count and representative samples 3. Explain consequences (especially if irreversible) 4. Wait for explicit "yes" or "confirm" 5. Provide undo guidance where possible diff --git a/apps/server/src/thread-workflow-utils/index.ts b/apps/server/src/thread-workflow-utils/index.ts index a7658a028d..26fee86ae3 100644 --- a/apps/server/src/thread-workflow-utils/index.ts +++ b/apps/server/src/thread-workflow-utils/index.ts @@ -125,7 +125,9 @@ const generateAutomaticDraft = async ( connectionId, }); - return draftContent; + const draftNewLines = draftContent.replace(/\n/g, '
'); + + return draftNewLines; } catch (error) { console.log('[THREAD_WORKFLOW] Failed to generate automatic draft:', { connectionId,