Standardize agent failure warnings on GitHub alert callouts#37430
Merged
Conversation
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
pelikhan
approved these changes
Jun 6, 2026
Contributor
There was a problem hiding this comment.
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 inhandle_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})`; | ||
| } |
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.
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
handle_agent_failure.cjsto emit warning blocks as GitHub callouts.Template alignment
actions/setup/md/tool_denials_exceeded_context.mdto use> [!WARNING]format so template-based and fallback paths render consistently.Output consistency cleanup