refactor(scene-fusion): always run agent subject detection for prompt enrichment
Some checks failed
Lint / build (20) (push) Has been cancelled
Playwright Tests / test (push) Has been cancelled

This commit is contained in:
Your Name 2026-03-05 21:23:01 +08:00
parent cd451c8f9a
commit d2070d93e1

View File

@ -289,19 +289,21 @@ async function enrichSceneLabelsWithAgent(params: {
})), })),
}; };
if (!resolvedProductName) { try {
try { const productDetected = await detectProductNameWithAgent(params.productImageUrl);
const productDetected = await detectProductNameWithAgent(params.productImageUrl); if (productDetected?.name) {
if (productDetected?.name) { if (!resolvedProductName) {
resolvedProductName = productDetected.name; resolvedProductName = productDetected.name;
meta.productName = productDetected.name;
meta.productSource = "agent"; meta.productSource = "agent";
meta.productConfidence = productDetected.confidence; } else {
meta.productModel = productDetected.model; meta.productSource = "user";
} }
} catch (error) { meta.productName = resolvedProductName || productDetected.name;
console.warn(`[SceneFusion][${params.requestId}] Product detect skipped:`, error); meta.productConfidence = productDetected.confidence;
meta.productModel = productDetected.model;
} }
} catch (error) {
console.warn(`[SceneFusion][${params.requestId}] Product detect skipped:`, error);
} }
const unresolvedIndexes = clonedScenes const unresolvedIndexes = clonedScenes