Skip to content

Report missing_data safe output calls in agent failure issues#13709

Merged
pelikhan merged 3 commits intomainfrom
copilot/report-missing-data-output
Feb 4, 2026
Merged

Report missing_data safe output calls in agent failure issues#13709
pelikhan merged 3 commits intomainfrom
copilot/report-missing-data-output

Conversation

Copy link
Contributor

Copilot AI commented Feb 4, 2026

Agent workflows calling missing_data safe output had this diagnostic information silently dropped in conclusion job failure reports, making debugging failures unnecessarily difficult.

Changes

Core logic (handle_agent_failure.cjs):

  • loadMissingDataMessages() - extracts missing_data from agent output file
  • buildMissingDataContext() - formats using existing formatMissingData() helper
  • Added missing_data_context to both issue and comment template contexts

Templates:

  • agent_failure_issue.md and agent_failure_comment.md now include {missing_data_context} placeholder

Test coverage:

  • Added test validating missing_data appears in failure issues with all fields (data_type, reason, context, alternatives)

Output

Failure issues now include:

⚠️ Missing Data Reported: The agent reported missing data during execution.

Missing Data:
- **GitHub API token**: Required for accessing private repositories
  - *Context*: Workflow needs to read issues from private repo
  - *Alternatives*: Use a personal access token or GitHub App
Original prompt

Reference: https://github.com/github/gh-aw/actions/runs/21670892296/job/62478236480#step:24:1

A call to missing data safe outout should be reported in the agent failure issue/comment in the conclusion job

Custom agent used: agentic-workflows
GitHub Agentic Workflows (gh-aw) - Create, debug, and upgrade AI-powered workflows with intelligent prompt routing


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

Copilot AI and others added 2 commits February 4, 2026 12:38
- Add buildMissingDataContext() function to load and format missing_data messages
- Import formatMissingData from missing_info_formatter
- Update handle_agent_failure.cjs to include missing_data_context in both issue and comment templates
- Update agent_failure_issue.md and agent_failure_comment.md templates to include {missing_data_context} placeholder
- Add comprehensive test for missing_data reporting functionality
- Update test mocks to include missing_data_context placeholder

This ensures that when an agent calls the missing_data safe output, the information is reported in the failure issue/comment created by the conclusion job, making it easier to diagnose and debug workflow failures.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
- Wrap cleanup code in try-catch to prevent cleanup errors from failing the test
- Address code review feedback about proper cleanup in test cases

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Report missing data safe output in agent failure comment Report missing_data safe output calls in agent failure issues Feb 4, 2026
Copilot AI requested a review from pelikhan February 4, 2026 12:44
@pelikhan pelikhan marked this pull request as ready for review February 4, 2026 12:50
Copilot AI review requested due to automatic review settings February 4, 2026 12:50
@pelikhan pelikhan merged commit af116a3 into main Feb 4, 2026
6 of 7 checks passed
@pelikhan pelikhan deleted the copilot/report-missing-data-output branch February 4, 2026 12:50
Copy link
Contributor

Copilot AI left a comment

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 adds support for reporting missing_data safe output calls in agent workflow failure issues and comments, improving diagnostic information for debugging failed workflows.

Changes:

  • Added loadMissingDataMessages() and buildMissingDataContext() functions to extract and format missing_data from agent output
  • Updated agent_failure_issue.md and agent_failure_comment.md templates to include {missing_data_context} placeholder
  • Added comprehensive test coverage validating missing_data appears in failure issues with all expected fields

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
actions/setup/js/handle_agent_failure.cjs Added functions to load and format missing_data messages from agent output, integrated into both issue and comment creation flows
actions/setup/md/agent_failure_issue.md Added {missing_data_context} placeholder to template
actions/setup/md/agent_failure_comment.md Added {missing_data_context} placeholder to template
actions/setup/js/handle_agent_failure.test.cjs Added comprehensive test validating missing_data appears in failure issues with all fields (data_type, reason, context, alternatives)

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

// Clean up temp file (use try-catch to ensure cleanup doesn't fail test)
try {
fs.unlinkSync(agentOutputPath);
fs.rmdirSync(tempDir);
Copy link

Copilot AI Feb 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The cleanup logic uses fs.rmdirSync() which only removes empty directories. Since the directory should only contain agent_output.json which is deleted on line 1278, this should work. However, consider using fs.rmSync(tempDir, { recursive: true }) (available in Node.js 14.14.0+) for more robust cleanup that doesn't rely on the directory being empty.

Suggested change
fs.rmdirSync(tempDir);
fs.rmSync(tempDir, { recursive: true, force: true });

Copilot uses AI. Check for mistakes.
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

Comments