fix: corregir pipeline de validación de pagos

- GeminiVisionService: eliminar thinkingConfig (rompe modelos flash),
  reducir maxOutputTokens 8192→512, timeout 20→40s, default gemini-2.0-flash
- PublicChat: detectar correctamente errores de Gemini (__error/__parse_error)
  que antes pasaban el guard if(!$datosPago) por ser arrays truthy
- PagoValidadorService: tolerancia de hora 0→3 min, remitente >=2→>=1 palabra
- CorreoImapService: break→continue en correos fuera de ventana (IMAP no
  garantiza orden cronológico), fetchSize *4→*2 para evitar timeout

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Lizandro
2026-07-31 05:00:23 +00:00
co-authored by Claude Sonnet 4.6
parent fc17e57624
commit d88f67ab5b
4 changed files with 13 additions and 11 deletions
+3 -3
View File
@@ -51,7 +51,7 @@ class CorreoImapService
}
// Descargar un lote suficiente para cubrir la ventana de tiempo.
$fetchSize = min($total, max($limit * 4, 20));
$fetchSize = min($total, max($limit * 2, 20));
$from = max(1, $total - $fetchSize + 1);
$set = "{$from}:{$total}";
@@ -67,9 +67,9 @@ class CorreoImapService
foreach ($emails as $email) {
$ts = $email['date'] ? @strtotime($email['date']) : false;
// Correo más antiguo que la ventana → parar
// Correo más antiguo que la ventana → saltar (no parar, pueden haber más nuevos)
if ($ts !== false && $ts < $cutoff) {
break;
continue;
}
$result[] = $email;