anthropics / anthropics/claude-code-action

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

Abierto
#853 17 comentarios 17 reacciones 0 asignados Ver en GitHub
bug p1 provider:1p
Lenguaje dominante
TypeScript
Estrellas
8.9k
Forks
2.1k
Merge medio
3 d 9 h
PR fusionados (30 d)
10

Descripción

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

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.