Skip to content

Improve inline suggestion instructions for build failure analyst agent#8392

Merged
Evangelink merged 1 commit into
mainfrom
ykovalova/fix-inline-suggestions
May 20, 2026
Merged

Improve inline suggestion instructions for build failure analyst agent#8392
Evangelink merged 1 commit into
mainfrom
ykovalova/fix-inline-suggestions

Conversation

@YuliiaKovalova
Copy link
Copy Markdown
Contributor

@YuliiaKovalova YuliiaKovalova commented May 20, 2026

Summary

Improves the inline code fix suggestion instructions in the build-failure-analyst agent to ensure suggestions render correctly with the "Commit suggestion" button.

Changes to .github/agents/build-failure-analyst.agent.md

Step 6 — Post inline suggestions now includes:

  • Skip patch metadata lines: \ No newline at end of file markers in diffs are not code lines — the agent must skip them when determining which lines are "in the diff"
  • Exact replacement format: suggestion blocks must contain the exact replacement line(s) with original indentation, no file names, line numbers, or other prefixes
  • Multi-line suggestions: multiple replacement lines go in a single suggestion block (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:

  1. Patch metadata lines caused off-by-one errors in diff line computation
  2. The suggestion block contained extra formatting beyond raw replacement code

Copilot AI review requested due to automatic review settings May 20, 2026 14:25
@YuliiaKovalova YuliiaKovalova marked this pull request as ready for review May 20, 2026 14:27
@YuliiaKovalova YuliiaKovalova marked this pull request as draft May 20, 2026 14:28
@YuliiaKovalova YuliiaKovalova force-pushed the ykovalova/fix-inline-suggestions branch 2 times, most recently from 9321516 to cf6888b Compare May 20, 2026 14:33
@YuliiaKovalova YuliiaKovalova changed the title Fix inline suggestions: use position-based API and clarify LLM prompt Fix inline suggestions and improve comment handling in build failure analysis May 20, 2026
@YuliiaKovalova YuliiaKovalova marked this pull request as ready for review May 20, 2026 14:45
Copy link
Copy Markdown
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

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.js and 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.

Comment thread .github/workflows/scripts/post-suggestions.js Outdated
Comment thread .github/workflows/scripts/post-suggestions.js Outdated
Comment thread .github/workflows/scripts/post-suggestions.js Outdated
Comment thread .github/workflows/build-failure-analysis.yml Outdated
Copilot AI review requested due to automatic review settings May 20, 2026 15:16
@YuliiaKovalova YuliiaKovalova review requested due to automatic review settings May 20, 2026 15:39
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>
Copilot AI review requested due to automatic review settings May 20, 2026 15:45
@YuliiaKovalova YuliiaKovalova force-pushed the ykovalova/fix-inline-suggestions branch from fb4bb44 to b512dda Compare May 20, 2026 15:45
@YuliiaKovalova YuliiaKovalova changed the title Fix inline suggestions and improve comment handling in build failure analysis Improve inline suggestion instructions for build failure analyst agent May 20, 2026
Copy link
Copy Markdown
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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@Evangelink Evangelink merged commit 70cec8b into main May 20, 2026
24 checks passed
@Evangelink Evangelink deleted the ykovalova/fix-inline-suggestions branch May 20, 2026 16:21
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.

3 participants