Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fix(issue-monster): gracefully skip agent availability errors with ignore-if-error #40716
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
Uh oh!
There was an error while loading. Please reload this page.
fix(issue-monster): gracefully skip agent availability errors with ignore-if-error #40716
Changes from all commits
20217ed34de40bc4d0119e2159abFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.
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.
ignore-if-error: truepermanently silences ALL availability errors — including permanent misconfiguration — not just transient ones.💡 Details
The inline comment reads "temporarily unavailable", but the flag has no retry budget, expiry, or transience check. Any of these permanent conditions will be silently swallowed on every 30-minute schedule run forever:
agent-tasks:write(if that check happens at assignment time)Operators will only see
⏭️ Skippedin workflow summaries with no actionable signal that assignments have been broken indefinitely. The original behaviour (failure issue creation) was noisy, but this pendulum swings all the way to silent — there is no middle ground here.Consider pairing this with a periodic health-check step (e.g. a separate job that calls
getAvailableAgentLoginsand creates a single de-duplicated alert issue when the result is empty for N consecutive runs), or at minimum document the operational consequence more explicitly.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.
[/diagnose] The string
"coding agent is not available for this repository"appears in two places in this file: here as a matcher (line 396) and at line ~335 as the synthesised error message. If one drifts, the availability guard silently stops firing.💡 Suggested fix: extract to a module-level constant
This removes the implicit string contract between the two sites and makes future edits safe.
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.
Graceful-skip path still emits
core.error(...)fromfindAgent, creating misleading error-level workflow annotations.💡 Details and suggested fix
When
findAgentreturnsnullbecausecheckUserCanBeAssignedthrows 404, it logs:before returning
null. Control only reaches the newignoreIfError && isAvailabilityErrorguard here after that error-level log has already been emitted.Operators reviewing workflow runs will see a red error annotation even though the operation was intentionally skipped — the opposite of "graceful". If any monitoring alerts on
core.erroroutput, this will fire on every scheduled issue-monster run when Copilot is unavailable.The cleanest fix is to downgrade the
core.errorcall infindAgent(inassign_agent_helpers.cjs) tocore.debugorcore.warningfor non-auth errors, and letassign_to_agent.cjsdecide how to escalate based onignoreIfError. Alternatively, pass anoptionsflag tofindAgentto suppress the error log when the caller knows it will handle the null gracefully.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.
[/tdd] The comment says "Simulate agent not available (checkUserCanBeAssigned returns 404)" but the actual
isAvailabilityErrortrigger is thenew Error(\${agentName} coding agent is not available...`)thrown bymainafterfindAgent` returns null. The 404 is correct as the upstream cause, but the indirection makes the test harder to follow.💡 Suggested comment improvement
Also note: if the thrown error message at line ~335 is ever changed, this test would still pass (because it mocks at the API layer), masking the regression. A complementary unit test for
findAgentreturning null → correct error message could provide an extra safety net.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.
[/tdd] The new test verifies that availability errors are silently skipped when
ignoreIfError=true. The complementary path — availability error withoutignoreIfErrorset — has no dedicated test. The existing failure test (line ~1145) usesIGNORE_IF_MISSINGand a"Network timeout"error, so the enrichment branch at lines 406–413 (listing available agents in the error message) is also untested.💡 Suggested additional test case
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.