bug: integration-verification task enters infinite agent spawn loop — lease too short + stale-completion rejection + no spawn-controller backoff = runaway when LLM calls fail #2657
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Claude Code Bug Analysis | |
| on: | |
| issues: | |
| types: [labeled, opened] | |
| issue_comment: | |
| types: [created] | |
| jobs: | |
| analyze-bug: | |
| # Only run when 'bug' label is present and comment contains '/claude-fix' | |
| if: | | |
| (github.event_name == 'issues' && contains(github.event.issue.labels.*.name, 'bug')) || | |
| (github.event_name == 'issue_comment' && contains(github.event.comment.body, '/claude-fix')) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Get issue details | |
| id: issue | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const issue = context.issue.number; | |
| const { data } = await github.rest.issues.get({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: issue | |
| }); | |
| return { | |
| title: data.title, | |
| body: data.body, | |
| number: issue | |
| }; | |
| - name: Analyze and fix bug with Claude Code | |
| uses: anthropics/claude-code-action@v1 | |
| with: | |
| anthropic-api-key: ${{ secrets.ANTHROPIC_API_KEY }} | |
| prompt: | | |
| I have a bug report from GitHub issue #${{ steps.issue.outputs.number }}: | |
| Title: ${{ steps.issue.outputs.title }} | |
| Description: | |
| ${{ steps.issue.outputs.body }} | |
| Please analyze this bug and: | |
| 1. Identify the root cause | |
| 2. Create a fix if possible | |
| 3. Add tests to prevent regression | |
| 4. Create a pull request with the fix | |
| Focus on the specific issue described and ensure the fix is minimal and targeted. | |
| # Claude Code specific options | |
| auto-commit: true | |
| branch: fix/issue-${{ steps.issue.outputs.number }} | |
| commit-message: "fix: ${{ steps.issue.outputs.title }} (#${{ steps.issue.outputs.number }})" | |
| - name: Create Pull Request | |
| if: success() | |
| uses: peter-evans/create-pull-request@v5 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| branch: fix/issue-${{ steps.issue.outputs.number }} | |
| title: "Fix: ${{ steps.issue.outputs.title }}" | |
| body: | | |
| Fixes #${{ steps.issue.outputs.number }} | |
| This PR was automatically generated by Claude Code to fix the reported bug. | |
| ## Changes | |
| - Analyzed the issue and identified root cause | |
| - Implemented targeted fix | |
| - Added tests to prevent regression | |
| Please review the changes carefully before merging. | |
| labels: | | |
| bug | |
| automated-fix |