Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 31, 2026

Workflows using dispatch-workflow safe-output failed to trigger other workflows because the runtime config.json was missing the workflow_files map needed by the dispatch handler.

Root Cause

The workflow_files map (workflow name → file extension) was populated in generateFilteredToolsJSON() after generateSafeOutputsConfig() had already serialized config.json:

// mcp_setup_generator.go (before)
safeOutputConfig = generateSafeOutputsConfig(workflowData)  // workflow_files not yet populated
// ... later ...
filteredToolsJSON = generateFilteredToolsJSON(workflowData, ...)  // populates workflow_files

The runtime handler requires this mapping to construct workflow file paths:

// dispatch_workflow.cjs
const extension = workflowFiles[workflowName];  // undefined without the mapping
const workflowFile = `${workflowName}${extension}`;
await github.rest.actions.createWorkflowDispatch({ workflow_id: workflowFile, ... });

Changes

  • pkg/workflow/safe_outputs_config_generation.go: Extract workflow file discovery logic into populateDispatchWorkflowFiles() that runs before config serialization
  • pkg/workflow/mcp_setup_generator.go: Call populateDispatchWorkflowFiles() before generateSafeOutputsConfig()
  • pkg/workflow/dispatch_workflow_test.go: Verify workflow_files is populated and included in config.json

Result

Config now includes the required mapping:

{
  "dispatch_workflow": {
    "workflow_files": { "test-workflow": ".yml" },
    "workflows": ["test-workflow"]
  }
}
Original prompt

Fix workflow not being able to trigger/run other workflows:
Max count: 1
✓ Loaded and initialized handler for: noop
Loaded 5 handler(s)
Collected 1 missing tool(s), 0 missing data item(s), and 0 noop message(s)
Processing 2 message(s) in order of appearance...
Processing message 1/2: missing_tool
✓ Recorded missing tool: workflow_dispatch or gh workflow run
Reason: Need to dispatch workflows but gh CLI is not authenticated. The workflows "add-name" and "add-emojis" require workflow_dispatch with a 'text' input parameter, but there's no available tool to trigger GitHub Actions workflows programmatically.
Alternatives: Workflows would need to be manually triggered through the GitHub UI, or a GitHub API token would need to be configured for gh CLI authentication.
✓ Message 1 (missing_tool) completed successfully


💡 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 2 commits January 31, 2026 08:39
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
@mnkiefer mnkiefer marked this pull request as ready for review January 31, 2026 08:46
Copilot AI changed the title [WIP] Fix workflow not being able to trigger other workflows Fix dispatch-workflow missing workflow_files mapping in config Jan 31, 2026
Copilot AI requested a review from mnkiefer January 31, 2026 08:51
@mnkiefer mnkiefer merged commit 59b5eaa into main Jan 31, 2026
121 checks passed
@mnkiefer mnkiefer deleted the copilot/fix-workflow-trigger-issue branch January 31, 2026 08:51
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