anthropics / anthropics/claude-code-action

SDK crash with AJV error using claude_code_oauth_token - same as #852/#853

Open
#872 8 comments 6 reactions 0 assignees View on GitHub
area:installation bug duplicate p1 provider:1p
Dominant language
TypeScript
Stars
8.9k
Forks
2.1k
Avg merge
3d 9h
Merged PRs (30d)
10

Description

## Description

Claude Code Review workflow crashes immediately with AJV validation error when using `claude_code_oauth_token`. This appears to be the same issue as #852 and #853.

## Error Output

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

SDK execution error: 14 | depsCount: ${Q},
15 | deps: ${$}}`};var Pj={keyword:"dependencies",type:"object",schemaType:"object"...

error: Claude Code process exited with code 1
at $ (/home/runner/work/_actions/anthropics/claude-code-action/v1/base-action/node_modules/@anthropic-ai/claude-agent-sdk/sdk.mjs:19:7668)
```

## Key Observations

- **duration_ms: ~261ms** - crashes almost instantly
- **total_cost_usd: 0** - no API calls made
- **Consistent failure** - re-running produces same error
- Error is from AJV (JSON Schema validator) in the SDK

## Failed Run

https://github.com/tjarko/ReelMoments/actions/runs/21442022109/job/61747809187

## Workflow Configuration

```yaml
name: Claude PR Review

on:
pull_request:
types: [opened, synchronize, reopened]

permissions:
contents: read
pull-requests: write
id-token: write

jobs:
review:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Claude Code Review
uses: anthropics/claude-code-action@v1
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
claude_args: '--model claude-sonnet-4-20250514 --timeout 900000'
prompt: |
Review this PR against our CLAUDE.md standards...
```

## Environment

- Runner: ubuntu-latest
- Action: `anthropics/claude-code-action@v1`
- Auth method: `claude_code_oauth_token`

## Related Issues

- #852 - SDK 0.2.15 causes AJV validation error
- #853 - Intermittent SDK crash on PR review

## Notes

Per #852 comments, one user resolved this by switching from `claude_code_oauth_token` to `anthropic_api_key`. This suggests the underlying issue is authentication failing, but the SDK crashes with a confusing AJV error instead of surfacing the auth error properly.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.