Skip to content

Polish threat detection error warnings - #74177

Merged
pelikhan merged 1 commit into
mainfrom
copilot/improve-threat-detection-error-message
Nov 2, 2026
Merged

pelikhan merged 1 commit into
mainfrom
copilot/improve-threat-detection-error-message

Conversation

Copilot AI commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Generated threat detection errors use an uncapitalized title and dense, repetitive copy. This change improves readability while retaining the distinction between a tooling failure and a security finding.

  • Presentation: Capitalize the title, emphasize it in the message template, and separate it from the explanation.
  • Copy: Shorten the explanation and make the workflow-log link an actionable troubleshooting step.
  • Consistency: Update shared presentation fields, regression expectations, previews, and documentation; preserve warning severity and machine-readable markers.

Copilot AI changed the title Polish threat detection error warnings in generated bodies Polish threat detection error warnings Nov 2, 2026
Copilot AI requested a review from pelikhan November 2, 2026 17:10
@pelikhan
pelikhan marked this pull request as ready for review November 2, 2026 17:16
Copilot AI adaptive review requested due to automatic review settings November 2, 2026 17:16
@github-actions

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

✅ Ponytail Reviewer completed successfully!

Ponytail Reviewer

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

Generated from Ponytail Reviewer · gpt56 · ~7 AIC · ⌖ ~6 AIC · ⊞ 15.1K · ◷

Generated by Ponytail Reviewer for #74177

@github-actions

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Code Quality Reviewer completed the code quality review.

Warning

Threat detection engine error

Threat detection could not complete its analysis due to a tooling error. This is not a security finding.

What happened

The threat detection engine failed to produce results.

Review the workflow run logs to troubleshoot the error.

🔎 Code quality review by PR Code Quality Reviewer

@github-actions

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

Warning

Threat detection engine error

Threat detection could not complete its analysis due to a tooling error. This is not a security finding.

What happened

The threat detection engine failed to produce results.

Review the workflow run logs to troubleshoot the error.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer

@github-actions

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

✅ Design Decision Gate 🏗️ completed the design decision gate check. See the comment below for the result and any generated ADR draft.

Design Decision Gate 🏗️

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

Generated from Design Decision Gate 🏗️ · routed: opus55 medium · ~12 AIC · ⌖ ~2 AIC · ⊞ 7.7K · ◷

🏗️ ADR gate enforced by Design Decision Gate 🏗️

@github-actions

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

✅ Test Quality Sentinel completed test quality analysis.

Warning

Threat detection engine error

Threat detection could not complete its analysis due to a tooling error. This is not a security finding.

What happened

The threat detection engine failed to produce results.

Review the workflow run logs to troubleshoot the error.

Test Quality Sentinel

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

Generated from Test Quality Sentinel · haiku45 · ~6 AIC · ⊞ 9.2K · ◷

🧪 Test quality analysis by Test Quality Sentinel

@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Warning

Threat detection engine error

Threat detection could not complete its analysis due to a tooling error. This is not a security finding.

What happened

The threat detection engine failed to produce results.

Review the workflow run logs to troubleshoot the error.

Comment Memory

Peek at saved memory (pr-code-quality-reviewer)
reviewed_at: 2026-11-02T17:22:00Z
review_event: COMMENT
top_themes:
  - fallback review-PR warning presentation diverges from updated template
files_reviewed:
  - actions/setup/js/threat_detection_warning.cjs
  - actions/setup/md/threat_detection_engine_error.md
  - actions/setup/js/push_to_pull_request_branch.cjs
  - actions/setup/js/messages_run_status.cjs
comment_count: 1

Note

This comment is managed by comment memory.

Expand the saved memory block to view or edit the persistent context for this thread.
Edit only the text inside the backtick fences; workflow metadata and the footer are regenerated automatically.

Learn more about comment memory

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~3 AIC · ⊞ 1.7K · ◷
Comment /review to run again

