Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 17, 2025

Safe-output jobs were failing workflows when agent output files were missing, corrupted, or invalid. The loadAgentOutput() function called core.setFailed() on parse errors, terminating execution instead of logging and continuing.

Changes

  • pkg/workflow/js/load_agent_output.cjs: Replace core.setFailed() with core.error() for file read and JSON parse errors

    • Line 39: File read failures now log without failing
    • Line 57: JSON parse failures now log without failing
    • Function still returns { success: false } for caller handling
  • pkg/workflow/js/load_agent_output.test.cjs: Update test expectations to verify core.error() calls

  • 63 .lock.yml workflow files: Recompiled to propagate JavaScript changes

Example

// Before: Failed the workflow step
catch (error) {
  core.setFailed(errorMessage);
  return { success: false };
}

// After: Logs error, allows workflow to continue
catch (error) {
  core.error(errorMessage);
  return { success: false };
}

Safe-output jobs now log parse errors and continue, allowing workflows to complete and provide debugging information.

Original prompt

The "parse agent output" step should not fail the workflow. It should just render the logs.

See run https://github.com/githubnext/gh-aw/actions/runs/19438883462/job/55616946048#step:48:1


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

…workflow failures

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix parse agent output step to not fail workflow Fix safe-output jobs failing on agent output parse errors Nov 17, 2025
Copilot AI requested a review from pelikhan November 17, 2025 19:35
Copilot finished work on behalf of pelikhan November 17, 2025 19:35
@pelikhan pelikhan marked this pull request as ready for review November 17, 2025 20:10
Copilot AI review requested due to automatic review settings November 17, 2025 20:10
Copilot finished reviewing on behalf of pelikhan November 17, 2025 20:11
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 fixes safe-output jobs that were failing workflows when agent output files had parse errors. The loadAgentOutput() function was calling core.setFailed() on errors, which terminates workflow execution. The fix changes this to core.error(), allowing workflows to continue while still logging the errors.

Key changes:

  • Replace core.setFailed() with core.error() for file read errors (line 39)
  • Replace core.setFailed() with core.error() for JSON parse errors (line 57)
  • Update test expectations to verify core.error() is called instead of core.setFailed()
  • Recompile 63 .lock.yml workflow files to propagate the JavaScript changes

Reviewed Changes

Copilot reviewed 63 out of 63 changed files in this pull request and generated no comments.

File Description
pkg/workflow/js/load_agent_output.cjs Core fix: Replace core.setFailed() with core.error() for parse errors
pkg/workflow/js/load_agent_output.test.cjs Update test expectations to verify error logging without failure
.github/workflows/*.lock.yml (63 files) Recompiled workflow files with updated bundled JavaScript

The changes look correct and follow the coding guidelines. The function still returns { success: false, error: errorMessage } to allow callers to handle the error appropriately, but it no longer fails the workflow step. This is the intended behavior based on the PR description.


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

@pelikhan pelikhan merged commit b71bc5b into main Nov 17, 2025
93 of 96 checks passed
@pelikhan pelikhan deleted the copilot/fix-parse-agent-output branch November 17, 2025 20:16
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