anthropics / anthropics/claude-code-action

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

Ouverte
#853 17 commentaires 17 réactions 0 personnes assignées Voir sur GitHub
bug p1 provider:1p
Langage dominant
TypeScript
Étoiles
8.9k
Forks
2.1k
Merge moyen
3 j 9 h
PR mergées (30 j)
10

Description

## 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

```yaml
- 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!

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.