-
Notifications
You must be signed in to change notification settings - Fork 125
Add rate limiting protection to Issue Monster workflow #14379
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot update issue monster with rate limiting detection to prevent scheduling work when rate limited. Remove other files |
…tor files - Add rate limit check in Issue Monster to prevent scheduling work when rate limited - Check recent Copilot PRs for rate limit indicators before assigning issues - Skip all assignments if rate limiting detected in last hour - Remove standalone rate-limit-pr-detector workflow - Remove docs and skill files for standalone detector - Update Issue Monster documentation to reflect rate limiting protection Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Done! Updated Issue Monster with rate limiting detection and removed standalone detector files. Changes in commit
The workflow now automatically protects against scheduling work during rate limiting events. |
Use full ISO timestamp instead of just date for accurate last-hour filtering Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Format timestamp as YYYY-MM-DDTHH:MM:SSZ without milliseconds Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot merge main recompile |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Adds a pre-flight GitHub API rate-limit detection step to the Issue Monster workflow so it can skip scheduling/assigning work when recent Copilot PR activity indicates rate limiting, reducing cascading failures across scheduled runs.
Changes:
- Add a “recent PR timeline scan” in the
search_issuesjob to detect rate limiting patterns and short-circuit outputs to skip downstream work. - Update the workflow’s embedded instructions/documentation to describe the new rate limiting protection behavior.
- Regenerate the compiled workflow lockfile to reflect the updated workflow source.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| .github/workflows/issue-monster.md | Adds rate-limit detection logic before issue search and documents the new protection behavior. |
| .github/workflows/issue-monster.lock.yml | Updates the compiled/locked workflow to include the new rate-limit detection logic. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| if (rateLimitDetected) break; | ||
| } catch (error) { | ||
| core.warning(`Could not check PR #${pr.number} for rate limiting: ${error.message}`); |
Copilot
AI
Feb 7, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the GraphQL timeline query fails due to rate limiting, this code currently just logs a warning and continues, which can lead to a false “No rate limiting detected” and proceed to perform even more API calls. Consider treating rate-limit-shaped errors (e.g., message contains "rate limit"/"secondary rate limit" or HTTP 429/403 from the error response) as a positive detection and short-circuit the workflow like the comment-body match does.
| core.warning(`Could not check PR #${pr.number} for rate limiting: ${error.message}`); | |
| const errorMessage = (error && error.message) ? error.message : String(error); | |
| const statusCode = (error && (error.status || (error.response && error.response.status))) || undefined; | |
| const rateLimitErrorPattern = /rate limit|secondary rate limit/i; | |
| const isRateLimitError = | |
| (errorMessage && rateLimitErrorPattern.test(errorMessage)) || | |
| statusCode === 429 || | |
| statusCode === 403; | |
| if (isRateLimitError) { | |
| core.warning(`Rate limiting detected while checking PR #${pr.number}: ${errorMessage}`); | |
| rateLimitDetected = true; | |
| break; | |
| } else { | |
| core.warning(`Could not check PR #${pr.number} for rate limiting: ${errorMessage}`); | |
| } |
|
|
||
| for (const comment of comments) { | ||
| if (comment.body && rateLimitPattern.test(comment.body)) { | ||
| core.warning(`Rate limiting detected in PR #${pr.number}: ${comment.body.substring(0, 200)}`); |
Copilot
AI
Feb 7, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Logging a substring of comment.body into workflow logs can leak unrelated or sensitive content from PR comments if the regex matches something incidental (e.g., a user mentioning “429”). Safer approach: log only that a match occurred (PR number + comment timestamp/URL), or redact/sanitize the body before emitting it.
| core.warning(`Rate limiting detected in PR #${pr.number}: ${comment.body.substring(0, 200)}`); | |
| const commentTimestampInfo = comment.createdAt ? ` at comment createdAt=${comment.createdAt}` : ''; | |
| core.warning(`Rate limiting indicator detected in PR #${pr.number}${commentTimestampInfo}.`); |
…etect-rate-limited-prs # Conflicts: # .github/workflows/issue-monster.lock.yml
- Merged main branch - Recompiled all workflows with updated configurations - Issue Monster schedule: every 10m -> every 30m - Issue Monster skip-if-match max: 9 -> 5 - Added mood.md import from main branch Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Done! Merged main and recompiled all workflows in commit Changes:
|
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.