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 <noreply@anthropic.com>
This commit is contained in:
admin
2026-02-23 22:37:38 -05:00
parent 5cfb136484
commit 3d01085b10

View File

@@ -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,9 +451,10 @@ 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
});
@@ -461,9 +462,9 @@ export const documentController = {
const result = await unifiedDocumentProcessor.processDocument(
documentId,
userId,
'', // Text is not needed for this strategy
'', // Text will be extracted from fileBuffer
{
strategy: 'document_ai_agentic_rag',
strategy: activeStrategy,
fileBuffer: fileBuffer,
fileName: document.original_file_name,
mimeType: 'application/pdf'