Repository navigation
Description
Summary
When the activation job fails for a reason that is not one of the named activation guardrails, the
agent job is skipped and so is the conclusion job. As a result, no failure issue or comment is
created: the only signal is the red run in the Actions tab. Typical causes:
- an action used by the job cannot be downloaded in "Set up job" (repository not accessible, or blocked
by an organisation policy), so the job runs none of its steps; - a checkout failure;
- any step that crashes before it sets the guardrail outputs.
Users who want to be alerted have to add their own custom job with
if: always() && needs.activation.result == 'failure'.
Reproduced with gh-aw v1.0.1, the latest release. The code is unchanged on main at f37d3b9 (2026-11-02).
Evidence
The compiled conclusion job for a minimal Copilot workflow (v1.0.1):
conclusion:
needs: [activation, agent, ...]
if: >
always() && (needs.agent.result != 'skipped' || needs.activation.outputs.lockdown_check_failed == 'true' ||
needs.activation.outputs.oauth_token_check_failed == 'true' || needs.activation.outputs.stale_lock_file_failed == 'true' ||
needs.activation.outputs.secret_verification_result == 'failed' || needs.activation.outputs.daily_ai_credits_exceeded == 'true' ||
needs.activation.outputs.daily_ai_credits_guardrail_status == 'structural_error' || needs.activation.outputs.daily_ai_credits_guardrail_status == 'transient_error')If activation fails without setting any of those outputs, needs.agent.result is skipped and every
output is empty, so the condition is false and the job is skipped. The steps inside conclusion
(Handle agent failure, Report failed jobs) all use if: always(), so the job-level condition is
the only gate.
Analysis
There are three gates, and each excludes a generic activation failure:
- Job condition:
buildConclusionJobCondition
inpkg/workflow/notify_comment_conclusion_helpers.gobuilds
always() && (agentNotSkipped || activationGuardrailsFailed), andactivationGuardrailsFailedis
only the named outputs. - Failure handler:
handle_agent_failure.cjs
returns early unlessGH_AW_AGENT_CONCLUSIONisfailureor one of the named flags is set. A skipped
agent with no flags gives "skipping failure handling". - Failed-jobs report:
report_failed_jobs.cjs
putsactivationandpre_activationinBUILTIN_REPORTED_JOB_IDS("reported via agent failure
issue flags"). That holds only for the named guardrails.
Related: #59183 (a silent pre_activation failure, now closed) covered a different job and path.
A skipped (not failed) activation, for example when pre_activation decides not to run, must keep
skipping the conclusion. The fix should test needs.activation.result == 'failure', not
!= 'skipped'.
Implementation plan
-
Conclusion condition (
pkg/workflow/notify_comment_conclusion_helpers.go,buildConclusionJobCondition):- Add
activationFailed := BuildEquals(BuildPropertyAccess("needs.activation.result"), BuildStringLiteral("failure"))
usingconstants.ActivationJobName. - OR it into
activationGuardrailsFailed. - Leave the work-queue early return and the
add_commenthandling unchanged.
- Add
-
Pass the result to the handler (same file, next to each
GH_AW_AGENT_CONCLUSION: ${{ needs.<main>.result }}at lines 130, 275 and 558):- Add
GH_AW_ACTIVATION_RESULT: ${{ needs.activation.result }}.
- Add
-
Handle it (
actions/setup/js/handle_agent_failure.cjs):- Read
const activationResult = process.env.GH_AW_ACTIVATION_RESULT || ""inmain(). - Define
hasActivationFailure = activationResult === "failure" && !<any named activation flag>. - Add
!hasActivationFailureto the early-return guard. - Add an "activation failed" failure category, following the existing lockdown and stale-lock-file
categories. Its message tells the user the activation job failed before the agent started and links
the run (GH_AW_RUN_URL), so they can inspect "Set up job" and the checkout steps. - Include it in the categories accepted by the
report-failure-as-issuecategories filter.
- Read
-
Failed-jobs report (
actions/setup/js/report_failed_jobs.cjs): either keep excluding
activationnow that step 3 reports it, or report it whenGH_AW_ACTIVATION_RESULTisfailureand
no named flag is set. Pick one and document it, but don't report it twice. -
Tests:
- Go: assert that the compiled
conclusion.ifcontainsneeds.activation.result == 'failure', and
that a workflow with anactivationthat is only skipped still produces a condition which is
false for skipped activation. Extendnotify_comment_test.go/notify_comment_failed_jobs_test.go. - JS:
handle_agent_failure.test.cjswithGH_AW_AGENT_CONCLUSION=skippedand
GH_AW_ACTIVATION_RESULT=failurecreates the failure issue with the new category. With
GH_AW_ACTIVATION_RESULT=skippedit still returns early. - Recompile the repository's workflows so the lock files pick up the new condition.
- Go: assert that the compiled
-
Docs: add the activation-failure category wherever the failure-report categories are listed
(docs/src/content/docs/reference/safe-outputs / failure reporting). -
Run
make agent-finish.
Acceptance criteria
- When
activationfails, theconclusionjob runs andHandle agent failurecreates the failure issue
or comment with an "activation failed" category. That includes a failure in "Set up job" or in any step
that sets none of the named outputs. - When
activationis skipped, theconclusionjob is still skipped. - The existing named-guardrail reports are unchanged and not duplicated.
Suggested labels: bug, workflow
Activity