Skip to content

Fix Design Decision Gate false failures caused by the LLM invocation cap - #52836

Merged
pelikhan merged 2 commits into
mainfrom
copilot/deep-report-investigate-merge-blocking-failure
Aug 15, 2026
Merged

Fix Design Decision Gate false failures caused by the LLM invocation cap#52836
pelikhan merged 2 commits into
mainfrom
copilot/deep-report-investigate-merge-blocking-failure

Conversation

Copilot AI commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Three independent monitors flagged the merge-blocking Design Decision Gate 🏗️ workflow failing at a high rate while still burning real token spend — a Turns=0-style crash signature that turned out to be something else entirely.

Root cause

max-turns doubles as the AWF API proxy's hard per-run LLM invocation cap. This gate's ADR-review task typically needs ~20-22 turns to complete, but max-turns was set to 20 — so it reliably hit 429 Maximum LLM invocations exceeded (20/20). Worse, the agent had often already written a valid safe-output (e.g. an add_comment with the completed ADR review) before hitting the cap, but every harness (claude/codex/copilot) treated the cap error as an unconditional hard failure and discarded that completed work.

Changes

  • Increased max-turns from 20 → 30 in design-decision-gate.md (recompiled lock file) to give headroom above the observed completion point.
  • claude_harness.cjs, codex_harness.cjs, copilot_harness.cjs: when the invocation cap is saturated but safe-outputs already contain a terminal/expected result, exit 0 instead of failing — mirroring the existing suppression pattern already used for "numerous permission-denied" and "partial execution" cases.
  • Added harness tests covering the new suppression behavior for all three engines.
// Before: cap saturation was always fatal, even with completed work
if (nonRetryableGuard.maxRunsExceeded) return { action: "stop" }; // exit 1

// After: suppress the false-red when safe-outputs already hold the result
if (nonRetryableGuard.maxRunsExceeded && hasExpectedSafeOutputs(safeOutputsPath)) {
  return { action: "stop", exitCode: 0 };
}

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Investigate Design Decision Gate merge-blocking failure Fix Design Decision Gate false failures caused by the LLM invocation cap Aug 15, 2026
Copilot AI requested a review from pelikhan August 15, 2026 05:39
@github-actions

Copy link
Copy Markdown
Contributor

PR Triage

Category: bug | Risk: high | Score: 82/100

  • Impact: 35/50 (fixes merge-blocking Design Decision Gate false failures burning real token spend across the org)
  • Urgency: 30/30 (flagged by three independent monitors — actively impacting CI reliability)
  • Quality: 17/20 (no reviews yet, CI status unknown, but clear root-cause narrative)

Recommended action: fast_track
High-urgency CI reliability fix — actively blocking merges and burning token spend. Batched with reliability-fixes cluster (#52757, #52837, #52854).

Generated by 🔧 PR Triage Agent · auto · 46.6 AIC · ⌖ 2.63 AIC · ⊞ 8.1K ·

@github-actions

Copy link
Copy Markdown
Contributor

PR Triage

  • Category: bug
  • Risk: high
  • Priority: high
  • Score: 88/100
  • Recommended action: fast_track
  • Batch: reliability-fixes

Merge-blocking Design Decision Gate false failures with real token spend impact. CI unknown but high urgency — recommend expedited human review.

Automated triage — see [PR Triage Report] for full context.

Generated by 🔧 PR Triage Agent · auto · 62.5 AIC · ⌖ 2.53 AIC · ⊞ 8.1K ·

@pelikhan
pelikhan marked this pull request as ready for review August 15, 2026 12:41
Copilot AI balanced review requested due to automatic review settings August 15, 2026 12:41

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

Addresses #52736 by reducing false failures when workflows exhaust their LLM invocation allowance after producing useful output.

Changes:

  • Raises the Design Decision Gate limit from 20 to 30.
  • Suppresses invocation-cap failures after terminal safe output.
  • Adds coverage for Claude, Codex, and Copilot harnesses.
Show a summary per file
File Description
.github/workflows/design-decision-gate.md Raises the turn limit.
.github/workflows/design-decision-gate.lock.yml Recompiles the workflow.
actions/setup/js/claude_harness.cjs Adds cap-failure suppression.
actions/setup/js/claude_harness.test.cjs Tests Claude suppression.
actions/setup/js/codex_harness.cjs Adds cap-failure suppression.
actions/setup/js/codex_harness.test.cjs Tests Codex suppression.
actions/setup/js/copilot_harness.cjs Adds cap-failure suppression.
actions/setup/js/copilot_harness.test.cjs Tests Copilot suppression.

Review details

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

  • Files reviewed: 8/8 changed files
  • Comments generated: 3
  • Review effort level: Balanced

pull-requests: read
issues: read
max-turns: 20
max-turns: 30
Comment on lines +543 to +545
if (nonRetryableGuard.maxRunsExceeded && safeOutputsPath && hasExpectedSafeOutputs(safeOutputsPath, { logger: log })) {
log(`attempt ${attempt + 1}: invocation cap saturated but safe-outputs already contain expected output — suppressing terminal verdict (false-red: core work succeeded)`);
return { action: "stop", exitCode: 0 };
Comment on lines +657 to +659
if (nonRetryableGuard.maxRunsExceeded && safeOutputsPath && hasExpectedSafeOutputs(safeOutputsPath, { logger: log })) {
log(`attempt ${attempt + 1}: invocation cap saturated but safe-outputs already contain expected output — suppressing terminal verdict (false-red: core work succeeded)`);
return { action: "stop", exitCode: 0 };
@pelikhan
pelikhan merged commit 88d18c7 into main Aug 15, 2026
13 checks passed
@pelikhan
pelikhan deleted the copilot/deep-report-investigate-merge-blocking-failure branch August 15, 2026 13:02
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.86.3

sameerkhansf added a commit to sameerkhansf/Sameer-Khan that referenced this pull request Sep 8, 2026
Run 34261048698 was the first run to reach the post-writing path since #76 —
the gate correctly printed CLEAR — and it failed on the invocation cap:

  attempt 1: 56 turns / 93 invocations, then
             "Upstream error from Nvidia: Service temporarily overloaded"
             (transient, classified partial_execution, budget remaining)
  attempt 2: harness restarts the session from scratch, dies on
             "429 Maximum LLM invocations exceeded (120 / 120)"

max-turns is not only a turn count: it is the AWF api-proxy's hard per-run LLM
invocation cap, and that budget is pooled across every harness retry attempt
(github/gh-aw#52836, #45827). At 120 a single pass fits and a retry cannot, so
any transient upstream blip on the free NVIDIA endpoint kills the run. 250
leaves room for one full pass plus a retry.

This is a symptom fix with a known ceiling. gh aw audit has flagged
"about 50% of this run's turns appear to be data-gathering that could move to
deterministic steps" on every run, and the log shows the cause: repeated
`curl <hf-readme> | grep -i "parameters|context|license|price"` against the
same files. Pre-fetching candidate READMEs in the `steps:` block is the
DeterministicOps fix and the next lever if the cap is hit again.


Claude-Session: https://claude.ai/code/session_01Vru5xPN55JPU7dyVS3uswd

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.

[deep-report] Investigate Design Decision Gate merge-blocking failure/cost hotspot (cross-verified by 3 monitors)

3 participants