Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 67 additions & 1 deletion .github/workflows/issue-monster.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 34 additions & 0 deletions .github/workflows/issue-monster.md
Original file line number Diff line number Diff line change
Expand Up @@ -298,9 +298,30 @@ on:
}
return null;
};
// Cookie-labeled issues are auto-generated backlog tasks. Keep only the
// newest open issue for an exact normalized topic so superseded reports
// do not consume another agent assignment.
const latestAutoGeneratedIssueByTopic = new Map();
for (const issue of issuesWithDetails) {
const labels = issue.labels.map(label => label.name.toLowerCase());
if (!labels.includes('cookie')) continue;
const topic = normalizeTopic(issue.title);
if (topic.length < MIN_TOPIC_LENGTH) continue;
const latest = latestAutoGeneratedIssueByTopic.get(topic);
if (!latest || new Date(issue.created_at) > new Date(latest.created_at)) {
latestAutoGeneratedIssueByTopic.set(topic, issue);
}
}
const findSupersedingIssue = (issue) => {
const topic = normalizeTopic(issue.title);
if (topic.length < MIN_TOPIC_LENGTH) return null;
const latest = latestAutoGeneratedIssueByTopic.get(topic);
return latest?.number !== issue.number ? latest : null;
};

// Filter and score issues
const retryBlockedIssues = [];
const supersededIssues = [];
const scoredIssues = issuesWithDetails
.filter(issue => {
// Exclude issues that already have assignees
Expand Down Expand Up @@ -346,6 +367,15 @@ on:
return false;
}

// Do not auto-queue stale generated backlog tasks when a newer
// open issue already covers the same normalized topic.
const supersedingIssue = findSupersedingIssue(issue);
if (supersedingIssue) {
core.info(`Skipping #${issue.number}: superseded by newer auto-generated issue #${supersedingIssue.number}`);
supersededIssues.push({ number: issue.number, supersedingNumber: supersedingIssue.number });
return false;
}

// Block topics that Copilot already attempted twice or more without a merge.
// These require human review before another agent session is spent.
const retryBlock = findRetryBlock(issue.title);
Expand Down Expand Up @@ -437,6 +467,9 @@ on:
if (retryBlockedIssues.length > 0) {
core.warning(`🛑 ${retryBlockedIssues.length} issue(s) were retry-blocked and excluded from assignment:\n${retryBlockedList}`);
}
if (supersededIssues.length > 0) {
core.info(`Staleness pre-flight: ${supersededIssues.length} auto-generated issue(s) were superseded and excluded: ${supersededIssues.map(i => `#${i.number}→#${i.supersedingNumber}`).join(', ')}`);
}

core.setOutput('issue_count', scoredIssues.length);
core.setOutput('issue_numbers', issueNumbers);
Expand Down Expand Up @@ -556,6 +589,7 @@ The issue search has already been performed in the pre-activation job with smart
- ✅ Excluded issues that have sub-issues (parent/organizing issues)
- ✅ Excluded issues with closed or merged PRs (treating those as complete)
- ✅ Excluded issues with open PRs from Copilot coding agent (already being worked on)
- ✅ Excluded stale auto-generated backlog issues when a newer open issue has the same normalized topic
- 🛑 Excluded **retry-blocked topics**: issues whose normalized title matches two or more Copilot PRs that were closed without merging
- ✅ Prioritized issues with labels: good-first-issue, bug, security, documentation, enhancement, feature, performance, tech-debt, refactoring

Expand Down
Loading
Loading