Skip to content

Report terminal Claude failures after recovered continue retries - #52057

Merged
pelikhan merged 4 commits into
mainfrom
copilot/aw-daily-compile-check-fix
Aug 11, 2026
Merged

Report terminal Claude failures after recovered continue retries#52057
pelikhan merged 4 commits into
mainfrom
copilot/aw-daily-compile-check-fix

Conversation

Copilot AI commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Daily AW Cross-Repo Compile Check surfaced a recovered Claude --continue retry error as the workflow failure. The harness had already fallen back to fresh retries, so the issue body hid the actual terminal failure.

  • Failure classification

    • Suppress No deferred tool marker found lines only when the harness logs that it recovered by retrying fresh with --continue permanently disabled.
    • Preserve unrecovered no-deferred-marker errors as actionable engine failures.
  • Regression coverage

    • Added coverage for recovered retry logs so the final report shows the terminal failure tail instead of the stale intermediate marker.
    • Added a guard that standalone no-deferred-marker failures still surface in Error details.
Error: No deferred tool marker found...
[claude-harness] ... retrying as fresh run (... --continue disabled permanently ...)
[ERROR] API error ... Connection error

Now the recovered marker is filtered and the terminal failure remains visible.

Copilot AI and others added 2 commits August 11, 2026 13:27
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix daily AW cross-repo compile check issue Report terminal Claude failures after recovered continue retries Aug 11, 2026
Copilot AI requested a review from pelikhan August 11, 2026 13:30
@pelikhan
pelikhan marked this pull request as ready for review August 11, 2026 13:41
Copilot AI balanced review requested due to automatic review settings August 11, 2026 13:41
@github-actions

github-actions Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

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

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

@github-actions

github-actions Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Test Quality Sentinel completed test quality analysis.

🧪 Test quality analysis by Test Quality Sentinel

@github-actions

github-actions Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

PR Code Quality Reviewer completed the code quality review.

Warning

Threat Detection Engine Failure — The analysis engine could not complete. This is a tooling failure, not a security finding.

What happened

The threat detection engine failed to produce results.

Review the workflow run logs for details.

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • api.individual.githubcopilot.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "api.individual.githubcopilot.com"

See Network Configuration for more information.

🔎 Code quality review by PR Code Quality Reviewer

@github-actions

github-actions Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Ponytail Reviewer completed successfully!

Lean already. Ship.

Generated by Ponytail Reviewer for #52057

@github-actions

github-actions Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Design Decision Gate 🏗️ completed the design decision gate check.

No ADR enforcement needed: PR #52057 does not have the 'implementation' label and has 0 new lines of code in business logic directories (threshold: 100).

🏗️ ADR gate enforced by Design Decision Gate 🏗️

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

Filters recovered Claude --continue marker failures so reports surface the terminal engine error.

Changes:

  • Detects and suppresses recovered no-deferred-marker errors.
  • Adds regression coverage for recovered and standalone marker failures.
Show a summary per file
File Description
actions/setup/js/handle_agent_failure.cjs Filters recovered retry errors from failure context.
actions/setup/js/handle_agent_failure.test.cjs Tests recovered and unrecovered marker handling.

Review details

Tip

Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Balanced

Comment on lines +2770 to +2771
const recoveredNoDeferredMarker = /No deferred tool marker found/i.test(logContent) && /no deferred tool marker on --continue.*retrying as fresh run/i.test(logContent) && /--continue disabled permanently/i.test(logContent);
const isRecoveredNoDeferredMarkerLine = line => recoveredNoDeferredMarker && /No deferred tool marker found/i.test(line);

@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.

Skills-Based Review 🧠

Applied /diagnosing-bugs and /tdd — commenting with two minor suggestions; no blocking issues.

📋 Key Themes & Highlights

Key Themes

  • Whole-log boolean assumption (recoveredNoDeferredMarker): the suppression flag is derived from the entire log, not per-occurrence. This is likely fine in practice but is undocumented — a comment or a mixed-scenario test would make the intent explicit and prevent future confusion.
  • Fragile test assertion: asserting on the "Error details:" heading string is an implementation detail; asserting on the marker message itself is both sufficient and more resilient to future heading renames.

Positive Highlights

  • ✅ Clean, minimal diff — the fix is surgical and well-scoped.
  • ✅ Both branches (recovered and unrecovered) are covered by dedicated test cases.
  • ✅ The regex triple-guard (No deferred tool marker found + harness recovery log + --continue disabled permanently) makes the suppression condition narrow and precise.
  • isRecoveredNoDeferredMarkerLine is applied consistently in both the errorMessages loop and the agentLines filter.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · sonnet46 · 27.4 AIC · ⌖ 6.7 AIC · ⊞ 7.1K
Comment /matt to run again

@@ -2767,6 +2767,8 @@ function buildEngineFailureContext(options = {}) {
}

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.

[/diagnosing-bugs] recoveredNoDeferredMarker is a whole-log boolean — if a future log contains both a recovered marker and a second, separate unrecovered No deferred tool marker error, every marker line will be silently suppressed, hiding a real failure.

💡 Suggested improvement

If the whole-log behaviour is intentional (one recovery means all markers are suppressed), add a short comment to document that assumption:

