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:
- Query PR comments for bot-authored entries within last 2-5 minutes
- If found, edit the existing comment instead of creating a new one
- 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
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.tsscript has no deduplication logic. It callsoctokit.issues.createComment()every time, even if: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:
Impact
Creates noise and PR comment spam when CI is unstable or when automated agents (like Copilot) push multiple fix attempts in quick succession.