Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 31, 2026

The test-dispatcher workflow configured safe-outputs.dispatch-workflow but never generated safe outputs because the prompt described capability instead of directing action.

Changes

.github/workflows/test-dispatcher.md

  • Changed passive description to imperative task statement
  • Added explicit tool invocation instructions with JSON example
  • Added constraint to prevent file-writing workarounds

Before/After

Before:

This workflow demonstrates the dispatch-workflow safe output capability.
The agent can trigger the test-workflow using the test_workflow tool.

After:

**Your task**: Call the `dispatch_workflow` tool to trigger the `test-workflow` workflow.

**Important**: You MUST use the safe output tool - do NOT write to files or attempt other methods.

## Instructions
1. **Call the safe output tool**: Use `dispatch_workflow` to trigger the test-workflow
2. **Workflow name**: Specify `test-workflow` as the workflow to dispatch
3. **Inputs (optional)**: You can provide test parameters if needed, but they are optional

## Example
```json
{
  "type": "dispatch_workflow",
  "workflow_name": "test-workflow",
  "inputs": {
    "test_param": "example value"
  }
}

This resolves "No Safe Outputs Generated" errors in runs 21547216704, 21547252198, 21547524795, 21547522694, 21547527335, 21547532343, 21547522773.

<!-- START COPILOT ORIGINAL PROMPT -->



<details>

<summary>Original prompt</summary>


----

*This section details on the original issue you should resolve*

<issue_title>Fix test-dispatcher workflow to use safe outputs properly</issue_title>
<issue_description># Q Workflow Optimization Report

## Issue Context

This PR addresses issue githubnext/gh-aw#12971, where the test-dispatcher workflow was repeatedly failing with "No Safe Outputs Generated" errors. The workflow ran successfully but didn't produce any safe outputs, causing downstream processing to fail.

### Failed Run IDs Analyzed
- Run 21547216704 (original issue)
- Run 21547252198
- Run 21547524795
- Run 21547522694
- Run 21547527335
- Run 21547532343
- Run 21547522773

All runs exhibited the same pattern: agent job succeeded but produced no safe outputs.

## Root Cause

The test-dispatcher workflow had a `safe-outputs` configuration with `dispatch-workflow` capability, but **the prompt didn't instruct the agent to actually use it**. The original prompt was:

```markdown
This workflow demonstrates the dispatch-workflow safe output capability.
The agent can trigger the test-workflow using the test_workflow tool.

This was too passive - it described what the agent could do, but didn't tell it what it should do.

Changes Made

.github/workflows/test-dispatcher.md

  • Added explicit instructions to call the dispatch_workflow safe output tool
  • Added clear task description with specific action required
  • Emphasized safe output usage with warning against file writing
  • Structured prompt with sections for better clarity

The new prompt explicitly instructs:

**Your task**: Call the `dispatch_workflow` tool to trigger the `test-workflow` workflow.

**Important**: You MUST use the safe output tool - do NOT write to files or attempt other methods.

Expected Improvements

  • Eliminates "No Safe Outputs Generated" errors by providing clear instructions
  • Improves workflow reliability with explicit task definition
  • Better agent guidance with structured prompt format
  • Prevents alternative approaches that don't use safe outputs

Validation

Modified workflow file validated:

  • ✅ Frontmatter structure intact
  • ✅ Safe output configuration preserved
  • ✅ Prompt structure improved with clear task definition
  • ✅ No lock files included (will be compiled automatically)

Related

Closes githubnext/gh-aw#12971

AI generated by Q


Note

This was originally intended as a pull request, but the git push operation failed.

Workflow Run: View run details and download patch artifact

The patch file is available in the agent-artifacts artifact in the workflow run linked above.

To apply the patch locally:

# Download the artifact from the workflow run https://github.com/githubnext/gh-aw/actions/runs/21547617819
# (Use GitHub MCP tools if gh CLI is not available)
gh run download 21547617819 -n agent-artifacts

# The patch file will be at agent-artifacts/tmp/gh-aw/aw.patch after download
# Apply the patch
git am agent-artifacts/tmp/gh-aw/aw.patch
Show patch (39 lines)
From e3d13165e248fa3f3fd7f9e16929b9c4ced0d04b Mon Sep 17 00:00:00 2001
From: "github-actions[bot]" <github-actions[bot]@users.noreply.github.com>
Date: Sat, 31 Jan 2026 16:50:38 +0000
Subject: [PATCH] fix(test-dispatcher): add explicit safe output instructions

The test-dispatcher workflow was failing because the prompt didn't
instruct the agent to use the dispatch_workflow safe output tool.

Changes:
- Added clear instructions to call dispatch_workflow tool
- Emphasized using safe outputs instead of file writing
- Structured prompt with task and requirements

Fixes githubnext/gh-aw#12971
---
 .github/workflows/test-dispatcher.md | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/.github/workflows/test-dispatcher.md b/.github/workflows/test-dispatcher.md
index 824b8a7..6fc9349 100644
--- a/.github/workflows/test-dispatcher.md
+++ b/.github/workflows/test-dispatcher.md
@@ -14,4 +14,11 @@ safe-outputs:
 # Test Dispatcher Workflow
 
 This workflow demonstrates the dispatch-workflow safe output capability.
-The agent can trigger the test-workflow using the test_workflow tool.
+
+## Instructions
+
+You have access to the `dispatch_workflow` safe output tool that can trigger workflows.
+
+**Your task**: Call the `dispatch_workflow` tool to trigger the `test-workflow` workflow.
+
+**Important**: You MUST use the safe output tool - do NOT write to files or attempt other methods.
-- 
2.52.0

Comments on the Issue (you are @copilot in this section)


💡 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.

- Updated prompt to explicitly instruct agent to call dispatch_workflow tool
- Added clear task description with specific action required
- Added important note to use safe output tool only
- Added instructions section with step-by-step guidance
- Added example JSON showing how to call the tool
- Recompiled workflow to generate updated lock file

The original prompt was too passive, describing what the agent *could* do
rather than what it *should* do. This caused "No Safe Outputs Generated"
errors in workflow runs 21547216704, 21547252198, and others.

Closes #12971

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix test-dispatcher workflow to use safe outputs properly Fix test-dispatcher workflow prompt to explicitly call dispatch_workflow tool Jan 31, 2026
Copilot AI requested a review from pelikhan January 31, 2026 17:45
@pelikhan pelikhan marked this pull request as ready for review January 31, 2026 17:51
@pelikhan pelikhan merged commit 0e66764 into main Jan 31, 2026
@pelikhan pelikhan deleted the copilot/fix-test-dispatcher-workflow branch January 31, 2026 17: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.

Fix test-dispatcher workflow to use safe outputs properly

2 participants