Skip to content

chore(fix-sentry): add skip-list for cross-session dedup and refine triage rules#1785

Merged
piorpua merged 2 commits intomainfrom
chore/fix-sentry-skip-list-and-triage
Mar 29, 2026
Merged

chore(fix-sentry): add skip-list for cross-session dedup and refine triage rules#1785
piorpua merged 2 commits intomainfrom
chore/fix-sentry-skip-list-and-triage

Conversation

@kaizhou-lab
Copy link
Copy Markdown
Collaborator

Summary

  • Skip-list mechanism: daemon mode sessions now persist triaged issues to ~/.aionui-fix-sentry/skip-list.json with TTL-based expiration, so subsequent sessions skip previously analyzed issues instead of re-triaging them every cycle
  • Triage rule refinement: SingletonCookie/SingletonLock errors are no longer unconditionally skipped — when Seer actionability ≥ medium and root cause is a missing userData directory, they're reclassified as defensive fixes

Motivation

Daemon log analysis showed each session re-analyzing the same ~15 issues (ELECTRON-6X, ELECTRON-A7, etc.) before finding new work. 7 sessions × 15 issues = ~100 redundant Sentry API calls and triage cycles. The skip-list eliminates this overhead.

Changes

File Change
.claude/skills/fix-sentry/SKILL.md Add Step 1.1b (load skip-list) and Step 3.1 (update skip-list)
.claude/skills/fix-sentry/references/triage-rules.md Add exception for SingletonCookie with actionable root cause

Test plan

  • Run /fix-sentry limit=1 — verify skip-list.json is created after session
  • Run a second /fix-sentry limit=1 — verify cached issues are skipped immediately
  • Verify expired entries are re-analyzed after TTL passes
  • Verify batch mode (/fix-sentry) ignores skip-list

…riage rules

- Add Step 1.1b (Load Skip List): daemon mode reads ~/.aionui-fix-sentry/skip-list.json
  to skip previously triaged issues, with TTL-based expiration per classification
- Add Step 3.1 (Update Skip List): writes skipped issues back with appropriate TTLs
  (system_level: 7d, already_fixed: 48h, unfixable: 24h, fix_pending_merge: 12h)
- Refine SingletonCookie/SingletonLock triage: reclassify as defensive fix when
  Seer actionability >= medium and root cause is missing userData directory
- Clean up orphan worktrees on daemon startup (loop + prune)
- Replace `kill 0` trap with dedicated cleanup function that:
  - Removes current worktree (with rm -rf fallback)
  - Runs git worktree prune
  - Kills only child jobs (not entire process group)
  - Outputs a single "Daemon stopped" line (not dozens)
- Track CURRENT_WORKTREE variable to ensure cleanup on signal
- Add rm -rf fallback when git worktree remove --force fails
@piorpua piorpua added the bot:reviewing Review in progress (mutex) label Mar 29, 2026
@piorpua
Copy link
Copy Markdown
Contributor

piorpua commented Mar 29, 2026

Code Review:chore(fix-sentry): add skip-list for cross-session dedup and refine triage rules (#1785)

变更概述

本 PR 为 fix-sentry daemon 新增了两项改进:(1)跨 session 的 skip-list 机制,避免重复分析已处理过的 Sentry issue;(2)对 SingletonCookie/SingletonLock 错误增加例外规则,允许在根因为缺少目录时作为 Defensive fix 处理。同时修复了 daemon 脚本中 worktree 泄漏的问题。


方案评估

结论:✅ 方案合理

Skip-list 机制通过 TTL-based JSON 文件解决了 daemon 日志中每 session 重复分析约 15 个 issue(7 sessions × 15 issues ≈ 100 次冗余 API 调用)的实际问题,设计简单有效。TTL 按分类分级(system_level 7d、already_fixed 48h、unfixable 24h、fix_pending_merge 12h)的设计合理,平衡了缓存效果与新鲜度。daemon 脚本的 cleanup() 函数和 orphan worktree 清理是正确的防御性改进。triage rule 的异常处理精确限定了条件(Seer actionability ≥ medium + 缺少目录),无过度放宽风险。


问题清单

🔵 LOW — Step 1.1b 未说明目录不存在时的创建行为

文件.claude/skills/fix-sentry/SKILL.md,Step 1.1b,On load 第 1 条

问题说明:仅说明文件不存在时从空列表开始,但未说明应先 mkdir -p ~/.aionui-fix-sentry/。若有人在 daemon 脚本之外直接调用 limit=1 模式,目录尚未创建,写入 skip-list 时会失败。

修复建议:在 On load 第 1 条补充:

1. Ensure `~/.aionui-fix-sentry/` directory exists (`mkdir -p`)
2. Read the file (if it doesn't exist, start with an empty skip list)

汇总

# 严重级别 文件 问题
1 🔵 LOW SKILL.md: Step 1.1b (On load item 1) skip-list 写入前未说明创建目录

结论

批准合并 — 无阻塞性问题,代码质量良好。skip-list 机制设计清晰,daemon 脚本的 worktree 泄漏修复正确,唯一问题为文档中的 LOW 级遗漏,不影响功能。


本报告由本地 pr-review skill 生成,包含完整项目上下文,无截断限制。

@piorpua
Copy link
Copy Markdown
Contributor

piorpua commented Mar 29, 2026

✅ 已自动 review,无阻塞性问题,正在触发自动合并。

@piorpua piorpua merged commit 510bec5 into main Mar 29, 2026
17 checks passed
@piorpua piorpua deleted the chore/fix-sentry-skip-list-and-triage branch March 29, 2026 05:44
@piorpua piorpua added bot:done Auto-merged by bot and removed bot:reviewing Review in progress (mutex) labels Mar 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot:done Auto-merged by bot

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants