fix(review): 批注去重 + 删除残留调试截图

- annotator.annotate:同一 handle 只批注一次(修复 created 无去重的既有 gap,
  同 handle 出现两次不再产生重复引线)
- 删除 test_screenshot.png(已删除脚本 test_autoagent.py 的残留产物)
This commit is contained in:
gjm committed 2026-10-14 19:53:41 +08:00
1 parent f7fa8f14d9
commit 81d8c3d2ca
3 files changed
+8 -7

No files matched your search

+3 -3
View File
@@ -36,11 +36,13 @@ def annotate(ctx, issues, *, dry_run=False, log=print):
"""按问题列表回写批注,返回 (created, highlighted) 两个 handle 列表。"""
created = []
highlighted = []
seen = set() # 同一 handle 只处理一次,避免重复批注
for issue in issues:
handle = issue.get("handle")
if not handle:
if not handle or handle in seen:
continue
seen.add(handle)
text = f"[{issue.get('severity', '?')}] {issue.get('message', '')}"
@@ -81,8 +83,6 @@ def annotate(ctx, issues, *, dry_run=False, log=print):
continue
# 引线建好后再高亮原实体(失败不影响已创建的批注)
if handle in highlighted:
continue
try:
ctx.tools.call("highlight_entities", {"handle": handle, "color": 1})
highlighted.append(handle)