Improve inline suggestion instructions for build failure analyst agent#8392
Merged
Conversation
9321516 to
cf6888b
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Updates the build failure analysis workflow to improve reliability of inline fix suggestions and reduce comment noise by updating an existing PR comment in-place.
Changes:
- Reworks diff parsing in
post-suggestions.jsand clarifies the LLM prompt to prevent confusing “error index” with “line number”. - Switches from posting individual review comments to posting a single PR review with multiple inline comments.
- Updates the workflow to update an existing “Build Failure Analysis” PR comment instead of deleting/recreating it.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| .github/workflows/scripts/post-suggestions.js | Adjusts patch parsing, clarifies the LLM prompt, and changes posting behavior to a single PR review with inline suggestions. |
| .github/workflows/build-failure-analysis.yml | Updates PR comment publishing to edit an existing marker comment in-place to avoid duplicates/extra notifications. |
Adds clearer guidance for posting inline code fix suggestions: - Skip '\ No newline at end of file' markers when computing diff lines - Suggestion blocks must contain exact replacement code with original indentation, no prefixes or suffixes - Multi-line suggestions go in a single suggestion block - Explicit formatting rules to ensure 'Commit suggestion' button works Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
fb4bb44 to
b512dda
Compare
Evangelink
approved these changes
May 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Improves the inline code fix suggestion instructions in the
build-failure-analystagent to ensure suggestions render correctly with the "Commit suggestion" button.Changes to
.github/agents/build-failure-analyst.agent.mdStep 6 — Post inline suggestions now includes:
\ No newline at end of filemarkers in diffs are not code lines — the agent must skip them when determining which lines are "in the diff"suggestionblock (replaces the targeted line)Why
When testing the build failure analysis workflow end-to-end (via a simulation PR in dotnet/dotnet#6711), we discovered that inline suggestions would fail or render incorrectly when: