Skip to content

Bug: CI Coach creates duplicate comments without deduplication #289

@Jenp-AICraftWorks

Description

@Jenp-AICraftWorks

Issue

CI Coach workflow creates multiple duplicate comments on the same PR when the triggering CI workflow fails multiple times rapidly (e.g., on push vs pull_request event, or when Copilot pushes multiple fix attempts).

Root Cause

The ci-coach.ts script has no deduplication logic. It calls octokit.issues.createComment() every time, even if:

  • A comment was just posted moments ago
  • The same failure pattern was already analyzed
  • The PR already has recent bot comments

Evidence

PR #111 in AgentCraftworks-CE received 12 CI Coach comments in ~4 minutes, all saying "No Specific Pattern Detected" verbatim. Each TypeScript CI failure (push + pull_request) triggered a new comment.

Suggested Fix

Before creating a comment, check for recent existing bot comments:

  1. Query PR comments for bot-authored entries within last 2-5 minutes
  2. If found, edit the existing comment instead of creating a new one
  3. Track analyzed run IDs to skip redundant analyses

Impact

Creates noise and PR comment spam when CI is unstable or when automated agents (like Copilot) push multiple fix attempts in quick succession.


  • Affected workflows: CI Coach (ghaw-ci-coach.yml)
  • Engagement Level: T2 (Advisor)
  • Repos affected: AgentCraftworks-CE, AgentCraftworks

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