-
Notifications
You must be signed in to change notification settings - Fork 351
fix: skip failure issue when agent exits non-zero after successfully calling noop #23050
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 | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -876,10 +876,10 @@ async function main() { | |||||||||||||||||
| // Check if agent succeeded but produced no safe outputs | ||||||||||||||||||
| let hasMissingSafeOutputs = false; | ||||||||||||||||||
| let hasOnlyNoopOutputs = false; | ||||||||||||||||||
| if (agentConclusion === "success") { | ||||||||||||||||||
| const { loadAgentOutput } = require("./load_agent_output.cjs"); | ||||||||||||||||||
| const agentOutputResult = loadAgentOutput(); | ||||||||||||||||||
| const { loadAgentOutput } = require("./load_agent_output.cjs"); | ||||||||||||||||||
| const agentOutputResult = loadAgentOutput(); | ||||||||||||||||||
|
|
||||||||||||||||||
| if (agentConclusion === "success") { | ||||||||||||||||||
| if (!agentOutputResult.success || !agentOutputResult.items || agentOutputResult.items.length === 0) { | ||||||||||||||||||
| hasMissingSafeOutputs = true; | ||||||||||||||||||
| core.info("Agent succeeded but produced no safe outputs"); | ||||||||||||||||||
|
|
@@ -891,6 +891,18 @@ async function main() { | |||||||||||||||||
| core.info("Agent succeeded with only noop outputs - this is not a failure"); | ||||||||||||||||||
| } | ||||||||||||||||||
| } | ||||||||||||||||||
| } else if (agentConclusion === "failure") { | ||||||||||||||||||
| // The agent may have called noop successfully but the AI model server subsequently | ||||||||||||||||||
| // returned a transient error (e.g. "Response was interrupted due to a server error"), | ||||||||||||||||||
| // causing exit code 1. In that case we should not report a failure issue since the | ||||||||||||||||||
| // agent completed its intended work. | ||||||||||||||||||
| if (agentOutputResult.success && agentOutputResult.items && agentOutputResult.items.length > 0) { | ||||||||||||||||||
| const nonNoopItems = agentOutputResult.items.filter(item => item.type !== "noop"); | ||||||||||||||||||
| if (nonNoopItems.length === 0) { | ||||||||||||||||||
| hasOnlyNoopOutputs = true; | ||||||||||||||||||
| core.info("Agent failed with exit code 1 but produced only noop outputs - treating as successful no-action (transient AI model error)"); | ||||||||||||||||||
| } | ||||||||||||||||||
| } | ||||||||||||||||||
| } | ||||||||||||||||||
|
|
||||||||||||||||||
|
||||||||||||||||||
| // If the agent produced only noop outputs, treat this as a successful no-action scenario | |
| // and skip all failure handling / issue creation even if the job conclusion was "failure". | |
| if (hasOnlyNoopOutputs) { | |
| core.info("Agent produced only noop outputs - skipping failure handling and issue creation."); | |
| return; | |
| } |
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.
loadAgentOutput()is now called unconditionally, even whenagentConclusionis neither "success" nor "failure" (e.g. timed_out/skipped/cancelled). This introduces unnecessary file I/O and extra log noise in those cases. Consider only requiring/loading agent output when it will actually be used (e.g. inside theagentConclusion === "success" || agentConclusion === "failure"branch).