OpenVINO™ is an open source toolkit for optimizing and deploying AI inference
C++ aicomputer-visiondeep-learningdeploy-aidiffusion-modelsgenerative-aigood-first-issueinferencellm-inferencenatural-language-processingnlpopenvinooptimize-aiperformance-boostrecommendation-systemspeech-recognitionstable-diffusiontransformersyolo
[CI] [GHA] Post a PR comment based on CI Doctor analysis (#36566)
Andrei Kashchikhinb8a1c7e88f4b
diff --git a/.github/workflows/ci-doctor-mq.lock.yml b/.github/workflows/ci-doctor-mq.lock.ymlindex 9ecefab92d6..91785aff3e6 100644--- a/.github/workflows/ci-doctor-mq.lock.yml+++ b/.github/workflows/ci-doctor-mq.lock.yml@@ -1,4 +1,4 @@-# gh-aw-metadata: {"schema_version":"v4","frontmatter_hash":"ea4e58654f04b7f27429474b50ef6852bce8d383829f7e3b9e2208620cfb10bb","body_hash":"b71c60bf64545cc9e292ee949985b200fc1874a943e8ed620c2078a225f03889","compiler_version":"v0.80.9","strict":true,"agent_id":"copilot","agent_model":"claude-sonnet-4.6","engine_versions":{"copilot":"1.0.63"}}+# gh-aw-metadata: {"schema_version":"v4","frontmatter_hash":"23f872c6f93afc55589d23d58643af25c69d7d53c070e7238aa197b9d0fce1b1","body_hash":"9ae9e887a00565c9cbd695bca7158ba4d4d0c3776297b463c79cdf7231e7bba7","compiler_version":"v0.80.9","strict":true,"agent_id":"copilot","agent_model":"claude-sonnet-4.6","engine_versions":{"copilot":"1.0.63"}}# gh-aw-manifest: {"version":1,"secrets":["COPILOT_GITHUB_TOKEN","GH_AW_GITHUB_MCP_SERVER_TOKEN","GH_AW_GITHUB_TOKEN","GITHUB_TOKEN","TEAMS_WEBHOOK_URL"],"actions":[{"repo":"actions/cache/restore","sha":"27d5ce7f107fe9357f9df03efb73ab90386fccae","version":"v5.0.5"},{"repo":"actions/cache/save","sha":"27d5ce7f107fe9357f9df03efb73ab90386fccae","version":"v5.0.5"},{"repo":"actions/checkout","sha":"9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0","version":"v7.0.0"},{"repo":"actions/download-artifact","sha":"3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c","version":"v8.0.1"},{"repo":"actions/github-script","sha":"3a2844b7e9c422d3c10d287c895573f7108da1b3","version":"v9.0.0"},{"repo":"actions/setup-node","sha":"48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e","version":"v6.4.0"},{"repo":"actions/upload-artifact","sha":"043fb46d1a93c77aae656e7c1c64a875d1fc6a0a","version":"v7.0.1"},{"repo":"github/gh-aw-actions/setup","sha":"8c7d04ebf1ece56cd381446125da3e0f6896294a","version":"v0.80.9"}],"containers":[{"image":"ghcr.io/github/gh-aw-firewall/agent:0.27.7","digest":"sha256:aae231e4635c8999d039c132f1602d3df850fe9b84a00aa2b5ac981179b5661c","pinned_image":"ghcr.io/github/gh-aw-firewall/agent:0.27.7@sha256:aae231e4635c8999d039c132f1602d3df850fe9b84a00aa2b5ac981179b5661c"},{"image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.27.7","digest":"sha256:009caf2e3d88fa77b64e9a03a95a228fc58db0f1701c6d324b29ba5a3c7c79b6","pinned_image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.27.7@sha256:009caf2e3d88fa77b64e9a03a95a228fc58db0f1701c6d324b29ba5a3c7c79b6"},{"image":"ghcr.io/github/gh-aw-firewall/squid:0.27.7","digest":"sha256:deb1d4e19de62d51cee0508057a596a19315c3423ada4d675cad136dc8037c96","pinned_image":"ghcr.io/github/gh-aw-firewall/squid:0.27.7@sha256:deb1d4e19de62d51cee0508057a596a19315c3423ada4d675cad136dc8037c96"},{"image":"ghcr.io/github/gh-aw-mcpg:v0.3.27","digest":"sha256:fe984bddde4ec05d756d9043edb0a32912e6b7b72f6a121b1082f29221421cc7","pinned_image":"ghcr.io/github/gh-aw-mcpg:v0.3.27@sha256:fe984bddde4ec05d756d9043edb0a32912e6b7b72f6a121b1082f29221421cc7"},{"image":"ghcr.io/github/gh-aw-node","digest":"sha256:529d02eb970b1161aa25c593a9c3df57fdfad5a8add328cb3b6eccef66f3183b","pinned_image":"ghcr.io/github/gh-aw-node@sha256:529d02eb970b1161aa25c593a9c3df57fdfad5a8add328cb3b6eccef66f3183b"},{"image":"ghcr.io/github/github-mcp-server:v1.4.0","digest":"sha256:2afb26356481d1a350e14544a6e160f7f7ec1561a1ea309b823665abf0309036","pinned_image":"ghcr.io/github/github-mcp-server:v1.4.0@sha256:2afb26356481d1a350e14544a6e160f7f7ec1561a1ea309b823665abf0309036"}]}# This file was automatically generated by gh-aw (v0.80.9). DO NOT EDIT. To debug this workflow, load the skill at https://github.com/github/gh-aw/blob/main/debug.md#@@ -71,8 +71,6 @@ on:required: falseworkflow_run:# zizmor: ignore[dangerous-triggers] - workflow_run trigger is secured with role and fork validation- branches:- - mastertypes:- completedworkflows:@@ -284,21 +282,21 @@ jobs:run: |bash "${RUNNER_TEMP}/gh-aw/actions/create_prompt_first.sh"{- cat << 'GH_AW_PROMPT_897600623b8c28da_EOF'+ cat << 'GH_AW_PROMPT_5a82c7401dd3ed09_EOF'<system>- GH_AW_PROMPT_897600623b8c28da_EOF+ GH_AW_PROMPT_5a82c7401dd3ed09_EOFcat "${RUNNER_TEMP}/gh-aw/prompts/xpia.md"cat "${RUNNER_TEMP}/gh-aw/prompts/temp_folder_prompt.md"cat "${RUNNER_TEMP}/gh-aw/prompts/markdown.md"cat "${RUNNER_TEMP}/gh-aw/prompts/repo_memory_prompt.md"cat "${RUNNER_TEMP}/gh-aw/prompts/safe_outputs_prompt.md"- cat << 'GH_AW_PROMPT_897600623b8c28da_EOF'+ cat << 'GH_AW_PROMPT_5a82c7401dd3ed09_EOF'<safe-output-tools>- Tools: missing_tool, missing_data, noop, notify_teams, notify_teams_recurring+ Tools: add_comment, missing_tool, missing_data, noop, notify_teams, notify_teams_recurring</safe-output-tools>- GH_AW_PROMPT_897600623b8c28da_EOF+ GH_AW_PROMPT_5a82c7401dd3ed09_EOFcat "${RUNNER_TEMP}/gh-aw/prompts/mcp_cli_tools_prompt.md"- cat << 'GH_AW_PROMPT_897600623b8c28da_EOF'+ cat << 'GH_AW_PROMPT_5a82c7401dd3ed09_EOF'<github-context>The following GitHub context information is available for this workflow:{{#if github.actor}}@@ -327,12 +325,12 @@ jobs:{{/if}}</github-context>- GH_AW_PROMPT_897600623b8c28da_EOF+ GH_AW_PROMPT_5a82c7401dd3ed09_EOFcat "${RUNNER_TEMP}/gh-aw/prompts/github_mcp_tools_with_safeoutputs_prompt.md"- cat << 'GH_AW_PROMPT_897600623b8c28da_EOF'+ cat << 'GH_AW_PROMPT_5a82c7401dd3ed09_EOF'</system>{{#runtime-import .github/workflows/ci-doctor-mq.md}}- GH_AW_PROMPT_897600623b8c28da_EOF+ GH_AW_PROMPT_5a82c7401dd3ed09_EOF} > "$GH_AW_PROMPT"- name: Interpolate variables and render templatesuses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0@@ -584,14 +582,16 @@ jobs:mkdir -p "${RUNNER_TEMP}/gh-aw/safeoutputs"mkdir -p /tmp/gh-aw/safeoutputsmkdir -p /tmp/gh-aw/mcp-logs/safeoutputs- cat > "${RUNNER_TEMP}/gh-aw/safeoutputs/config.json" << 'GH_AW_SAFE_OUTPUTS_CONFIG_744969f73a55742a_EOF'- {"create_report_incomplete_issue":{},"missing_data":{},"missing_tool":{},"noop":{"max":1,"report-as-issue":"true"},"notify-teams":{"description":"Send a CI failure investigation summary to Microsoft Teams. Call this exactly once at the end of the investigation with a concise title and a thorough description of the failure.","inputs":{"author":{"default":"not_found","description":"GitHub login of the PR author or commit author, if known. Omit otherwise.","required":false,"type":"string"},"db_entries":{"default":null,"description":"Total number of unique entries currently in the CI Doctor MQ investigation database (count of distinct investigation files under /tmp/gh-aw/repo-memory/default/mq/investigations/, including the one created by this run). Report as a non-negative integer encoded as a string.","required":true,"type":"string"},"description":{"default":null,"description":"Thorough markdown description of the problem: root cause, failed jobs, key error messages, and recommended actions.","required":true,"type":"string"},"failed_workflow":{"default":null,"description":"Name of the GitHub Actions workflow that failed (as reported by `get_workflow_run`, e.g. 'Linux (Ubuntu 22.04, Python 3.11)'). Do NOT pass the CI Doctor MQ workflow name.","required":true,"type":"string"},"occurrence_count":{"default":null,"description":"How many times this same issue has been recorded in the CI Doctor MQ database, including the current investigation. Compute by matching the current failure signature (e.g., normalized error message, failed job name, failure category) against prior investigation/pattern files under /tmp/gh-aw/repo-memory/default/mq/. Must be \u003e= 1. Report as a positive integer encoded as a string.","required":true,"type":"string"},"pipeline_url":{"default":null,"description":"URL of the failed GitHub Actions workflow run.","required":true,"type":"string"},"pr_number":{"default":"not_found","description":"Pull request number if the failure is associated with a PR in the merge queue. Omit otherwise.","required":false,"type":"string"},"pr_url":{"default":"not_found","description":"Pull request URL if the failure is associated with a PR in the merge queue. Omit otherwise.","required":false,"type":"string"},"statistics":{"default":null,"description":"Markdown-formatted statistics summary of the CI Doctor MQ pattern database. Must include a table (or list) of every known failure pattern with: pattern signature/title, total reproduction count, first-seen timestamp (UTC, ISO 8601), and last-seen timestamp (UTC, ISO 8601). Sort patterns by reproduction count descending. Compute from files under /tmp/gh-aw/repo-memory/default/mq/investigations/ and /tmp/gh-aw/repo-memory/default/mq/patterns/. Keep concise (top 20 patterns max). Use the rendering rules from the description field (tilde fences, no raw HTML).","required":true,"type":"string"},"statistics_json":{"default":null,"description":"Full statistics database serialized as a compact JSON string. Must be a JSON object of the form {\"generated_at\": \u003cISO8601 UTC\u003e, \"total_patterns\": \u003cint\u003e, \"total_investigations\": \u003cint\u003e, \"patterns\": [{\"signature\": \u003cstr\u003e, \"title\": \u003cstr\u003e, \"category\": \u003cstr\u003e, \"count\": \u003cint\u003e, \"first_seen\": \u003cISO8601 UTC\u003e, \"last_seen\": \u003cISO8601 UTC\u003e, \"recent_run_urls\": [\u003cstr\u003e, ...]}]}. Include ALL known patterns, not just the top N. This payload is uploaded as a workflow artifact for offline analysis.","required":true,"type":"string"},"title":{"default":null,"description":"Short, searchable description of the failure (e.g. 'smoke_Bucketize tests fail on comparison'). No PR/run numbers.","required":true,"type":"string"}},"output":"Notification sent to Microsoft Teams."},"notify-teams-recurring":{"description":"Send a recurring merge-queue failure escalation alert to Microsoft Teams. Call this ONLY when the same failure pattern has 3 or more occurrences in the last 12 hours. Do NOT call this for every failure.","inputs":{"affected_prs":{"default":null,"description":"Markdown-formatted list of affected PR numbers/links from the merge queue that hit this failure in the last 12 hours. One PR per line, e.g. '- [#1234](https://github.com/org/repo/pull/1234)'. Include up to 10 most recent PRs.","required":true,"type":"string"},"description":{"default":null,"description":"Concise markdown gist of the recurring problem: what keeps failing, suspected root cause, and recommended escalation actions. Use Teams-safe markdown only (no raw HTML).","required":true,"type":"string"},"failed_workflow":{"default":null,"description":"Name of the GitHub Actions workflow with the recurring failure.","required":true,"type":"string"},"pipeline_url":{"default":null,"description":"URL of the current (latest) failed workflow run.","required":true,"type":"string"},"recent_count":{"default":null,"description":"Number of times this failure pattern has occurred in the last 12 hours, including the current run. Report as a positive integer encoded as a string (e.g., '3', '5').","required":true,"type":"string"},"recent_run_urls":{"default":null,"description":"Markdown-formatted list of workflow run URLs that exhibited this failure in the last 12 hours. One URL per line, e.g. '- [Run 12345](https://github.com/org/repo/actions/runs/12345)'. Include up to 10 most recent runs.","required":true,"type":"string"},"title":{"default":null,"description":"Short, searchable description of the recurring failure pattern (same as notify_teams.title).","required":true,"type":"string"}},"output":"Recurring failure escalation sent to Microsoft Teams."},"push_repo_memory":{"memories":[{"dir":"/tmp/gh-aw/repo-memory/default","id":"default","max_file_count":500,"max_file_size":1048576,"max_patch_size":1048576}]},"report_incomplete":{}}- GH_AW_SAFE_OUTPUTS_CONFIG_744969f73a55742a_EOF+ cat > "${RUNNER_TEMP}/gh-aw/safeoutputs/config.json" << 'GH_AW_SAFE_OUTPUTS_CONFIG_b6887d43904fc059_EOF'+ {"add_comment":{"max":1,"target":"*"},"create_report_incomplete_issue":{},"missing_data":{},"missing_tool":{},"noop":{"max":1,"report-as-issue":"true"},"notify-teams":{"description":"Send a CI failure investigation summary to Microsoft Teams. Call this exactly once at the end of the investigation with a concise title and a thorough description of the failure.","inputs":{"author":{"default":"not_found","description":"GitHub login of the PR author or commit author, if known. Omit otherwise.","required":false,"type":"string"},"db_entries":{"default":null,"description":"Total number of unique entries currently in the CI Doctor MQ investigation database (count of distinct investigation files under /tmp/gh-aw/repo-memory/default/mq/investigations/, including the one created by this run). Report as a non-negative integer encoded as a string.","required":true,"type":"string"},"description":{"default":null,"description":"Thorough markdown description of the problem: root cause, failed jobs, key error messages, and recommended actions.","required":true,"type":"string"},"failed_workflow":{"default":null,"description":"Name of the GitHub Actions workflow that failed (as reported by `get_workflow_run`, e.g. 'Linux (Ubuntu 22.04, Python 3.11)'). Do NOT pass the CI Doctor MQ workflow name.","required":true,"type":"string"},"occurrence_count":{"default":null,"description":"How many times this same issue has been recorded in the CI Doctor MQ database, including the current investigation. Compute by matching the current failure signature (e.g., normalized error message, failed job name, failure category) against prior investigation/pattern files under /tmp/gh-aw/repo-memory/default/mq/. Must be \u003e= 1. Report as a positive integer encoded as a string.","required":true,"type":"string"},"pipeline_url":{"default":null,"description":"URL of the failed GitHub Actions workflow run.","required":true,"type":"string"},"pr_number":{"default":"not_found","description":"Pull request number if the failure is associated with a PR in the merge queue. Omit otherwise.","required":false,"type":"string"},"pr_url":{"default":"not_found","description":"Pull request URL if the failure is associated with a PR in the merge queue. Omit otherwise.","required":false,"type":"string"},"statistics":{"default":null,"description":"Markdown-formatted statistics summary of the CI Doctor MQ pattern database. Must include a table (or list) of every known failure pattern with: pattern signature/title, total reproduction count, first-seen timestamp (UTC, ISO 8601), and last-seen timestamp (UTC, ISO 8601). Sort patterns by reproduction count descending. Compute from files under /tmp/gh-aw/repo-memory/default/mq/investigations/ and /tmp/gh-aw/repo-memory/default/mq/patterns/. Keep concise (top 20 patterns max). Use the rendering rules from the description field (tilde fences, no raw HTML).","required":true,"type":"string"},"statistics_json":{"default":null,"description":"Full statistics database serialized as a compact JSON string. Must be a JSON object of the form {\"generated_at\": \u003cISO8601 UTC\u003e, \"total_patterns\": \u003cint\u003e, \"total_investigations\": \u003cint\u003e, \"patterns\": [{\"signature\": \u003cstr\u003e, \"title\": \u003cstr\u003e, \"category\": \u003cstr\u003e, \"count\": \u003cint\u003e, \"first_seen\": \u003cISO8601 UTC\u003e, \"last_seen\": \u003cISO8601 UTC\u003e, \"recent_run_urls\": [\u003cstr\u003e, ...]}]}. Include ALL known patterns, not just the top N. This payload is uploaded as a workflow artifact for offline analysis.","required":true,"type":"string"},"title":{"default":null,"description":"Short, searchable description of the failure (e.g. 'smoke_Bucketize tests fail on comparison'). No PR/run numbers.","required":true,"type":"string"}},"output":"Notification sent to Microsoft Teams."},"notify-teams-recurring":{"description":"Send a recurring merge-queue failure escalation alert to Microsoft Teams. Call this ONLY when the same failure pattern has 3 or more occurrences in the last 12 hours. Do NOT call this for every failure.","inputs":{"affected_prs":{"default":null,"description":"Markdown-formatted list of affected PR numbers/links from the merge queue that hit this failure in the last 12 hours. One PR per line, e.g. '- [#1234](https://github.com/org/repo/pull/1234)'. Include up to 10 most recent PRs.","required":true,"type":"string"},"description":{"default":null,"description":"Concise markdown gist of the recurring problem: what keeps failing, suspected root cause, and recommended escalation actions. Use Teams-safe markdown only (no raw HTML).","required":true,"type":"string"},"failed_workflow":{"default":null,"description":"Name of the GitHub Actions workflow with the recurring failure.","required":true,"type":"string"},"pipeline_url":{"default":null,"description":"URL of the current (latest) failed workflow run.","required":true,"type":"string"},"recent_count":{"default":null,"description":"Number of times this failure pattern has occurred in the last 12 hours, including the current run. Report as a positive integer encoded as a string (e.g., '3', '5').","required":true,"type":"string"},"recent_run_urls":{"default":null,"description":"Markdown-formatted list of workflow run URLs that exhibited this failure in the last 12 hours. One URL per line, e.g. '- [Run 12345](https://github.com/org/repo/actions/runs/12345)'. Include up to 10 most recent runs.","required":true,"type":"string"},"title":{"default":null,"description":"Short, searchable description of the recurring failure pattern (same as notify_teams.title).","required":true,"type":"string"}},"output":"Recurring failure escalation sent to Microsoft Teams."},"push_repo_memory":{"memories":[{"dir":"/tmp/gh-aw/repo-memory/default","id":"default","max_file_count":500,"max_file_size":1048576,"max_patch_size":1048576}]},"report_incomplete":{}}+ GH_AW_SAFE_OUTPUTS_CONFIG_b6887d43904fc059_EOF- name: Generate Safe Outputs Toolsenv:GH_AW_TOOLS_META_JSON: |{- "description_suffixes": {},+ "description_suffixes": {+ "add_comment": " CONSTRAINTS: Maximum 1 comment(s) can be added. Target: *. Supports reply_to_id for discussion threading."+ },"repo_params": {},"dynamic_tools": [{@@ -712,6 +712,28 @@ jobs:}GH_AW_VALIDATION_JSON: |{+ "add_comment": {+ "defaultMax": 1,+ "fields": {+ "body": {+ "required": true,+ "type": "string",+ "sanitize": true,+ "maxLength": 65000+ },+ "item_number": {+ "issueOrPRNumber": true+ },+ "reply_to_id": {+ "type": "string",+ "maxLength": 256+ },+ "repo": {+ "type": "string",+ "maxLength": 256+ }+ }+ },"missing_data": {"defaultMax": 20,"fields": {@@ -1182,7 +1204,10 @@ jobs:always() && (needs.agent.result != 'skipped' || needs.activation.outputs.lockdown_check_failed == 'true' ||needs.activation.outputs.stale_lock_file_failed == 'true' || needs.activation.outputs.daily_ai_credits_exceeded == 'true')runs-on: ubuntu-slim- permissions: {}+ permissions:+ contents: read+ issues: write+ pull-requests: writeconcurrency:group: "gh-aw-conclusion-ci-doctor-mq"cancel-in-progress: false@@ -1993,7 +2018,10 @@ jobs:- detectionif: (!cancelled()) && needs.agent.result != 'skipped' && needs.detection.result == 'success'runs-on: ubuntu-slim- permissions: {}+ permissions:+ contents: read+ issues: write+ pull-requests: writetimeout-minutes: 45env:GH_AW_AGENT_AIC: ${{ needs.agent.outputs.aic }}@@ -2013,6 +2041,8 @@ jobs:outputs:code_push_failure_count: ${{ steps.process_safe_outputs.outputs.code_push_failure_count }}code_push_failure_errors: ${{ steps.process_safe_outputs.outputs.code_push_failure_errors }}+ comment_id: ${{ steps.process_safe_outputs.outputs.comment_id }}+ comment_url: ${{ steps.process_safe_outputs.outputs.comment_url }}create_discussion_error_count: ${{ steps.process_safe_outputs.outputs.create_discussion_error_count }}create_discussion_errors: ${{ steps.process_safe_outputs.outputs.create_discussion_errors }}process_safe_outputs_processed_count: ${{ steps.process_safe_outputs.outputs.processed_count }}@@ -2065,7 +2095,7 @@ jobs:GITHUB_SERVER_URL: ${{ github.server_url }}GITHUB_API_URL: ${{ github.api_url }}GH_AW_SAFE_OUTPUT_JOBS: "{\"notify_teams\":\"\",\"notify_teams_recurring\":\"\"}"- GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"create_report_incomplete_issue\":{},\"missing_data\":{},\"missing_tool\":{},\"noop\":{\"max\":1,\"report-as-issue\":\"true\"},\"report_incomplete\":{}}"+ GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"add_comment\":{\"max\":1,\"target\":\"*\"},\"create_report_incomplete_issue\":{},\"missing_data\":{},\"missing_tool\":{},\"noop\":{\"max\":1,\"report-as-issue\":\"true\"},\"report_incomplete\":{}}"with:github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}script: |diff --git a/.github/workflows/ci-doctor-mq.md b/.github/workflows/ci-doctor-mq.mdindex cf33cc430e1..fb234b002ea 100644--- a/.github/workflows/ci-doctor-mq.md+++ b/.github/workflows/ci-doctor-mq.md@@ -31,9 +31,6 @@ on:- "Clang-tidy static analysis (Ubuntu 24.04, Python 3.12, Clang-18, Clang-tidy-18)"types:- completed-- branches:- - masterconcurrency:group: gh-aw-${{ github.workflow }}@@ -49,6 +46,9 @@ engine:network: defaultssafe-outputs:+ add-comment:+ max: 1 # at most one remediation comment per investigation+ target: "*" # workflow_run trigger has no PR context; agent supplies the PR numberjobs:notify-teams:description: "Send a CI failure investigation summary to Microsoft Teams. Call this exactly once at the end of the investigation with a concise title and a thorough description of the failure."@@ -616,6 +616,7 @@ ELSE:2. **Actionable Deliverables**:- Send a Microsoft Teams notification with the investigation results (see Output Requirements below)+ - When the failure is associated with a PR in the merge queue, post a remediation comment on that PR with the failed pipeline name/link, a short failure description, and a short possible remedy (see `add_comment` field guidance below)- Provide specific file locations and line numbers for fixes- Suggest code changes or configuration updates@@ -674,6 +675,43 @@ Report the investigation as a Microsoft Teams notification by calling the `notifAdditionally, if Phase 5.5 determines the same failure has occurred 3 or more times in the last 12 hours, call the `notify_teams_recurring` safe-output tool exactly once with the escalation details.+Additionally, **when the failure is associated with a PR in the merge queue**, post a remediation comment on that PR by calling the `add_comment` safe-output tool exactly once (see field guidance below). If no PR can be identified, skip the comment.++### `add_comment` field guidance++Post a concise, actionable remediation comment on the affected merge-queue PR so the author has the context and next steps. Call `add_comment` **at most once per investigation** and **only** when a PR can be identified.++- **`item_number`** (required) — The number of the affected PR in the merge queue (the same value reported as `notify_teams.pr_number`). This is required because the `workflow_run` trigger carries no PR context; the comment cannot be posted without it.++- **`body`** (required) — Markdown comment body. Keep it focused and short. GitHub renders standard Markdown here (headings, bold, inline code, fenced code blocks with backticks, lists, links). Use this structure:++```markdown+### CI Doctor — Merge Queue failure on this PR++**Pipeline**: [<failed_workflow name>](<pipeline_url>)+**Failure**: <one-line summary, same as notify_teams.title>++#### Possible remedy++<1–4 concrete, actionable steps to fix or work around the failure, based on the+root-cause analysis. Reference specific files/lines from the logs when available.>++#### What happened++<1–2 sentence plain-language description of the failure: which job(s) failed and the key error.>++<If repo-memory shows this is a known/recurring pattern, add one line noting how+many times it has been seen and link the most recent prior failure run.>+```++Source the comment content directly from the investigation you already produced:+ * **Pipeline name + link** come from `failed_workflow` and `pipeline_url`.+ * **Failure summary** matches `notify_teams.title`.+ * **What happened** is a condensed version of the Root Cause Analysis (Phase 4 / Phase 6).+ * **Possible remedy** comes from your Recommended Actions, refined with any matching pattern data from repo-memory (`/tmp/gh-aw/repo-memory/default/mq/patterns/` and `/tmp/gh-aw/repo-memory/default/mq/investigations/`). If a prior pattern exists, prefer the remedy that resolved it before.++Do not duplicate the full Teams description in the comment — keep it to the pipeline reference, a short possible remedy, and a failure description.+### `notify_teams` field guidanceProvide all required fields and include the optional PR-related fields whenever the failure is associated with a PR in the merge queue.@@ -812,12 +850,14 @@ You **MUST** always call at least one safe output tool before finishing:- **`notify_teams`**: Send the investigation report as a Microsoft Teams notification (default for any actionable finding). Call this exactly once.- **`notify_teams_recurring`**: Send a recurring-failure escalation alert. Call this **only** if Phase 5.5 determines that there are 3+ occurrences in the last 12 hours. Call at most once per run.+- **`add_comment`**: Post a remediation comment on the affected merge-queue PR. Call this **only** when the failure is associated with a PR (provide `item_number` and `body`). Call at most once per run.- **`noop`**: When no action is needed (e.g., CI was successful, not a merge-queue run, no failure to investigate).- **`missing_data`**: When you cannot gather the information needed to complete the investigation.**Valid call combinations:**-- `notify_teams` alone — standard investigation, fewer than 3 occurrences in the last 12 hours.-- `notify_teams` + `notify_teams_recurring` — standard investigation AND 3+ occurrences in the last 12 hours.+- `notify_teams` alone — standard investigation with no identifiable PR, fewer than 3 occurrences in the last 12 hours.+- `notify_teams` + `add_comment` — standard investigation where the failure is tied to a PR in the merge queue.+- `notify_teams` + `notify_teams_recurring` (+ `add_comment` when a PR is identified) — standard investigation AND 3+ occurrences in the last 12 hours.- `noop` alone — no investigation needed.- `missing_data` alone — investigation blocked by missing data.