Skip to content

Bug: CI Coach has no deduplication—posts duplicate comments on every workflow failure #288

@Jenp-AICraftWorks

Description

@Jenp-AICraftWorks

Problem

CI Coach posts redundant comments on PRs when TypeScript CI fails repeatedly, with no deduplication logic.

Root Cause

The workflow triggers on both push and pull_request events. When code fails, two parallel TypeScript CI runs complete and both trigger CI Coach. The script always calls octokit.issues.createComment() without checking for:

  • Existing recent comments from the bot on the PR
  • Duplicate analysis of the same failure
  • Analyzed run IDs

Impact

Users see comment spam like this on PR #111 in AgentCraftworks-CE: 12 identical "No Specific Pattern Detected" comments in rapid bursts.

Suggested Fix

Add deduplication:

  1. Check for existing CI Coach comments on the PR posted in the last 5 minutes
  2. Skip if a duplicate exists
  3. OR: Edit the most recent comment instead of creating a new one
  4. Track analyzed run IDs to prevent re-analysis

Example Reproduction

Push failing code to a PR branch with 2+ commits. Watch CI Coach flood the PR with duplicate comments.


Source Context: This workflow is used in https://github.com/AgentCraftworks/AgentCraftworks-CE and other repos.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions