Issue Monster: 10m schedule, pre-filter closed/active PRs#14361
Issue Monster: 10m schedule, pre-filter closed/active PRs#14361
Conversation
…mputation Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
.github/workflows/issue-monster.md
Outdated
| skip-if-match: | ||
| query: "is:pr is:open is:draft author:app/copilot-swe-agent" | ||
| max: 9 | ||
| max: 6 |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR updates the “Issue Monster” automation to run more frequently and pre-filter issues more intelligently so the Copilot agent is invoked only for actionable items.
Changes:
- Increased workflow schedule frequency from hourly to every 10 minutes.
- Enhanced the
search_issuesjob to fetch linked PRs via GraphQL timeline events and filter out issues with closed/merged PRs and open Copilot-authored PRs. - Updated agent instructions to reflect the new pre-filtering behavior.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
.github/workflows/issue-monster.md |
Updates schedule, adds GraphQL PR-link extraction + filtering logic, and adjusts agent guidance to rely on pre-filtered results. |
.github/workflows/issue-monster.lock.yml |
Regenerated compiled workflow reflecting the updated schedule and filtering logic. |
Comments suppressed due to low confidence (1)
.github/workflows/issue-monster.md:427
- This line says selected issues are pre-filtered to ensure no open/closed PRs exist, but the current filtering only guarantees no closed/merged PRs and no open Copilot-authored PRs. Please adjust the wording (or expand filtering) so the agent isn’t relying on an invariant that isn’t enforced.
For each selected issue (which has already been pre-filtered to ensure no open/closed PRs exist):
- Read the full issue body and any comments
- Understand what fix is needed
- Identify the files that need to be modified
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| on: | ||
| workflow_dispatch: | ||
| schedule: every 1h | ||
| schedule: every 10m |
There was a problem hiding this comment.
Workflow schedule is now set to every 10m, but the agent instructions later in this file still describe the process as running “every hour”. Please update the instructions to match the new cadence so run behavior and guidance are consistent.
| // Extract linked PRs from timeline | ||
| const timelineItems = issueDetailsResult?.repository?.issue?.timelineItems?.nodes || []; | ||
| linkedPRs = timelineItems | ||
| .filter(item => item?.source?.__typename === 'PullRequest') | ||
| .map(item => ({ | ||
| number: item.source.number, | ||
| state: item.source.state, | ||
| isDraft: item.source.isDraft, | ||
| author: item.source.author?.login | ||
| })); |
There was a problem hiding this comment.
The linked PR extraction only records the PR number/state/author, but doesn’t capture which repository the PR belongs to. CrossReferencedEvent.source can include PRs from other repositories, and PR numbers are not globally unique—so this can incorrectly treat an issue as having a closed/merged PR and skip it. Consider including the PR’s repository (e.g., repository { nameWithOwner } / baseRepository { nameWithOwner } or url) in the GraphQL query and filtering linked PRs to the current ${owner}/${repo} before applying the closed/open PR filters.
| The search job has already performed comprehensive filtering, including: | ||
| - Issues already assigned to Copilot | ||
| - Issues with open PRs linked to them (from any author) | ||
| - Issues with closed/merged PRs (treated as complete) | ||
| - **For "task" or "plan" labeled sub-issues**: Check if any sibling sub-issue (same parent) has an open PR from Copilot |
There was a problem hiding this comment.
This section claims the pre-filtering excludes “issues with open PRs linked to them (from any author)”, but the filtering logic in search_issues only excludes open PRs authored by Copilot (and closed/merged PRs). Please either (a) update the documentation to match the implemented filters, or (b) add a filter for any open linked PRs if that’s the intended behavior.
This issue also appears on line 424 of the same file.
See below for a potential fix:
- Issues with open PRs from Copilot linked to them
- Issues with closed/merged PRs (treated as complete)
- **For "task" or "plan" labeled sub-issues**: Check if any sibling sub-issue (same parent) has an open PR from Copilot, and skip the current issue when such a PR exists
The list you receive has already been filtered to exclude all of these cases, so you can focus on the actual assignment logic.
### 3. Select Up to Three Issues to Work On
From the prioritized and filtered list (issues WITHOUT Copilot assignments or open Copilot-authored PRs):
Issue Monster now runs every 10 minutes (was 1h) and skips issues with closed/merged PRs or existing Copilot PRs before agent invocation.
Changes
Schedule & Concurrency
every 1h→every 10m9(unchanged)Pre-Computation Filtering
Enhanced
search_issuesjob with GraphQL timeline query to fetch linked PRs and filter before agent runs:Agent Instructions
Simplified agent steps to reflect pre-filtered data—no need to check PR status in agent code.
Impact
Agent only invoked for actionable issues. Issues with closed PRs automatically treated as complete. Prevents duplicate work on issues already being handled by Copilot.
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.