Fix Design Decision Gate false failures caused by the LLM invocation cap - #52836
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
PR TriageCategory: bug | Risk: high | Score: 82/100
Recommended action:
|
PR Triage
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.
|
There was a problem hiding this comment.
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 |
| 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 }; |
| 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 }; |
|
🎉 This pull request is included in a new release. Release: |
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>
Three independent monitors flagged the merge-blocking
Design Decision Gate 🏗️workflow failing at a high rate while still burning real token spend — aTurns=0-style crash signature that turned out to be something else entirely.Root cause
max-turnsdoubles 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, butmax-turnswas set to 20 — so it reliably hit429 Maximum LLM invocations exceeded (20/20). Worse, the agent had often already written a valid safe-output (e.g. anadd_commentwith 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
max-turnsfrom 20 → 30 indesign-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.