Skip to content

Standardize agent failure warnings on GitHub alert callouts#37430

Merged
pelikhan merged 2 commits into
mainfrom
copilot/fix-daily-formal-spec-verifier
Jun 6, 2026
Merged

Standardize agent failure warnings on GitHub alert callouts#37430
pelikhan merged 2 commits into
mainfrom
copilot/fix-daily-formal-spec-verifier

Conversation

Copilot AI commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Daily Formal Spec Verifier failure reports were emitting custom ⚠️ warning headings in issue/comment bodies, which conflicts with the requested GitHub-native alert style. This update switches failure-warning rendering to GitHub alert syntax across the agent-failure pipeline.

  • Failure warning rendering

    • Added a shared formatter in handle_agent_failure.cjs to emit warning blocks as GitHub callouts.
    • Replaced custom warning-heading strings in major failure contexts (missing tools/data, engine failure, tool-denial threshold, assignment/validation/safe-output/secret verification, code push, repo-memory push).
  • Template alignment

    • Updated actions/setup/md/tool_denials_exceeded_context.md to use > [!WARNING] format so template-based and fallback paths render consistently.
  • Output consistency cleanup

    • Removed remaining warning emoji markers from PR-state warning bullets inside code-push failure context to avoid mixed warning styles.
> [!WARNING]
> **Missing Tools Reported**: The agent reported missing tools during execution.

Copilot AI linked an issue Jun 6, 2026 that may be closed by this pull request
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix daily formal spec verifier missing tools issue Standardize agent failure warnings on GitHub alert callouts Jun 6, 2026
Copilot AI requested a review from pelikhan June 6, 2026 22:45
@pelikhan pelikhan marked this pull request as ready for review June 6, 2026 22:48
Copilot AI review requested due to automatic review settings June 6, 2026 22:48
@pelikhan pelikhan merged commit f659e52 into main Jun 6, 2026
@pelikhan pelikhan deleted the copilot/fix-daily-formal-spec-verifier branch June 6, 2026 22:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 standardizes agent-failure warning output to use GitHub-native markdown alert callouts (> [!WARNING]) instead of custom bold headings with ⚠️, improving consistency across failure contexts and templates.

Changes:

  • Added a shared buildWarningAlertLine() helper to render warning callouts in handle_agent_failure.cjs.
  • Updated multiple agent-failure contexts (engine failure, missing tools/data, tool-denials exceeded, assignment/validation/safe-output/secret verification, code-push, repo-memory push) to use the callout format.
  • Aligned the tool-denials exceeded markdown template and updated tests to assert the new callout rendering.
Show a summary per file
File Description
actions/setup/md/tool_denials_exceeded_context.md Switches the tool-denials context template to GitHub warning callouts.
actions/setup/js/handle_agent_failure.test.cjs Updates assertions to expect warning callouts and removes expectations for emoji-style headings.
actions/setup/js/handle_agent_failure.cjs Introduces a shared warning-callout formatter and replaces emoji warning headings across failure contexts.

Copilot's findings

Tip

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

  • Files reviewed: 3/3 changed files
  • Comments generated: 5

Comment on lines +1157 to 1160
buildWarningAlertLine("Excessive Tool Denials", `The Copilot SDK stopped the session after ${denialCount}/${threshold} permission denials.`) +
`**Last denied request:** \`${reason}\`\n\n` +
"This is a guardrail stop (`guard.tool_denials_exceeded`) and indicates the workflow's allowed tool set does not match the prompt's requested actions.\n"
);
Comment on lines +2625 to 2628
repoMemoryValidationContext = buildWarningAlertLine("Repo-Memory Validation Failed", "Invalid file types detected in repo-memory.");
if (pullRequest) {
repoMemoryValidationContext += `\n\n**Pull Request:** [#${pullRequest.number}](${pullRequest.html_url})`;
}
Comment on lines +2655 to 2658
missingSafeOutputsContext = buildWarningAlertLine("No Safe Outputs Generated", "The agent job succeeded but did not produce any safe outputs.");
if (pullRequest) {
missingSafeOutputsContext += `\n\n**Pull Request:** [#${pullRequest.number}](${pullRequest.html_url})`;
}
Comment on lines +2845 to 2848
repoMemoryValidationContext = buildWarningAlertLine("Repo-Memory Validation Failed", "Invalid file types detected in repo-memory.");
if (pullRequest) {
repoMemoryValidationContext += `\n\n**Pull Request:** [#${pullRequest.number}](${pullRequest.html_url})`;
}
Comment on lines +2876 to 2879
missingSafeOutputsContext = buildWarningAlertLine("No Safe Outputs Generated", "The agent job succeeded but did not produce any safe outputs.");
if (pullRequest) {
missingSafeOutputsContext += `\n\n**Pull Request:** [#${pullRequest.number}](${pullRequest.html_url})`;
}
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.

[aw] Daily Formal Spec Verifier failed

3 participants