Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 31, 2025

Safe-output jobs with min > 0 were skipping the contains(needs.agent.outputs.output_types, 'type') check, causing them to run even when the agent produced no outputs of that type.

Changes

  • BuildSafeOutputType(): Always include contains() check in job condition, removing special case for min > 0
  • Min constraint enforcement: Moved from condition logic to job-level validation in collect_ndjson_output.cjs
  • Test updates: Updated expectations in safe_outputs_min_condition_test.go, expressions_cancelled_test.go, and safe_jobs_test.go
  • Workflow recompilation: Regenerated 56 .lock.yml files with updated conditions

Example

Before (with min: 1):

if: ((!cancelled()) && (needs.agent.result != 'skipped'))

After:

if: ((!cancelled()) && (needs.agent.result != 'skipped')) && (contains(needs.agent.outputs.output_types, 'create_issue'))

Jobs now only run when the agent actually produced the expected output type.


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

- Update BuildSafeOutputType to always include contains() check
- Remove special handling for min > 0 that skipped the check
- Update all test expectations to verify contains check is present
- Recompile all workflow lock files with updated conditions

This ensures safe-output jobs only run when the agent actually
produced outputs of that type, regardless of min constraint.
The min constraint is enforced by the job itself via validation.

Co-authored-by: pelikhan <[email protected]>
Copilot AI changed the title [WIP] Fix safe-output jobs running when workflow is cancelled Ensure safe-output jobs verify output type presence regardless of min constraint Oct 31, 2025
Copilot finished work on behalf of pelikhan October 31, 2025 19:52
Copilot AI requested a review from pelikhan October 31, 2025 19:52
@pelikhan pelikhan marked this pull request as ready for review October 31, 2025 19:57
@pelikhan pelikhan merged commit 5c5318b into fix/safe-outputs-skip-on-cancel-9216d19286161389 Oct 31, 2025
6 checks passed
@pelikhan pelikhan deleted the copilot/sub-pr-2891 branch October 31, 2025 19:57
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