Skip to content

Safe outputs: pre-validate dispatch_workflow required inputs and downgrade missing-input failures to non-fatal - #41992

Closed
pelikhan with Copilot wants to merge 4 commits into
mainfrom
copilot/aw-failures-fix-dispatch-workflow
Closed

Safe outputs: pre-validate dispatch_workflow required inputs and downgrade missing-input failures to non-fatal#41992
pelikhan with Copilot wants to merge 4 commits into
mainfrom
copilot/aw-failures-fix-dispatch-workflow

Conversation

CopilotAI commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

safe_outputs was failing the entire job when a dispatch_workflow message omitted a target workflow’s required workflow_dispatch input (e.g. message for haiku-printer), even when all other safe outputs succeeded. This change adds required-input awareness to dispatch handling and treats that specific validation failure as report-only.

  • Compile-time: capture required dispatch inputs

    • Extended DispatchWorkflowConfig with required_inputs (workflow -> []requiredInputName).
    • During safe-output config population, extract required workflow_dispatch.inputs from target workflow definitions and persist them into handler config.
  • Runtime: pre-dispatch validation in dispatch_workflow handler

    • Before calling Actions dispatch API, validate message.inputs against compile-time required_inputs.
    • On missing required fields, return a typed validation result (success: false, reportOnly: true) with actionable error text naming the missing input.
  • Runtime: normalize API missing-input errors

    • If GitHub returns 400/422 with Required input 'X' not provided, translate it to the same typed report-only validation error instead of surfacing raw REST failure text.
  • Job outcome semantics: report-only failures

    • Updated safe output failure partitioning to honor explicit reportOnly: true on results (in addition to existing type-based report-only rules), so a single malformed dispatch does not make safe_outputs red.
// dispatch_workflow.cjsconstrequiredInputs=Array.isArray(requiredInputsByWorkflow[workflowName])
? requiredInputsByWorkflow[workflowName]
: [];constmissing=requiredInputs.find(name=>!Object.prototype.hasOwnProperty.call(inputs,name));if(missing){return{success: false,reportOnly: true,error: `Validation failed for dispatch_workflow "${workflowName}": missing required input "${missing}".`,};}

pr-sous-chef run 28311797805

Generated by 👨‍🍳 PR Sous Chef · 111.6 AIC · ⌖ 0.953 AIC · ⊞ 17.2K ·

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
CopilotAI changed the title [WIP] Fix dispatch_workflow input validation for haiku-printerSafe outputs: pre-validate dispatch_workflow required inputs and downgrade missing-input failures to non-fatalJun 28, 2026
CopilotAI requested a review from pelikhanJune 28, 2026 02:50
@pelikhan
pelikhan marked this pull request as ready for review June 28, 2026 04:48
CopilotAI review requested due to automatic review settings June 28, 2026 04:48

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

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 enhances the safe_outputs “dispatch_workflow” handler by capturing required workflow_dispatch.inputs at compile time and using that metadata at runtime to pre-validate dispatch messages, converting “missing required input” failures into report-only results so they don’t fail the entire safe_outputs job.

Changes:

  • Compile-time: extract and persist per-workflow required workflow_dispatch inputs into safe-outputs handler config (required_inputs).
  • Runtime: validate dispatch_workflow messages against required_inputs before dispatch, and normalize certain 400/422 API errors into report-only validation failures.
  • Job semantics: extend report-only partitioning logic to honor an explicit reportOnly: true flag (in addition to type-based rules).
Show a summary per file
FileDescription
pkg/workflow/safe_outputs_handler_registry.goEmits required_inputs into the generated safe-outputs handler config when present.
pkg/workflow/safe_outputs_dispatch.goExtracts required workflow_dispatch inputs from target workflows during compilation.
pkg/workflow/dispatch_workflow.goExtends DispatchWorkflowConfig with RequiredInputs for compile→runtime transfer.
pkg/workflow/dispatch_workflow_test.goVerifies required inputs are captured and serialized into config.
actions/setup/js/safe_output_handler_manager.cjsUpdates report-only classification/partitioning to honor explicit reportOnly: true.
actions/setup/js/safe_output_handler_manager.test.cjsAdds tests for explicit reportOnly classification and partitioning.
actions/setup/js/dispatch_workflow.cjsAdds pre-dispatch required-input validation and API missing-input normalization to report-only failures.
actions/setup/js/dispatch_workflow.test.cjsAdds tests for the new report-only missing-input behaviors (pre-dispatch and API-error normalization).

Review details

Tip

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

  • Files reviewed: 8/8 changed files
  • Comments generated: 3
  • Review effort level: Low

Comment on lines 580 to 582
function isReportOnlyFailureResult(result) {
return isFailedProcessingResult(result) && !!(result?.type && REPORT_ONLY_FAILURE_TYPES.has(result.type));
return isFailedProcessingResult(result) && (result?.reportOnly === true || !!(result?.type && REPORT_ONLY_FAILURE_TYPES.has(result.type)));
}
Comment threadactions/setup/js/dispatch_workflow.cjs
Comment threadactions/setup/js/dispatch_workflow.cjs
@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot please run the pr-finisher skill, address remaining review feedback, refresh this branch from main, and rerun checks once it is up to date.

Generated by 👨‍🍳 PR Sous Chef · 111.6 AIC · ⌖ 0.953 AIC · ⊞ 17.2K ·

…age paths
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

PR Triage — Run §28315307719

Categorybug
Riskmedium
Priorityhigh
Score64/100 — impact 32 · urgency 20 · quality 12
Actionfast_track
Batchproduction-fixes (#41830 · #41912 · #41992)

Fixes safe_outputs CI failures caused by missing dispatch_workflow required inputs by adding compile-time capture and downgrading validation errors to non-fatal (+177/-30, 13 files). pr-finisher skill requested. 5h old.

Generated by 🔧 PR Triage Agent · 82.5 AIC · ⌖ 10.6 AIC · ⊞ 5.4K ·

@github-actions
github-actionsBot deleted the copilot/aw-failures-fix-dispatch-workflow branch July 6, 2026 03:00
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@gh-aw-bot@pelikhan