Skip to content

Add post-script dedup guard for concurrent retro proposals #848

Description

@guyoron1

What happened

23 empty workspace-update PRs (from a batch force=true workflow dispatch) were closed on 2026-07-24. This triggered 23 concurrent retro agent runs on redhat-developer/rhdh-plugin-export-overlays. At least 5 of these retros independently identified the same improvement ("add empty-diff guard to PR creation") and filed nearly identical issues within a 2-minute window: #2903, #2905, #2906, #2907, #2908 (all created 14:43–14:45 UTC by fullsend-ai-retro[bot]).

What could go better

Each retro agent performs a GitHub issue search to check for duplicates before proposing — but when many retros run concurrently on similar PRs, this check races: retro A searches, finds nothing, and files issue X; retro B searches at nearly the same time, also finds nothing (X doesn't exist yet or hasn't been indexed), and files the same issue as X'. The dedup check is necessary but not sufficient when concurrent retros target the same root cause.

This is related to fullsend-ai/fullsend#3426 (retro dedup across backports/cherry-picks), but the trigger pattern is different: fullsend-ai#3426 is about related PRs with a traceable lineage (backport links), while this case involves N independent PRs that happen to share the same root cause with no explicit relationship. The fix for fullsend-ai#3426 (backport-awareness) would not prevent this scenario.

Confidence: High — 5 duplicate issues from 23 concurrent retros is direct, observable evidence. The race window (2 minutes) and identical proposal content confirm this is a timing-based dedup failure, not a search quality issue.

Proposed change

Add a post-filing dedup guard in the retro post-script (the script that creates GitHub issues from retro proposals). Before creating an issue, the post-script should search for issues created in the last 10–15 minutes with substantially similar titles or content targeting the same repo. If a match is found, skip issue creation and instead add a comment on the existing issue noting the additional evidence.

Implementation options (in order of preference):

  1. Post-script lookback search: Before calling gh issue create, query gh api search/issues for issues created by fullsend-ai-retro[bot] in the target repo within the last 15 minutes. Use title similarity (e.g., Levenshtein distance or keyword overlap) to detect near-duplicates. This is the simplest fix and handles the concurrent-filing race regardless of PR relationship.
  2. Advisory lock file: Use a repo-scoped lock (e.g., a lightweight GitHub issue label or a coordination file) so only one retro can file a given proposal class at a time. More complex, but prevents the race entirely.
  3. Batch retro dispatching: When multiple PRs close within a short window (e.g., 5 minutes), batch them into a single retro run that analyzes all PRs together. This is the most thorough fix but requires changes to the dispatch layer.

Validation criteria

The next time a batch of similar PRs triggers concurrent retro runs on the same repo, at most 1 issue should be created per unique proposal. Specifically: if 5+ retros run concurrently and identify the same improvement, only 1 issue should be filed (the others should either skip or add a comment to the first). Verify by monitoring the next batch-close event on redhat-developer/rhdh-plugin-export-overlays or any repo where multiple similar PRs close simultaneously.


Generated by retro agent from redhat-developer/rhdh-plugin-export-overlays#2842

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions