-
Notifications
You must be signed in to change notification settings - Fork 1
fix: Prevent duplicate follow-up issues and handle rate limits #726
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -173,7 +173,17 @@ jobs: | |||||||||||||||||||||||||||||||||||||||
| script: | | ||||||||||||||||||||||||||||||||||||||||
| const { buildVerifierContext } = require('./.workflows-lib/.github/scripts/agents_verifier_context.js'); | ||||||||||||||||||||||||||||||||||||||||
| const ciWorkflows = process.env.CI_WORKFLOWS || '[]'; | ||||||||||||||||||||||||||||||||||||||||
| await buildVerifierContext({ github, context, core, ciWorkflows }); | ||||||||||||||||||||||||||||||||||||||||
| try { | ||||||||||||||||||||||||||||||||||||||||
| await buildVerifierContext({ github, context, core, ciWorkflows }); | ||||||||||||||||||||||||||||||||||||||||
| } catch (err) { | ||||||||||||||||||||||||||||||||||||||||
| if (err.message && err.message.includes('rate limit')) { | ||||||||||||||||||||||||||||||||||||||||
| core.warning(`Rate limited while building context: ${err.message}`); | ||||||||||||||||||||||||||||||||||||||||
| core.setOutput('should_run', 'false'); | ||||||||||||||||||||||||||||||||||||||||
| core.setOutput('skip_reason', 'Rate limited - please retry later'); | ||||||||||||||||||||||||||||||||||||||||
| } else { | ||||||||||||||||||||||||||||||||||||||||
| throw err; | ||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+179
to
+184
|
||||||||||||||||||||||||||||||||||||||||
| if (err.message && err.message.includes('rate limit')) { | |
| core.warning(`Rate limited while building context: ${err.message}`); | |
| core.setOutput('should_run', 'false'); | |
| core.setOutput('skip_reason', 'Rate limited - please retry later'); | |
| } else { | |
| throw err; | |
| if (err && err.message && err.message.includes('rate limit')) { | |
| core.warning(`Rate limited while building context: ${err.message}`); | |
| core.setOutput('should_run', 'false'); | |
| core.setOutput('skip_reason', 'Rate limited - please retry later'); | |
| } else { | |
| // Treat other unexpected/transient errors gracefully by skipping the verifier | |
| const message = (err && err.message) ? err.message : String(err); | |
| core.error(`Error while building verifier context: ${message}`); | |
| if (err && err.stack) { | |
| console.error(err.stack); | |
| } | |
| core.setOutput('should_run', 'false'); | |
| core.setOutput('skip_reason', `Error while building context: ${message}`); |
Copilot
AI
Jan 10, 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.
The new rate limit handling logic in this workflow lacks test coverage. The codebase has comprehensive test coverage for rate limit handling in other areas (as evidenced by tests in error-classifier.test.js, github-api-retry.test.js, and keepalive-loop.test.js), but there are no tests verifying that this specific try-catch block correctly handles rate limit errors and sets the appropriate outputs. Consider adding tests to verify the behavior when a rate limit error is thrown by buildVerifierContext.
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.
The rate limit detection logic is too broad and may catch unrelated errors. The check
err.message.includes('rate limit')will match any error message containing these words, including potentially unrelated errors. Based on the codebase's error handling patterns (found in api-helpers.js and error_classifier.js), rate limit errors typically have more specific characteristics such as HTTP status codes (403, 429) and specific error messages from GitHub's API. Consider checking for more specific patterns like checking the error status code or using a more precise message pattern.