From 3d01085b10ead59015b25a50f693d9d61536eaa0 Mon Sep 17 00:00:00 2001 From: admin Date: Mon, 23 Feb 2026 22:37:38 -0500 Subject: [PATCH] Fix hardcoded processing strategy in document controller The confirmUpload and inline processing paths were hardcoded to 'document_ai_agentic_rag', ignoring the config setting. Now reads from config.processingStrategy so the single-pass processor is actually used when configured. Co-Authored-By: Claude Opus 4.6 --- backend/src/controllers/documentController.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/backend/src/controllers/documentController.ts b/backend/src/controllers/documentController.ts index f513615..280bc99 100644 --- a/backend/src/controllers/documentController.ts +++ b/backend/src/controllers/documentController.ts @@ -217,7 +217,7 @@ export const documentController = { document_id: documentId, user_id: userId, options: { - strategy: 'document_ai_agentic_rag', + strategy: config.processingStrategy || 'single_pass_quality_check', }, max_attempts: 3, }); @@ -451,19 +451,20 @@ export const documentController = { const { unifiedDocumentProcessor } = await import('../services/unifiedDocumentProcessor'); const processingStartTime = Date.now(); + const activeStrategy = config.processingStrategy || 'single_pass_quality_check'; logger.info('Calling unifiedDocumentProcessor.processDocument', { documentId, - strategy: 'document_ai_agentic_rag', + strategy: activeStrategy, fileSize: fileBuffer.length, correlationId }); - + const result = await unifiedDocumentProcessor.processDocument( documentId, userId, - '', // Text is not needed for this strategy - { - strategy: 'document_ai_agentic_rag', + '', // Text will be extracted from fileBuffer + { + strategy: activeStrategy, fileBuffer: fileBuffer, fileName: document.original_file_name, mimeType: 'application/pdf'