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:
- 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/adr
Write the ADR file locally
push_to_pull_request_branch + call safeoutputs
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
implementation label and ≥100 business-logic additions
- ADR file is committed to the PR branch
safeoutputs is called with a non-empty result
- No regression on the no-ADR path (PRs below threshold continue to complete in ≤5 turns)
Related
Generated by [aw] Failure Investigator (6h) · ● 609K · ◷
Problem Statement
The
Design Decision Gateworkflow fails withterminal_reason: max_turnswhenever a PR triggers ADR generation (i.e., has ≥100 business-logic additions and theimplementationlabel). The workflow's currentmax_turns=5budget is structurally insufficient for the ADR write+push execution path.Affected Workflows & Run IDs
copilot/configure-agentic-engine-drivercopilot/add-support-agentic-engine-opencodeRoot Cause
The "ADR required" execution path needs a minimum of 6 turns:
adr-prefetch-summary.json+design-gate-config.yml(parallel)pr.json+pr.diff(parallel)docs/adr/mkdir -p docs/adrWritethe ADR file locallypush_to_pull_request_branch+ callsafeoutputsWith
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 thesafe_outputsjob to be skipped and the workflow to exit with code 1.Proposed Remediation
Option A (Recommended — lowest risk): Increase
max-turnsfrom5to7in 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/adrto a deterministic pre-agent shell step, freeing one turn in the agent budget.Option C: Combine the
Write+push_to_pull_request_branchinto a single agent action using a shell script step, reducing the turn count needed.Success Criteria
implementationlabel and ≥100 business-logic additionssafeoutputsis called with a non-empty resultRelated