Skip AI verification when multiple price candidates exist

When the scraper finds multiple valid prices (e.g., Amazon main price +
other sellers), skip AI verification entirely. AI was "correcting"
valid alternative prices to the main buy box price.

Now with multiple candidates, users see all options in the modal and
choose themselves - no AI interference.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
clucraft 2026-01-24 19:23:04 -05:00
parent 3a3291a779
commit 6327fd6cf1

View file

@ -1637,7 +1637,10 @@ export async function scrapeProductWithVoting(
}
// If we have a price but AI is available, verify it
if (result.price && userId && html && !result.aiStatus) {
// SKIP verification if we have multiple candidates - let user choose from modal instead
// This prevents AI from "correcting" valid alternative prices (e.g., other sellers on Amazon)
const hasMultipleCandidates = allCandidates.length > 1;
if (result.price && userId && html && !result.aiStatus && !hasMultipleCandidates) {
try {
const { tryAIVerification } = await import('./ai-extractor');
const verifyResult = await tryAIVerification(