fix: wire call_workflow into consolidated safe_outputs handler-manager path#21218
fix: wire call_workflow into consolidated safe_outputs handler-manager path#21218
call_workflow into consolidated safe_outputs handler-manager path#21218Conversation
…r path Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Fixes missing call_workflow integration in the consolidated safe-outputs handler-manager pipeline so workflows configured with only call-workflow correctly generate and run the “Process Safe Outputs” step without runtime “No handler loaded…” errors.
Changes:
- Registers
call_workflowin the runtime handler managerHANDLER_MAPsoloadHandlers()can load it when configured. - Adds
call_workflowto the compiler’s handler-manager config emission and to the compiler’s consolidated job gating so the handler-manager step is generated. - Adds/extends Go + JS tests to cover emitted config and runtime processing/no-handler regression.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/workflow/compiler_safe_outputs_job.go | Includes CallWorkflow in handler-manager type gating to ensure “Process Safe Outputs” is generated for call-workflow-only setups. |
| pkg/workflow/compiler_safe_outputs_job_test.go | Adds regression test asserting the consolidated job includes the handler-manager step/env var when only call-workflow is configured. |
| pkg/workflow/compiler_safe_outputs_config.go | Emits call_workflow handler config (including max, workflows, and optional workflow_files) into GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG. |
| pkg/workflow/compiler_safe_outputs_config_test.go | Adds tests asserting call_workflow appears in emitted JSON and that workflows / workflow_files are present. |
| actions/setup/js/safe_output_handler_manager.cjs | Registers call_workflow in HANDLER_MAP so the runtime can load the handler. |
| actions/setup/js/safe_output_handler_manager.test.cjs | Adds tests validating processMessages success path when registered and the no-handler error when missing. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Done in b1cf3de. Found two additional missing spots after auditing all
The other |
call_workflowwas missing from five integration points in the consolidated safe-outputs pipeline, causingProcess Safe Outputsto fail withNo handler loaded for type 'call_workflow'at runtime, and workflows using onlycall-workflowto compile without aProcess Safe Outputsstep or MCP setup entirely.Runtime (
safe_output_handler_manager.cjs)call_workflow: "./call_workflow.cjs"toHANDLER_MAPsoloadHandlers()requires the module whenconfig.call_workflowis present.Compiler config (
compiler_safe_outputs_config.go)"call_workflow"entry tohandlerRegistryemittingmax,workflows, andworkflow_filesintoGH_AW_SAFE_OUTPUTS_HANDLER_CONFIG. Notarget-repo/target-reffields — those belong todispatch_workflowonly.Compiler job gating (
compiler_safe_outputs_job.go)data.SafeOutputs.CallWorkflow != niltohasHandlerManagerTypesso acall-workflow-only workflow compiles aProcess Safe Outputsstep.Safe output state reflection (
safe_outputs_state.go)"CallWorkflow": "call_workflow"tosafeOutputFieldMapping. This map drives reflection-based checks inhasAnySafeOutputEnabled()andhasNonBuiltinSafeOutputsEnabled(). Without this,HasSafeOutputsEnabled()returnedfalsefor call-workflow-only configs, breaking MCP server setup, Copilot engine tools, Docker configuration, MCP environment/detection, the agent prompt safe-outputs section, andapplyDefaultCreateIssue()(which would incorrectly inject a default create-issue).Prompt tools list (
unified_prompt_step.go)call_workflowto the<safe-output-tools>Tools: ...prompt section alongsidedispatch_workflow, so the agent is informed of call-workflow capability.Tests
TestAddHandlerManagerConfigEnvVar_CallWorkflow— assertscall_workflow,workflows, andworkflow_filesappear in the emitted JSON configTestCallWorkflowOnly_UsesHandlerManagerStep— assertsProcess Safe Outputsis generated whencall-workflowis the only configured safe-output typesafe_output_handler_manager.test.cjs— handler invocation path and regression for the no-handler fallback💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.