Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 11, 2026

Agent failure messages displayed the workflow source path (which is often empty or unhelpful) instead of linking to the associated pull request.

Changes

Enhanced failure detection

  • Added findPullRequestForCurrentBranch() to resolve PR via GitHub search API using current branch name
  • Conditionally includes PR link in failure issue body when found

Simplified template

  • Removed empty "Source" field from agent_failure_issue.md
  • Added pull_request_info placeholder that renders as - **Pull Request:** [#99](url) when PR exists

Test coverage

  • Updated all tests to mock the new PR search call
  • Added tests for PR found/not found scenarios

Example output

When a PR exists:

## Failed Run

- **Workflow:** [Test Workflow](url)
- **Failed Run:** https://github.com/owner/repo/actions/runs/123
- **Pull Request:** [#99](https://github.com/owner/repo/pull/99)

When no PR exists, the PR line is omitted entirely.

Original prompt

The JavaScript code that generates the "agentic workflow failed" message should also try to resolve the pull request from the current branch and add it to the message template.
The "source" field is empty, remove from template.


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

- Add findPullRequestForCurrentBranch() function to resolve PR from current branch
- Update template to include PR information when available
- Remove "source" field from agent_failure_issue.md template
- Update all tests to account for new PR search API call
- Add tests for PR found/not found scenarios

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@pelikhan
Copy link
Contributor

@copilot conclusion need pull request read permissions too

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Update agentic workflow error message template Resolve PR from current branch in agent failure messages Jan 11, 2026
Copilot AI requested a review from pelikhan January 11, 2026 17:41
Copy link
Contributor Author

Copilot AI commented Jan 11, 2026

@copilot conclusion need pull request read permissions too

The conclusion job already has pull-requests: write permission (set at line 339 in pkg/workflow/notify_comment.go via NewPermissionsContentsReadIssuesWritePRWriteDiscussionsWrite()), which includes read access needed for the PR search functionality in handle_agent_failure.cjs.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 11, 2026

🎉 Yo ho ho! Changeset Generator found the treasure and completed successfully! ⚓💰

@github-actions
Copy link
Contributor

github-actions bot commented Jan 11, 2026

📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤

@github-actions
Copy link
Contributor

github-actions bot commented Jan 11, 2026

✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟

@github-actions
Copy link
Contributor

github-actions bot commented Jan 11, 2026

🎬 THE ENDSmoke Claude MISSION: ACCOMPLISHED! The hero saves the day! ✨

@pelikhan pelikhan marked this pull request as ready for review January 11, 2026 18:01
@github-actions
Copy link
Contributor

Smoke Test Results

Last 2 merged PRs:

Test Results:

  • ✅ GitHub MCP: List PRs successful
  • ✅ Playwright: Navigate to github.com, title verified
  • ✅ File Writing: Created test file successfully
  • ✅ Bash: Read file back successfully
  • ✅ Go tool: go version returned 1.25.0

Overall Status: PASS

AI generated by Smoke Claude

@pelikhan pelikhan merged commit 2317713 into main Jan 11, 2026
75 checks passed
@pelikhan pelikhan deleted the copilot/update-error-message-template branch January 11, 2026 18:05
Sign up for free to 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.

2 participants