From 3c84063c5eaa289591479888f0e3826ce01372fe Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 26 Mar 2026 05:44:32 +0000 Subject: [PATCH 1/2] Initial plan From 136a0a5f62964bf13485593d56769d4fc2a16d12 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 26 Mar 2026 06:02:00 +0000 Subject: [PATCH 2/2] fix: skip failure issue when agent fails after calling noop (transient AI model error) When the AI model server returns a transient error AFTER the agent has already called the noop safe-output tool, the Copilot CLI exits with code 1. Previously, handle_agent_failure.cjs only checked for noop outputs when agentConclusion === "success", so these transient post-noop failures would still trigger failure issue creation. This fix extends the noop check to also run when agentConclusion === "failure". If all agent outputs are noop-type, we skip failure handling regardless of the exit code, since the agent completed its work. Fixes the gpclean workflow failure in run #23578198071 where the agent successfully found no GPL dependencies, called noop, but received "Response was interrupted due to a server error" errors afterwards. Agent-Logs-Url: https://github.com/github/gh-aw/sessions/c6ac0e09-3e7e-4ebc-b456-0778f1b1aef4 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- actions/setup/js/handle_agent_failure.cjs | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/actions/setup/js/handle_agent_failure.cjs b/actions/setup/js/handle_agent_failure.cjs index a0f33d61180..1d9e1d5b906 100644 --- a/actions/setup/js/handle_agent_failure.cjs +++ b/actions/setup/js/handle_agent_failure.cjs @@ -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)"); + } + } } // Only proceed if the agent job actually failed OR timed out OR there are assignment errors OR