First user message is always interpreted as plain text

This commit is contained in:
Alex Gleason committed 2025-12-20 20:55:54 -06:00
1 parent d4dc0d54c4
commit 3d3d35be40
3 files changed
+7 -163

No files matched your search

+7 -1
View File
@@ -20,9 +20,15 @@ export function UserMessage({ content }: UserMessageProps) {
// Process each content part and categorize as text or file
const processedParts: Array<{ type: 'text' | 'file'; content: string; filepath?: string }> = [];
contentParts.forEach(part => {
contentParts.forEach((part, index) => {
const text = part.text.trim();
// First content part is always treated as text
if (index === 0) {
processedParts.push({ type: 'text', content: text });
return;
}
// Matches the pattern anywhere in the text
// Regular expression to match "Added file: <filename>" patterns
const filePattern = /^Added file: (\/[^\s\n]+$)/g;