docs: #19 工具链事件中枢上下文四层改造方案 #2

Closed
pangtong-fujunshi wants to merge 33 commits from docs/19-toolchain-context-layers into main
Showing only changes of commit 5010ff7db1 - Show all commits
+2 -1
View File
@@ -74,7 +74,8 @@ def _is_duplicate(event: str, delivery: str, payload: Optional[Dict[str, Any]] =
review = payload.get("review", {})
# 取 body 或 content,优先 bodywebhookNotifier 格式)
content = review.get("body", "") or review.get("content", "")
content_key = f"content:{event}:{pr_num}:{sender}:{content}"
content_hash = hashlib.sha256(content.encode()).hexdigest()[:16]
content_key = f"content:{event}:{pr_num}:{sender}:{content_hash}"
if content_key in _delivery_cache:
logger.info("Content-based duplicate detected: %s PR#%s by %s", event, pr_num, sender)
return True