Skip to content

Handle no-op safe-outputs in conclusion job without treating as failures#14572

Merged
pelikhan merged 4 commits intomainfrom
copilot/update-no-op-message-handling
Feb 9, 2026
Merged

Handle no-op safe-outputs in conclusion job without treating as failures#14572
pelikhan merged 4 commits intomainfrom
copilot/update-no-op-message-handling

Conversation

Copy link
Contributor

Copilot AI commented Feb 8, 2026

Plan: Handle no-op Messages in Conclusion Job

Understanding Current Behavior

  • Reviewed handle_agent_failure.cjs - posts failure issues with [agentics] prefix
  • Reviewed collect_ndjson_output.cjs - collects safe outputs from agent
  • Reviewed noop.cjs - processes noop messages and exports to environment
  • Identified title-prefix pattern: [agentics] for workflow failures

Implementation Tasks

  • Create handle_noop_message.cjs to post noop messages to "agent runs" issue
  • Update handle_agent_failure.cjs to detect and skip noop-only scenarios
  • Add handle_noop_message step to conclusion job in notify_comment.go
  • Updated handle_noop_message to verify agent succeeded and only noop outputs exist
  • Pass GH_AW_AGENT_CONCLUSION to handle_noop_message step
  • Recompile all workflows with updated logic
  • Verify all existing tests still pass (26 handle_agent_failure tests)

Key Requirements

  1. ✅ If only noop safe-output exists (no other outputs), don't treat as failure
  2. ✅ Create/find issue titled [agentic-workflows] Agent runs
  3. ✅ Post noop message as comment to that issue
  4. ✅ Use same title-prefix pattern as other agentic workflow issues
  5. NEW: Only post when agent succeeds AND there are no non-noop outputs

Changes Made

1. Updated: actions/setup/js/handle_noop_message.cjs

Added validation to ensure posting only happens when:

  • Agent conclusion is "success" (not failure)
  • All safe-outputs are noop type (no other outputs)
// Only post to "agent runs" issue if the agent succeeded (no failures)
if (agentConclusion !== "success") {
  core.info(`Agent did not succeed (conclusion: ${agentConclusion}), skipping no-op message posting`);
  return;
}

// Check that there are no safe-outputs other than noop
const agentOutputResult = loadAgentOutput();
const nonNoopItems = agentOutputResult.items.filter(item => item.type !== "noop");
if (nonNoopItems.length > 0) {
  core.info(`Found ${nonNoopItems.length} non-noop output(s), skipping no-op message posting`);
  return;
}

2. Updated: pkg/workflow/notify_comment.go

  • Added GH_AW_AGENT_CONCLUSION environment variable to handle_noop_message step
  • This allows the JavaScript to check if agent succeeded before posting

3. Recompiled Workflows

  • All 148 workflow lock files updated with new environment variable
  • Step correctly passes agent conclusion status

Testing

  • ✅ Workflow compilation successful
  • ✅ Code formatted and linted
  • ✅ All lock files regenerated correctly
  • ✅ Environment variables properly passed in compiled workflows

Behavior Summary

Posting to "agent runs" issue only happens when:

  1. ✅ Agent conclusion is "success" (no failures)
  2. ✅ Noop message exists
  3. ✅ No other safe-outputs besides noop exist

All other scenarios skip posting:

  • Agent failed → handled by handle_agent_failure
  • Agent succeeded with multiple output types → normal workflow completion
  • Agent succeeded with only noop → posts to "agent runs" issue ✓
Original prompt

Update the JavaScript that handles the message in the conclusion job so that:

  • If there is no safe-output other than no-op, it posts a no-op message and does not treat this as an agent failure.
  • The JavaScript adds this message as a new comment to a single issue called agent runs, using the same title-prefix used for agentic-workflows.
  • The purpose is to publish the no-op message as a new comment on that issue.

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits February 8, 2026 23:18
…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 AI changed the title [WIP] Update JavaScript to handle no-op message in conclusion job Handle no-op safe-outputs in conclusion job without treating as failures Feb 8, 2026
Copilot AI requested a review from pelikhan February 8, 2026 23:28
@pelikhan
Copy link
Contributor

pelikhan commented Feb 9, 2026

@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>
Copy link
Contributor Author

Copilot AI commented Feb 9, 2026

@copilot, post this message only when there are no agent failures and there are no safe-outputs other than noop

Updated in commit 5e7383c. The handle_noop_message script now validates:

  1. Agent conclusion is "success" (no failures)
  2. No safe-outputs exist other than noop

The message is only posted to the "agent runs" issue when both conditions are met.

@pelikhan pelikhan marked this pull request as ready for review February 9, 2026 04:30
Copilot AI review requested due to automatic review settings February 9, 2026 04:30
@pelikhan pelikhan merged commit 84109fa into main Feb 9, 2026
92 of 93 checks passed
@pelikhan pelikhan deleted the copilot/update-no-op-message-handling branch February 9, 2026 04:33
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.cjs script + Vitest coverage to post noop-only success messages to a single tracking issue.
  • Update handle_agent_failure.cjs to skip failure handling when the agent succeeded and produced only noop outputs.
  • Extend conclusion job generation (notify_comment.go) and recompiled workflow lockfiles to run the noop-message handler and pass GH_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.

Comment on lines +4 to +8
const { getErrorMessage } = require("./error_helpers.cjs");
const { sanitizeContent } = require("./sanitize_content.cjs");
const { generateFooterWithExpiration } = require("./ephemerals.cjs");
const { renderTemplate } = require("./messages_core.cjs");

Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copilot uses AI. Check for mistakes.
Comment on lines +15 to +16
const parentTitle = "[agentic-workflows] Agent runs";
const parentLabel = "agentic-workflows";
Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copilot uses AI. Check for mistakes.
Comment on lines +20 to +22
// Search for existing agent runs issue
const searchQuery = `repo:${owner}/${repo} is:issue is:open label:${parentLabel} in:title "${parentTitle}"`;

Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Comment on lines +1 to +5
// @ts-check

import { describe, it, expect, beforeEach, afterEach, vi } from "vitest";

// Mock load_agent_output at the module level
Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants