Conversation
Group failed runs by observed metadata signals, persist evidence in cached run records, and annotate report formats with stable cluster IDs and representative audit targets. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Rank specific boundaries before generic aftermath, diversify representatives, and generate a bounded deduplicated audit plan. Present compact cluster summaries and teach logs consumers to project investigation targets and reuse cached evidence. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅
|
|
✅ PR Code Quality Reviewer completed the code quality review.
|
|
✅ Design Decision Gate 🏗️ completed the design decision gate check. See the comment below for the result and any generated ADR draft. Commit pushed:
|
|
✅ Ponytail Reviewer completed successfully! Ponytail ReviewerOutcome: 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.
|
|
✅ Test Quality Sentinel completed test quality analysis. Test Quality SentinelOutcome: 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.
|
🏗️ Design Decision Gate — ADR RequiredThis PR makes significant changes to core business logic (1,242 new lines across 📄 Draft ADR committed:
🔍 Decision inferred from the diff
One item is marked 📋 What to do next
Once an ADR is linked in the PR body, this gate will re-run and verify the implementation matches the decision. ❓ Why ADRs Matter
ADRs create a searchable, permanent record of why the codebase looks the way it does. Future contributors (and your future self) will thank you. 📋 Michael Nygard ADR Format ReferenceAn ADR must contain these four sections to be considered complete:
All ADRs are stored in
|
Comment MemoryPeek at saved memory (pr-code-quality-reviewer)Note This comment is managed by comment memory.Expand the saved memory block to view or edit the persistent context for this thread.
|
There was a problem hiding this comment.
Request changes
This adds useful failure clustering, but the current patch regresses a few output contracts badly enough that I would not ship it as-is.
Blocking themes
--format tsvno longer keeps stdout purely tabular; the new failure-report trailer appends non-TSV rows that will break existing parsers.--cross-run --format prettynow splits one human-readable report across stdout and stderr, so redirects and pipelines capture only fragments.- The MCP
logstool guidance still returns afile_pathenvelope, but the rewritten description no longer clearly tells callers to read that file before querying report fields, which is likely to mislead agent consumers.
🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt54 · 96.8 AIC · ⌖ 5.93 AIC · ⊞ 21.4K
Comment /review to run again
There was a problem hiding this comment.
Skills-Based Review 🧠
Applied /tdd and /grill-with-docs (per pr-triage) to the new failure clustering/investigation plan feature.
One actionable finding posted inline: a fragile string-literal coupling between the aftermath classifier in pkg/cli/logs_failure_signals.go and the compiler-side "Handle agent failure" step name in pkg/workflow/notify_comment_conclusion_helpers.go, with no shared constant or cross-package test to catch a future rename.
📋 Key Themes & Highlights
Key Themes
- Coupling risk: failureSignalRole's "conclusion"/"Handle agent failure" match (see inline comment) is the only place outside pkg/workflow that depends on that exact step name, and nothing enforces the link.
Positive Highlights
- Deterministic, idempotent cluster IDs verified by TestFailureClustersReplay (reversed-input replay, cached round-trip) and TestAnnotateFailureClusters (order/subset independence).
- Good test coverage of boundary conditions: intentional-failure exclusion, duplicate run dedup, metadata-only fallback, representative diversity, and budget-bounded greedy selection with tie-break determinism (slices.Reverse check in TestFailureInvestigationBudgetCoverageAndDeterminism).
- Schema (schemas/logs.schema.json, schemas/logs-jsonl.schema.json) and docs (debugging.md, MCP tool description) updated consistently with the new fields.
- Clear domain vocabulary in doc comments (symptoms not causes, bounded not exhaustive) that should help agents avoid over-interpreting cluster counts.
No blocking issues found beyond the coupling note; approving with that single suggestion for follow-up.
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · sonnet50 · 109.1 AIC · ⌖ 14.5 AIC · ⊞ 11.1K
Comment /matt to run again
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
Cross-host identity collisions can omit failures from investigation plans, and pretty reports split their sections across output streams.
2 open findings
What changed in this PR
Adds symptom-based failure clustering to gh aw logs, helping agents choose useful runs for targeted investigation without extra downloads or model calls.
Changes:
- Extracts failure signals, builds stable clusters, and selects a bounded audit plan.
- Integrates recommendations across report formats, schemas, and cache data.
- Adds regression tests and updates troubleshooting and agent guidance.
| File | Description |
|---|---|
| schemas/logs.schema.json | Defines cluster and investigation report fields. |
| schemas/logs-jsonl.schema.json | Defines cached failure-signal fields. |
| pkg/cli/mcp_tools_privileged.go | Updates logs-tool investigation guidance. |
| pkg/cli/logs_report.go | Builds clusters and investigation plans. |
| pkg/cli/logs_orchestrator_render.go | Connects TSV and cross-run output. |
| pkg/cli/logs_format_compact.go | Adds compact and verbose failure sections. |
| pkg/cli/logs_failure_signals.go | Enriches signals and selects diverse representatives. |
| pkg/cli/logs_failure_investigation.go | Selects bounded investigation targets. |
| pkg/cli/logs_failure_investigation_test.go | Tests ranking, coverage, and determinism. |
| pkg/cli/logs_failure_investigation_render.go | Renders investigation recommendations. |
| pkg/cli/logs_failure_clusters.go | Extracts and groups failure symptoms. |
| pkg/cli/logs_failure_clusters_test.go | Tests clustering, caching, and output. |
| pkg/cli/logs_failure_clusters_replay_test.go | Adds saved-report replay validation. |
| pkg/cli/logs_failure_clusters_render.go | Renders clusters and membership. |
| pkg/cli/audit_cross_run.go | Adds failure data to cross-run reports. |
| pkg/cli/audit_cross_run_render.go | Adds Markdown and pretty failure sections. |
| docs/src/content/docs/troubleshooting/debugging.md | Explains targeted failure investigation. |
| .github/workflows/workflow-normalizer.lock.yml | Refreshes generated prompt metadata. |
| .github/workflows/shared/aw-logs-24h-fetch.md | Adds targeted triage guidance. |
| .github/workflows/shared/aw-logs-24h-fetch-prompt.md | Adds prompt-only triage guidance. |
| .github/workflows/safe-output-health.lock.yml | Refreshes generated prompt metadata. |
| .github/workflows/daily-storify.lock.yml | Refreshes generated prompt metadata. |
| .github/workflows/daily-firewall-report.lock.yml | Refreshes generated prompt metadata. |
| .github/workflows/agent-job-health.lock.yml | Refreshes generated prompt metadata. |
| .github/aw/cli-commands.md | Documents investigation-plan usage. |
🧠 Review effort: Max
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Update the embedded dispatcher template and offline file list to match the run-analysis guidance added by this PR. Cover generated routing and offline discoverability with regression assertions. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Remove duplicate prose and overlay placeholders while preserving scope routing, clustering semantics, evidence safeguards, and reporting requirements. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
@copilot address the following outstanding work in one pass:
Push the necessary fixes, reply to each listed review thread and resolve it when addressed. Ignore feedback already answered or resolved. Use the pr-finisher skill and stop when only human review or CI remains; do not trigger CI. Sous-chef head: 91c77d3
|
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Sample current AW revisions independently within bounded lookback and API budgets. Use gh-aw-metadata hashes to report recovery, unexecuted changes, and insufficient evidence; reuse current failure clusters without artifact downloads. Add failed-sample Wilson statistics and cache symptom-profile gains with marginal coverage. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Preserve the concurrent branch history and regenerate the agentic-workflows file index required by the skill synchronization contract. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
…' into pelikhan-logs-failure-clustering # Conflicts: # pkg/cli/logs_failure_clusters.go # pkg/cli/logs_failure_investigation.go # pkg/cli/logs_failure_signals.go Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
|
🎉 This pull request is included in a new release. Release: |

Why
Agents investigating workflow failures currently have to scan individual runs and reconstruct recurring symptoms themselves. Add precomputed failure groups and a small investigation plan so they can select useful runs without reading the entire logs report.
Approach
Clusters describe shared symptoms, not proven common causes. Counts overlap and must not be summed as unique failures. Intentional failures are excluded from recommendations; the five-run plan is an initial subset, not an exhaustive investigation. Clustering itself adds no downloads or model calls.
Validation
make agent-report-progress-no-test: build, change-scoped standard/custom lint, schema checks, and workflow lock drift checks passed.make recompile: all 344 workflows compiled successfully; regenerated lock metadata is included.TestFailureClustersReplaypassed against collected repository reports, including reversed-input replay with identical clusters and investigation plans.Evaluation
Reran the actual CLI for a refreshed 12-hour evidence window, 2026-10-14 16:21:24 through 2026-10-15 04:21:24 UTC: 448 available reports from 450 requested runs, with 182 failures and 72 clusters.
With the same five-run investigation budget, the new plan spans 10 observed symptom clusters versus 5 using the previous count-ranked defaults. Representative-diversity gaps fall from one to zero; structural and membership checks report no violations. The bounded plan is about 2.8 KB versus 4.6 MB for the full JSON report. All 10 explicit agent-guidance checks pass.
These are deterministic consistency, coverage, and guidance evaluations, not labeled root-cause accuracy or live LLM-agent outcome measurements. Of the analyzed failures, 62 remain metadata-only unknowns.