// Once the harness logs a successful recovery (--continue disabled permanently),
// ALL "No deferred tool marker" lines are treated as noise from that recovery chain.
const recoveredNoDeferredMarker = ...;

Otherwise consider a mixed-scenario test:

it("still surfaces an unrecovered marker that appears independently of a recovered one", () => { ... });

@copilot please address this.

expect(result).toContain("Engine Failure");
expect(result).toContain("No deferred tool marker found");
expect(result).toContain("Error details:");
});

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.

[/tdd] The recovered-marker test asserts not.toContain("Error details:") but the exact heading string is an implementation detail. If the section heading ever changes wording, this test passes falsely.

💡 Suggestion

Assert on the absence of the marker error message itself rather than the section heading, since that's the actual behaviour being protected:

expect(result).not.toContain("No deferred tool marker");
// already present — the Error details check is redundant and fragile

Dropping the Error details: assertion removes brittleness without weakening the coverage.

@copilot please address this.

@github-actions

Copy link
Copy Markdown
Contributor

🧪 Test Quality Sentinel Report

Test Quality Score: 90/100 — Excellent

Analyzed 2 test(s): 2 design, 0 implementation, 1 warning.

📊 Metrics (2 tests)
Metric Value
Analyzed 2 (Go: 0, JS: 2)
✅ Design 2 (100%)
⚠️ Implementation 0 (0%)
Edge/error coverage 2 (100%)
Duplicate clusters 0
Inflation ⚠️ Yes (3.5:1)
🚨 Violations 0
Test File Classification Issues
suppresses recovered no-deferred-marker retry errors and surfaces the terminal failure tail handle_agent_failure.test.cjs:2581 behavioral_contract / design_test Test inflation flag (see details)
still surfaces unrecovered no-deferred-marker errors handle_agent_failure.test.cjs:2601 behavioral_contract / design_test None
⚠️ Quality Notes

Test Inflation Warning (1 test)

The first test has a 3.5:1 ratio of test lines added (28) vs production lines added (8). This exceeds the 2:1 guidance threshold. However, the inflation is justified here:

  • The test validates a critical behavioral contract (recovered error suppression)
  • Multiple assertions are needed to verify both positive (should suppress) and negative (terminal error must appear) cases
  • Log file setup with realistic multi-line retry sequence is necessary to test the regex patterns correctly
  • The test is well-structured and not inflated with unnecessary mocks or assertions

This is a justified case of test inflation supporting robust behavioral coverage.

Test Quality Strengths:

  • ✅ All tests are design-level behavioral contracts (0% implementation tests)
  • ✅ 100% edge/error coverage — both recovery and non-recovery paths tested
  • ✅ Clear negative assertions preventing over-suppression of real errors
  • ✅ Realistic log sequences matching actual harness retry patterns
  • ✅ No mock library violations (uses vitest native mocks)

Verdict

APPROVE. Test Quality Score: 90/100. 0% implementation tests (threshold: 30%). Strong behavioral coverage with justified test inflation.

🧪 Test quality analysis by Test Quality Sentinel · haiku45 · 20.4 AIC · ⌖ 2.69 AIC · ⊞ 7.6K ·
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.

The change is well-structured and correct. recoveredNoDeferredMarker is computed once from the full log requiring all three signals — appropriately conservative. isRecoveredNoDeferredMarkerLine re-checks at the individual line level so only the specific noisy error line is dropped. Regex patterns use .test() not /g with .exec() so no infinite-loop risk per the error-pattern-safety guidelines. Both the suppressed (recovered) and non-suppressed (unrecovered) paths are covered by new tests. LGTM

🧵 Reviewed using Impeccable skills by Impeccable Skills Reviewer · sonnet46 · 25.5 AIC · ⌖ 6.14 AIC · ⊞ 5.4K

@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.

✅ Test Quality Sentinel: 90/100. 0% implementation tests (threshold: 30%). Strong behavioral coverage with justified test inflation and clear edge-case testing for both recovered and unrecovered error scenarios.

@github-actions github-actions Bot mentioned this pull request Aug 11, 2026
@pelikhan

Copy link
Copy Markdown
Collaborator

@copilot run pr-finisher skill

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

Copilot AI commented Aug 11, 2026

Copy link
Copy Markdown
Contributor Author

@copilot run pr-finisher skill

Ran the pr-finisher pass.

Reviews: addressed the outstanding reviewer thread — the whole-log recovered flag is replaced with per-line correlation. Each No deferred tool marker found line is only suppressed when a later [claude-harness]-prefixed fresh-retry line follows it, so a terminal marker after an earlier recovered one, and agent output merely quoting the recovery text, both stay visible. Added regression cases for mixed recovered-then-unrecovered and quoted-recovery logs.

Checks (local): make fmt, make lint, make recompile, and make agent-report-progress all pass; handle_agent_failure.test.cjs is green (345 tests). CI on the new HEAD is stale until a maintainer re-triggers it — agent pushes don't start workflows.

Not merging, per skill rules.

@pelikhan
pelikhan merged commit d10eda6 into main Aug 11, 2026
9 checks passed
@pelikhan
pelikhan deleted the copilot/aw-daily-compile-check-fix branch August 11, 2026 16:58
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.

[aw] Daily AW Cross-Repo Compile Check failed

3 participants