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:
- Check for existing CI Coach comments on the PR posted in the last 5 minutes
- Skip if a duplicate exists
- OR: Edit the most recent comment instead of creating a new one
- 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.
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:
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:
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.