@github-actions github-actions Bot 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.

Warning

Threat detection engine error

Threat detection could not complete its analysis due to a tooling error. This is not a security finding.

What happened

The threat detection engine failed to produce results.

Review the workflow run logs to troubleshoot the error.

Review summary

One non-blocking consistency issue was identified: the fallback review-PR body does not apply the updated warning presentation used by the shared template. See the inline comment for the surgical fix.

The specialist pass completed; no additional actionable findings were retained.

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~3 AIC · ⊞ 1.7K
Comment /review to run again

admonition: "WARNING",
title: "threat detection engine error",
summary: "The threat detection engine encountered an error and could not complete analysis. This is a tooling failure, not a security finding.",
title: "Threat detection engine error",

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.

The shared title now claims the polished presentation, but the fallback review-PR path renders this value as plain text, so it still omits the new bold emphasis (and retains its separate old log-link wording). This leaves engine-error warnings inconsistent across output surfaces.

💡 Keep fallback output aligned

Update the fallback PR-body formatter (or add a shared formatter) so it applies the same title/summary/link presentation as the template, and add an assertion against the fallback body rather than only checking a substring.

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.

🟡 Changes recommended

Active moderate and critical findings show that the updated warning formatting is not consistently implemented or covered by passing tests, including an unbolded agent-failure request and outdated fallback expectations.

2 open issues
What changed in this PR

This pull request improves the readability and consistency of threat-detection tooling-failure warnings while preserving warning severity and machine-readable distinctions from security findings.

Changes:

  • Capitalizes and emphasizes the tooling-error title.
  • Shortens the explanatory copy and makes workflow-log guidance actionable.
  • Updates specifications, documentation, templates, previews, fixtures, and regression expectations.
  • Two unresolved issues affect fallback review-PR formatting and activation-comment test expectations.
File Description
docs/​src/​content/​docs/​specs/​safe-outputs-specification.md Updates the WTD1a warning specification and expected label.
docs/​src/​content/​docs/​reference/​threat-detection.md Aligns reference documentation with the revised warning label.
actions/​setup/​md/​threat_detection_engine_error.md Revises the shared tooling-error warning template.
actions/​setup/​js/​update_activation_comment.test.cjs Updates activation-comment warning expectations.
actions/​setup/​js/​threat_detection_warning.test.cjs Expands regression coverage for tooling-failure reasons and revised copy.
actions/​setup/​js/​threat_detection_warning.cjs Updates centralized tooling-failure presentation fields.
actions/​setup/​js/​testdata/​messages_preview.md Refreshes generated message and template previews.
actions/​setup/​js/​push_to_pull_request_branch.test.cjs Updates review-PR warning expectations; fallback formatting remains inconsistent.
actions/​setup/​js/​messages.test.cjs Verifies revised warning formatting and troubleshooting guidance.
actions/​setup/​js/​handle_agent_failure.test.cjs Updates the embedded tooling-error template fixture.
actions/​setup/​js/​generate_footer.test.cjs Updates footer warning expectations.

This pull request requires changes.

