Skip to content

[WIP] Fix claude_harness.cjs misclassification of error_max_turns exits#29605

Closed
Copilot wants to merge 3 commits intomainfrom
copilot/fix-claude-harness-retries-error
Closed

[WIP] Fix claude_harness.cjs misclassification of error_max_turns exits#29605
Copilot wants to merge 3 commits intomainfrom
copilot/fix-claude-harness-retries-error

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 1, 2026

  • Create actions/setup/js/claude_harness.cjs with:
    • error_max_turns detection (the core fix) — not retriable via --continue
    • Retry on partial execution (transient errors) using --continue
    • --prompt-file resolution for Claude (positional arg)
    • Exponential backoff, same as copilot_harness.cjs
  • Create actions/setup/js/claude_harness.test.cjs with 22 tests
  • Update pkg/workflow/claude_engine.go to implement HarnessProvider and wire harness
    • Add GetHarnessScriptName() returning "claude_harness.cjs"
    • Replace "$(cat prompt.txt)" shell expansion with --prompt-file flag
    • Export GH_AW_NODE_BIN in AWF PathSetup for reliable node binary resolution
  • Update existing tests in claude_engine_test.go and engine_agent_import_test.go
  • Recompile all workflows
  • Run make agent-finish — all Claude tests pass, pre-existing create_issue.test.cjs failures unrelated to this PR
  • Run parallel_validation

Agent-Logs-Url: https://github.com/github/gh-aw/sessions/acd38477-c928-4dd2-ad45-319d3ab8f5a4

Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
…into ClaudeEngine

- Create actions/setup/js/claude_harness.cjs: wraps Claude Code CLI with
  retry logic; detects 'error_max_turns' (deterministic max_turns exit) and
  does NOT retry via --continue, fixing the 3x wasted retry cascade
- Create actions/setup/js/claude_harness.test.cjs: 22 tests covering
  error_max_turns pattern detection, retry policy, and --prompt-file resolution
- Update pkg/workflow/claude_engine.go:
  - Implement HarnessProvider (GetHarnessScriptName → 'claude_harness.cjs')
  - Replace shell expansion '$(cat prompt.txt)' with --prompt-file flag
  - Add GH_AW_NODE_BIN export to AWF PathSetup for reliable node resolution
- Update tests: expect --prompt-file and harness in claude execution steps
- Recompile all workflows to pick up the harness and PathSetup changes

Agent-Logs-Url: https://github.com/github/gh-aw/sessions/acd38477-c928-4dd2-ad45-319d3ab8f5a4

Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
@pelikhan pelikhan closed this May 1, 2026
Copilot AI requested a review from gh-aw-bot May 1, 2026 20:19
Copilot stopped work on behalf of gh-aw-bot due to an error May 1, 2026 20:19
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] Fix: claude_harness.cjs retries error_max_turns exits via --continue, always failing (3x wasted retries per DDG complex-PR run)

3 participants