Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Feb 3, 2026

Summary: Propagate create-discussion Errors to Conclusion Job

Problem

When a create-discussion safe output fails, the error is not propagated to the agent failure tracking in the conclusion job, so failures are not reported in tracking issues/comments.

Reference: https://github.com/github/gh-aw/actions/runs/21615216168/job/62293027909#step:6:1

Solution

Implemented error tracking for create_discussion following the same pattern as assign_to_agent. All code review feedback addressed.

Implementation Complete ✅

  • Track failed create_discussion messages in safe_output_handler_manager.cjs
  • Export create_discussion_errors and create_discussion_error_count as outputs
  • Add outputs to safe_outputs job in compiler_safe_outputs_job.go
  • Pass errors as environment variables to conclusion job in notify_comment.go
  • Update handle_agent_failure.cjs to include create_discussion errors in issue/comment
  • Update agent failure templates to include create_discussion_errors_context
  • Add comprehensive tests
  • Fix code review feedback (remove unused variables)
  • Refactor duplicate code into helper function
  • Merge main branch and recompile workflows
  • All tests pass

Changes Made

JavaScript Changes

  1. safe_output_handler_manager.cjs: Collect and export create_discussion errors
  2. handle_agent_failure.cjs: Display create_discussion errors with helper function (merged with main branch checkout PR changes)
  3. Agent failure templates: Include create_discussion_errors_context

Go Changes

  1. compiler_safe_outputs_job.go: Add error outputs to safe_outputs job
  2. notify_comment.go: Pass errors to conclusion job as environment variables

Tests

  • Comprehensive test coverage in handle_agent_failure.test.cjs
  • All existing tests continue to pass

This ensures create_discussion failures are properly tracked and reported in failure tracking issues/comments.

Original prompt

Reference: https://github.com/github/gh-aw/actions/runs/21615216168/job/62293027909#step:6:1

When a create-discussion safe outout fails, the error should be propagated to the agent failure in conclusion job and reported in the issue/comment generated. See workflow run.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 5 commits February 3, 2026 03:27
- Track failed create_discussion messages in safe_output_handler_manager.cjs
- Export create_discussion_errors and create_discussion_error_count as outputs
- Add outputs to safe_outputs job in compiler_safe_outputs_job.go
- Pass errors as environment variables to conclusion job in notify_comment.go
- Update handle_agent_failure.cjs to include create_discussion errors in issue/comment
- Update agent failure templates to include create_discussion_errors_context placeholder

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
All tests passing. Feature is ready for review.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…er function

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix error propagation for create-discussion failures Propagate create-discussion errors to conclusion job failure tracking Feb 3, 2026
Copilot AI requested a review from pelikhan February 3, 2026 03:36
@pelikhan pelikhan marked this pull request as ready for review February 3, 2026 05:03
Copilot AI review requested due to automatic review settings February 3, 2026 05:03
@pelikhan
Copy link
Contributor

pelikhan commented Feb 3, 2026

@copilot merge main and recompile

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

Propagates create_discussion safe-output failures from the safe_outputs job into the conclusion job so they can be reported in failure tracking issues/comments.

Changes:

  • Export create_discussion_errors and create_discussion_error_count from safe_output_handler_manager.cjs.
  • Wire new outputs through the Go workflow compiler into the conclusion job env vars.
  • Render create-discussion failure details in handle_agent_failure.cjs and corresponding templates/tests.

Reviewed changes

Copilot reviewed 22 out of 22 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
pkg/workflow/notify_comment.go Passes create-discussion error outputs to the conclusion job via env vars when create-discussions is configured.
pkg/workflow/compiler_safe_outputs_job.go Adds create_discussion_errors and create_discussion_error_count to safe_outputs job outputs.
actions/setup/md/agent_failure_issue.md Adds {create_discussion_errors_context} placeholder to failure issue template.
actions/setup/md/agent_failure_comment.md Adds {create_discussion_errors_context} placeholder to failure comment template.
actions/setup/js/safe_output_handler_manager.cjs Collects failed create_discussion results and exports them as step outputs.
actions/setup/js/handle_agent_failure.cjs Builds and injects a “Create Discussion Failed” section into failure issue/comment bodies.
actions/setup/js/handle_agent_failure.test.cjs Adds a test asserting create-discussion errors appear in the created failure issue body.
.github/workflows/cli-consistency-checker.lock.yml Exposes new safe_outputs job outputs for create-discussion errors.
.github/workflows/claude-code-user-docs-review.lock.yml Exposes new safe_outputs outputs and passes them into the failure handler env.
.github/workflows/ci-doctor.lock.yml Exposes new safe_outputs job outputs for create-discussion errors.
.github/workflows/ci-coach.lock.yml Exposes new safe_outputs job outputs for create-discussion errors.
.github/workflows/changeset.lock.yml Exposes new safe_outputs job outputs for create-discussion errors.
.github/workflows/breaking-change-checker.lock.yml Exposes new safe_outputs job outputs for create-discussion errors.
.github/workflows/brave.lock.yml Exposes new safe_outputs job outputs for create-discussion errors.
.github/workflows/blog-auditor.lock.yml Exposes new safe_outputs outputs and passes them into the failure handler env.
.github/workflows/auto-triage-issues.lock.yml Exposes new safe_outputs outputs and passes them into the failure handler env.
.github/workflows/audit-workflows.lock.yml Exposes new safe_outputs outputs and passes them into the failure handler env.
.github/workflows/artifacts-summary.lock.yml Exposes new safe_outputs outputs and passes them into the failure handler env.
.github/workflows/archie.lock.yml Exposes new safe_outputs job outputs for create-discussion errors.
.github/workflows/ai-moderator.lock.yml Exposes new safe_outputs job outputs for create-discussion errors.
.github/workflows/agent-persona-explorer.lock.yml Exposes new safe_outputs outputs and passes them into the failure handler env.
.github/workflows/agent-performance-analyzer.lock.yml Exposes new safe_outputs outputs and passes them into the failure handler env.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +252 to +259
const parts = errorLine.split(":");
if (parts.length >= 4) {
// parts[0] is "discussion", parts[1] is index - both unused
const repo = parts[2];
const title = parts[3];
const error = parts.slice(4).join(":"); // Rest is the error message
context += `- Discussion "${title}" in ${repo}: ${error}\n`;
}
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

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

buildCreateDiscussionErrorsContext() checks parts.length >= 4, but then reads parts[3] and uses parts.slice(4) for the error message. For malformed/short lines this will render an empty error; consider requiring parts.length >= 5 (or adding an explicit fallback) to avoid emitting incomplete/broken list items.

Copilot uses AI. Check for mistakes.
Copilot AI and others added 2 commits February 3, 2026 05:09
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 3, 2026

@copilot merge main and recompile

Merged main and recompiled workflows. Commit: e376237

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