Skip to content

Intermittent SDK crash on PR review - exits with code 1 after ~150ms with $0 cost #853

@ibabencu

Description

@ibabencu

Description

The Claude Code Review workflow intermittently crashes almost immediately after initialization, before making any API calls.

Error Pattern

{
  "type": "result",
  "subtype": "success",
  "is_error": true,
  "duration_ms": 158,
  "num_turns": 1,
  "total_cost_usd": 0,
  "permission_denials": []
}

error: Claude Code process exited with code 1
      at $ (.../node_modules/@anthropic-ai/claude-agent-sdk/sdk.mjs:19:7668)

Key observations:

  • duration_ms: ~150-180ms - crashes almost instantly
  • total_cost_usd: 0 - no API calls were made
  • permission_denials: [] - not a permissions issue
  • Model initializes successfully: "model": "claude-sonnet-4-5-20250929"

Intermittent Nature

Same workflow, same configuration - some PRs succeed, others fail:

Time PR Type Result Duration
09:35 Human PR ✅ Success 1m52s
07:46 Human PR ✅ Success 1m43s
10:57 Dependabot PR ❌ Fail 21s
12:11 Human PR ❌ Fail 33s

Re-running the failed workflow produces the same failure.

Workflow Configuration

- name: Run Claude Code Review
  uses: anthropics/claude-code-action@v1
  with:
    anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
    prompt: |
      Please review this PR...
    claude_args: |
      --allowed-tools "mcp__github__get_pull_request,mcp__github__get_pull_request_files,mcp__github__create_pending_pull_request_review,mcp__github__add_comment_to_pending_review,mcp__github__submit_pending_pull_request_review,mcp__github__get_pull_request_diff"

Environment

  • Runner: ubuntu-latest
  • Action version: anthropics/claude-code-action@v1
  • API key: Confirmed valid (works on other PRs in same repo)

Expected Behavior

Workflow should either succeed or fail with a meaningful error message.

Actual Behavior

SDK crashes with minified JavaScript stack trace, no clear error message about root cause.

Questions

  1. Is there a known issue with certain PR content triggering this?
  2. Would pinning to a specific version help?
  3. Is there additional debug logging we can enable?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingp1Showstopper bug preventing substantial subset of users from using the product, or incorrect docsprovider:1pAnthropic First-Party API

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions