Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 23, 2026

Safe output jobs fail when discussions/issues are deleted between agent execution and comment processing. These 404s create false failures in monitoring without indicating actual problems.

Changes

  • Modified /actions/setup/js/add_comment.cjs to detect 404 errors via status code or message content (case-insensitive)
  • 404s now log warnings and return {success: true, skipped: true} to continue processing other operations
  • Non-404 errors unchanged - permissions (403), validation (422), and other failures still error correctly

Detection logic

const is404 = error?.status === 404 || 
              errorMessage.includes("404") || 
              errorMessage.toLowerCase().includes("not found");

if (is404) {
  core.warning(`Target was not found (may have been deleted): ${errorMessage}`);
  return { success: true, warning: `Target not found: ${errorMessage}`, skipped: true };
}

Impact

Reduces false failure rates from deleted targets while preserving error signal for genuine issues.

Original prompt

This section details on the original issue you should resolve

<issue_title>[deep-report] Treat add_comment 404s as warnings in safe output handler</issue_title>
<issue_description>### Description
Safe output health reported 404 "Not Found" errors when discussions were deleted between agent execution and safe output processing. Update the add_comment handler to downgrade 404s to warnings (continue processing other operations) while preserving errors for other status codes.

Expected Impact

Reduces false failure rates in safe output jobs and improves signal-to-noise in monitoring without masking real errors.

Suggested Agent

Safe Output Health Monitor

Estimated Effort

Medium (1-4 hours)

Data Source

DeepReport Intelligence Briefing - 2026-01-23 (see discussion #11409)

AI generated by DeepReport - Intelligence Gathering Agent

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits January 23, 2026 23:00
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@pelikhan pelikhan marked this pull request as ready for review January 23, 2026 23:07
Copilot AI changed the title [WIP] Update add_comment handler to treat 404s as warnings Treat add_comment 404s as warnings in safe output handler Jan 23, 2026
Copilot AI requested a review from pelikhan January 23, 2026 23:10
@pelikhan pelikhan merged commit ddb81b4 into main Jan 23, 2026
151 checks passed
@pelikhan pelikhan deleted the copilot/treat-404s-as-warnings branch January 23, 2026 23:15
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.

[deep-report] Treat add_comment 404s as warnings in safe output handler

2 participants