fix(dedup): check_duplicate支持exclude_video_id,修复recompute自匹配 (#1702) #1706
Reference in New Issue
Block a user
Delete Branch "fix/dedup-exclude-self-1702"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Issue #1702 连带修复:recompute 时 check_duplicate 自匹配,duplicate_of 指向自己
PR #1703 + #1705 部署 staging 验证时发现:recompute-dedup 重算的视频已在候选列表中,
check_duplicate遍历候选时把自己也评了分——自匹配汉明距离 0、融合分最高 →is_duplicate=true但duplicate_of指向视频自己。正常生成流程不受影响(新视频记录尚未落库,候选列表里没有自己);
check_batch_duplicate/compute_duplicate_rate本就有current_video_id排除自身逻辑,只有check_duplicate缺这个参数。修复
check_duplicate新增exclude_video_id参数,候选遍历时跳过check_duplicate_task(recompute 入口)与dedup_helpers.create_video_record_and_dedup均传入当前视频 IDRefs #1702
🚀 预览环境已部署
Auto merge skipped after multiple 405 errors: PR may have conflicts or unresolved checks. Please review manually. This is not a CI failure.
e8080015d8to05f832a2eb【阻塞级判定】
📊 审查概览
🔴 阻塞级问题(必须修复)
无
💡 改进建议(不阻塞合并)
无
✅ 良好实践
exclude_video_id参数,有效解决了 recompute 场景下视频自匹配导致duplicate指向自己的逻辑漏洞,修复方案简洁且针对性强。TestCheckDuplicateExcludesSelf覆盖了“不排除时的错误复现”、“排除后返回无匹配”以及“排除后仍能检测到真实重复”三个关键场景,确保了修复的有效性和安全性。check_duplicate_task和create_video_record_and_dedup两个调用点均正确传递了 ID,且类型注解str | None使用得当,符合 Python 3.10+ 规范。🤖 由 AI 代码审查机器人自动生成 | 2026-09-05 01:03:14 | 模型:
🗑️ 预览环境已清理
PR #1706 已关闭或合并,对应的预览环境已被清理。