Review effort: Lite (auto)

}),
it.each([
["agent_failure", "> threat detection engine error", "<!-- gh-aw-threat-engine-error -->", "<!-- gh-aw-threat-detected -->"],
["agent_failure", "> **Threat detection engine error**", "<!-- gh-aw-threat-engine-error -->", "<!-- gh-aw-threat-detected -->"],
Comment on lines +1942 to +1946
["warning", "agent_failure", "> [!WARNING]", "> Threat detection engine error", "<!-- gh-aw-threat-engine-error -->", "<!-- gh-aw-threat-detected -->"],
["warning", "threat_detected", "> [!CAUTION]", "> agentic threat detected", "<!-- gh-aw-threat-detected -->", "<!-- gh-aw-threat-engine-error -->"],
// Warn-mode detection engine failure as concluded by threat-detect v0.5.2 (run 39191157830).
["failure", "agent_failure", "> [!WARNING]", "> threat detection engine error", "<!-- gh-aw-threat-engine-error -->", "<!-- gh-aw-threat-detected -->"],
["failure", "parse_error", "> [!WARNING]", "> threat detection engine error", "<!-- gh-aw-threat-engine-error -->", "<!-- gh-aw-threat-detected -->"],
["failure", "agent_failure", "> [!WARNING]", "> Threat detection engine error", "<!-- gh-aw-threat-engine-error -->", "<!-- gh-aw-threat-detected -->"],
["failure", "parse_error", "> [!WARNING]", "> Threat detection engine error", "<!-- gh-aw-threat-engine-error -->", "<!-- gh-aw-threat-detected -->"],

@github-actions github-actions Bot 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.

Warning

Threat detection engine error

Threat detection could not complete its analysis due to a tooling error. This is not a security finding.

What happened

The threat detection engine failed to produce results.

Review the workflow run logs to troubleshoot the error.

Skills-Based Review 🧠

Applied /codebase-design and /tdd. The copy and centralized presentation changes are consistent, but one engine-error surface was left behind.

📋 Key Themes & Highlights

Key Themes

  • Incomplete surface update: The fallback review PR body in actions/setup/js/push_to_pull_request_branch.cjs (around lines 1554-1560) is built from getThreatWarningPresentation(). It still interpolates an unbolded title with no blank > separator before the summary, and still says "for details". The PR goal of separating the title from the explanation is therefore not met on this path.
  • Title styling lives in two places: The shared title in threat_detection_warning.cjs is plain text, while the markdown templates bold it. Consumers that interpolate title directly (the fallback PR body) inherit the unbolded form. Decide whether the presentation should carry the emphasis, or whether each consumer should apply it.
  • Verification gap: JS dependencies are not installed in this environment, so I checked the changes by reading the diff and the consumers, not by running vitest. The fixture snapshot (messages_preview.md) and string expectations look consistent with the templates.

Positive Highlights

  • ✅ Warning severity and the <!-- gh-aw-threat-engine-error --> marker are preserved, and the real-threat path stays on [!CAUTION].
  • ✅ Centralizing title, summary, and marker in getThreatWarningPresentation and looping agent_failure/parse_error in one test keeps the two tooling reasons in sync.
  • ✅ Docs (threat-detection.md, safe-outputs-specification.md) and the messages_preview snapshot were updated with the new wording.

@copilot please address the review comment above and bring the fallback review PR body in line with the template.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routed: haiku55 xhigh · ~4 AIC · ⊞ 5.4K
Comment /matt to run again


it.each([
["warning", "agent_failure", "> [!WARNING]", "> threat detection engine error", "<!-- gh-aw-threat-engine-error -->", "<!-- gh-aw-threat-detected -->"],
["warning", "agent_failure", "> [!WARNING]", "> Threat detection engine error", "<!-- gh-aw-threat-engine-error -->", "<!-- gh-aw-threat-detected -->"],

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.

[/codebase-design] This expectation locks in an unemphasized > Threat detection engine error title in the fallback review PR body. That body is built in push_to_pull_request_branch.cjs (around lines 1554-1560), which this PR does not update: it still says "for details" and has no bold title or blank > separator, unlike the template and the other engine-error surfaces.

💡 Suggested fix

Emit > **${warning.title}** followed by a > separator line and the same troubleshooting copy as threat_detection_engine_error.md, or build the body from one shared source. Then update this expectation to > **Threat detection engine error** and assert the body does not contain for details.

@copilot please address this.

@pelikhan
pelikhan merged commit 2fe73da into main Nov 2, 2026
91 checks passed
@pelikhan
pelikhan deleted the copilot/improve-threat-detection-error-message branch November 2, 2026 19:03
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v1.2.0

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.

3 participants