Handle no-op safe-outputs in conclusion job without treating as failures#14572
Handle no-op safe-outputs in conclusion job without treating as failures#14572
Conversation
…p noop-only scenarios Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot, post this message only when there are no agent failures and there are no safe-outputs other than noop |
…-only outputs Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Updated in commit 5e7383c. The handle_noop_message script now validates:
The message is only posted to the "agent runs" issue when both conditions are met. |
There was a problem hiding this comment.
Pull request overview
This PR updates the agentic workflow conclusion-job handling so that “noop-only” safe-output runs are treated as successful outcomes (not failures) and are published as comments on a shared “agent runs” tracking issue.
Changes:
- Add a new
handle_noop_message.cjsscript + Vitest coverage to post noop-only success messages to a single tracking issue. - Update
handle_agent_failure.cjsto skip failure handling when the agent succeeded and produced onlynoopoutputs. - Extend conclusion job generation (
notify_comment.go) and recompiled workflow lockfiles to run the noop-message handler and passGH_AW_AGENT_CONCLUSION.
Reviewed changes
Copilot reviewed 146 out of 146 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/workflow/notify_comment.go | Adds a conclusion-job step to run handle_noop_message and passes agent conclusion + noop message. |
| actions/setup/js/handle_agent_failure.cjs | Detects “success + noop-only outputs” and skips failure issue creation for that case. |
| actions/setup/js/handle_noop_message.cjs | New script to find/create an “Agent runs” issue and comment noop messages on success + noop-only output. |
| actions/setup/js/handle_noop_message.test.cjs | New Vitest coverage for noop posting/skip paths. |
| actions/setup/js/handle_noop_message.test.cjs.bak | Extra backup copy of the test file (should not be committed). |
| .github/workflows/*.lock.yml | Recompiled workflows to include the new “Handle No-Op Message” step/env. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const { getErrorMessage } = require("./error_helpers.cjs"); | ||
| const { sanitizeContent } = require("./sanitize_content.cjs"); | ||
| const { generateFooterWithExpiration } = require("./ephemerals.cjs"); | ||
| const { renderTemplate } = require("./messages_core.cjs"); | ||
|
|
There was a problem hiding this comment.
renderTemplate is required but never used in this script. This adds dead code and may fail linting depending on the JS tooling; please remove the unused import (or use it if intended).
| const parentTitle = "[agentic-workflows] Agent runs"; | ||
| const parentLabel = "agentic-workflows"; |
There was a problem hiding this comment.
The issue title prefix here ([agentic-workflows]) is inconsistent with the existing failure issue title prefix used elsewhere (e.g. [agentics] ... failed in handle_agent_failure.cjs). To keep searches/triage consistent, consider reusing the same prefix pattern across all agentic-workflow tracking issues (or centralize it in a shared constant).
| // Search for existing agent runs issue | ||
| const searchQuery = `repo:${owner}/${repo} is:issue is:open label:${parentLabel} in:title "${parentTitle}"`; | ||
|
|
There was a problem hiding this comment.
ensureAgentRunsIssue only searches is:open issues. If the tracking issue is closed (manually or by automation), this will create a duplicate “Agent runs” issue and break the “single issue” requirement. Consider searching across all states and reopening the existing issue when found closed, instead of always creating a new one.
| // @ts-check | ||
|
|
||
| import { describe, it, expect, beforeEach, afterEach, vi } from "vitest"; | ||
|
|
||
| // Mock load_agent_output at the module level |
There was a problem hiding this comment.
This .bak test file looks like an accidental backup/duplicate of handle_noop_message.test.cjs. Keeping it in the repo increases maintenance burden and risks confusing tooling (editors, greps, future test discovery changes). Please remove it from the PR unless it serves a specific purpose.
Plan: Handle no-op Messages in Conclusion Job
Understanding Current Behavior
[agentics]prefix[agentics]for workflow failuresImplementation Tasks
Key Requirements
noopsafe-output exists (no other outputs), don't treat as failure[agentic-workflows] Agent runsChanges Made
1. Updated:
actions/setup/js/handle_noop_message.cjsAdded validation to ensure posting only happens when:
2. Updated:
pkg/workflow/notify_comment.goGH_AW_AGENT_CONCLUSIONenvironment variable to handle_noop_message step3. Recompiled Workflows
Testing
Behavior Summary
Posting to "agent runs" issue only happens when:
All other scenarios skip posting:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.