Skip to content

Bug: pulse dispatches workers for duplicate issues when feature already merged #6419

@superdav42

Description

@superdav42

Observed behaviour

The pulse created 6 duplicate issues for the same feature (universal tax fallback) on the same day:

PR #456 merged and closed #455. The pulse then dispatched a worker against #468 (still OPEN, status:queued). The worker correctly detected the work was done and closed the issue — but only after being dispatched unnecessarily.

Root cause

Two gaps:

Gap 1 — No deduplication at issue creation time. Before gh issue create, there is no check for existing issues with similar titles. If issue-sync runs multiple times (or multiple workers each create their own issue), duplicates accumulate.

Gap 2 — Dispatch checks OPEN state but not related merged PRs. The pulse correctly skips CLOSED issues. But it does not check whether a merged PR already implements the same feature. A duplicate issue that was never linked to the merged PR stays OPEN and gets dispatched.

Proposed fixes

  1. Issue creation dedup: before gh issue create in issue-sync-helper.sh and claim-task-id.sh, run gh issue list --search "<title keywords>" --state all and skip creation if a semantically similar issue exists (open or recently closed).

  2. Pre-dispatch merged-PR check: in the pulse dispatch step, before assigning a worker, search for merged PRs that reference the issue's task keywords. If found, close the duplicate issue with a comment pointing to the merged PR instead of dispatching.

  3. Single-issue-per-task enforcement: claim-task-id.sh should store the GH issue number atomically alongside the task ID claim, preventing a second claim from creating a second issue for the same task ID.

Evidence

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions