Repository navigation
Description
Problem Statement
The Design Decision Gate workflow fails with terminal_reason: max_turns whenever a PR triggers ADR generation (i.e., has ≥100 business-logic additions and the implementation label). The workflow's current max_turns=5 budget is structurally insufficient for the ADR write+push execution path.
Affected Workflows & Run IDs
- Workflow: Design Decision Gate (claude engine)
- Failed runs:
- §24698134887 — PR Add configurable agentic engine driver script support #27453
copilot/configure-agentic-engine-driver - §24697778261 — PR Add experimental OpenCode engine support, smoke workflow, and reassign LLM gateway ports #27466
copilot/add-support-agentic-engine-opencode
- §24698134887 — PR Add configurable agentic engine driver script support #27453
- Comparator (success, no-ADR path): §24697555895
Root Cause
The "ADR required" execution path needs a minimum of 6 turns:
- Read
adr-prefetch-summary.json+design-gate-config.yml(parallel) - Read
pr.json+pr.diff(parallel) - Check existing ADRs in
docs/adr/ mkdir -p docs/adrWritethe ADR file locallypush_to_pull_request_branch+ callsafeoutputs
With max_turns=5, step 6 is never reached. In run §24698134887, the ADR was written locally at turn 5 but the push was never attempted. In run §24697778261, even the write was cut off mid-turn.
Both failures produced empty agent_output.json ({"items":[]}), causing the safe_outputs job to be skipped and the workflow to exit with code 1.
Proposed Remediation
Option A (Recommended — lowest risk): Increase max-turns from 5 to 7 in the Design Decision Gate workflow configuration. This gives a 2-turn buffer for the ADR path without affecting the no-ADR path (which uses only 4 turns).
Option B: Move mkdir -p docs/adr to a deterministic pre-agent shell step, freeing one turn in the agent budget.
Option C: Combine the Write + push_to_pull_request_branch into a single agent action using a shell script step, reducing the turn count needed.
Success Criteria
- Design Decision Gate succeeds (exit 0) on PRs with
implementationlabel and ≥100 business-logic additions - ADR file is committed to the PR branch
safeoutputsis called with a non-empty result- No regression on the no-ADR path (PRs below threshold continue to complete in ≤5 turns)
Related
- Parent investigation: [aw-failures] Failure Investigation Report — 2026-04-21 (6h window) #27469
- Stale predecessor (different root cause, now closed): [aw] Design Decision Gate 🏗️ failed #27405
Generated by [aw] Failure Investigator (6h) · ● 609K · ◷
- expires on Apr 28, 2026, 1:21 AM UTC
Activity
pelikhan commentedon Apr 21, 2026
@copilot increase to 10