Skip to content

Commit 6327fd6

Browse files
clucraftclaude
andcommitted
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>
1 parent 3a3291a commit 6327fd6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

backend/src/services/scraper.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1637,7 +1637,10 @@ export async function scrapeProductWithVoting(
16371637
}
16381638

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

0 commit comments

Comments
 (0)