Skip to content

Fix Step Name Alignment and Design Decision Gate max-turns failures from bash allow-list/working-directory mismatch - #31338

Closed
pelikhan with Copilot wants to merge 3 commits into
mainfrom
copilot/aw-failures-fix-bash-permission-denials
Closed

pelikhan with Copilot wants to merge 3 commits into
mainfrom
copilot/aw-failures-fix-bash-permission-denials

Conversation

Copilot AI commented May 10, 2026 •

Copy link
Copy Markdown
Contributor

Bug Fix

What was the bug?

Both workflows exhausted --max-turns with zero forward progress: every turn was a permission_denial. Two independent blocking layers:

  1. jq absent from --allowed-tools — both prompts call jq extensively, but it wasn't in either workflow's bash allow-list, so every invocation was denied before reaching the shell.
  2. Claude Code working-directory restriction (Design Decision Gate only) — pre-fetched context was written to /tmp/gh-aw/agent/, outside the session's allowed directory (/home/runner/work/gh-aw/gh-aw). Even allow-listed commands were blocked at the Claude Code layer with: cat in '/tmp/gh-aw/agent/...' was blocked. Claude Code may only concatenate files from the allowed working directories.

How did you fix it?

step-name-alignment.md

  • Added jq:* to the bash allow-list
  • Tightened Step 1/Step 8 guidance to use the Read/Write tools (not Bash) for cache-memory access — Bash cat to /tmp/ is blocked at the Claude Code layer despite appearing in the compiled allow-list; Read(/tmp/gh-aw/cache-memory/*) and Write(/tmp/gh-aw/cache-memory/*) grants bypass this restriction

design-decision-gate.md

  • Added jq:* and mkdir:* to the bash allow-list
  • Moved the pre-fetch step's output from /tmp/gh-aw/agent/ → ${{ github.workspace }}/.gh-aw-context/ so all pre-fetched files land inside the Claude Code working directory and are directly readable by the agent
  • Updated all five prompt references from /tmp/gh-aw/agent/… → .gh-aw-context/…

Both lock files recompiled after changes.

# step-name-alignment.md — before
tools:
  bash:
    - "yq*"
    - "find .github/workflows -name '*.lock.yml' -type f"
    # jq missing → every jq call denied

# after
tools:
  bash:
    - "yq*"
    - "find .github/workflows -name '*.lock.yml' -type f"
    - "jq:*"   # ← added
# design-decision-gate.md — pre-fetch step, before
CONTEXT_DIR="/tmp/gh-aw/agent"   # outside working dir → every read blocked

# after
CONTEXT_DIR="$GH_AW_GITHUB_WORKSPACE/.gh-aw-context"  # inside working dir

Copilot AI and others added 2 commits May 10, 2026 12:45
…lignment and Design Decision Gate workflows

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…triction

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix max turns issue due to Bash permission denials Fix Step Name Alignment and Design Decision Gate max-turns failures from bash allow-list/working-directory mismatch May 10, 2026
Copilot AI requested a review from pelikhan May 10, 2026 12:48
@github-actions

Copy link
Copy Markdown
Contributor

Hey @copilot-swe-agent 👋 — great work tracking down the two independent blocking layers causing --max-turns exhaustion in the Step Name Alignment and Design Decision Gate workflows! The description is thorough and the before/after YAML snippets make the intent crystal clear.

One thing worth addressing before merge:

  • No test coverage — the diff touches four workflow files (.md sources and their compiled .lock.yml equivalents) but doesn't include any test fixtures or CI checks that would catch a regression if the allow-list or context-dir path drifted again. Even a smoke-test or a workflow-lint step would help guard these paths.

If you'd like a hand adding coverage, here's a ready-to-use prompt:

Add test coverage for the bash allow-list and working-directory fixes introduced in PR #31338.

Specifically:
1. In .github/workflows/step-name-alignment.md (and its compiled lock), verify that `jq:*` appears in the bash allow-list.
2. In .github/workflows/design-decision-gate.md (and its compiled lock), verify that `jq:*` and `mkdir:*` appear in the bash allow-list, and that the pre-fetch CONTEXT_DIR uses `$GH_AW_GITHUB_WORKSPACE/.gh-aw-context` (not `/tmp/gh-aw/agent/`).
3. Wire these checks into an appropriate CI step or test script so they fail loudly if the paths regress.

Generated by Contribution Check · ● 8.5M · ◷

@pelikhan pelikhan closed this May 10, 2026
@github-actions
github-actions Bot deleted the copilot/aw-failures-fix-bash-permission-denials branch May 18, 2026 03:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[aw-failures] Claude workflows hit max-turns burning every turn on Bash permission denials (Step Name Alignment, Design Decision Gate)

2 participants