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