anthropics / anthropics/claude-code-action
Claude Code CLI crashes on startup in CI (exit code 1, ajv schema validation)
- 主要言語
- TypeScript
- スター
- 8.9k
- フォーク
- 2.1k
- 平均マージ
- 3日 9時間
- マージ済み PR(30日)
- 10
説明
## Description
The Claude Code CLI crashes during startup in GitHub Actions with exit code 1, before making any API calls ($0 cost, 183ms duration). This appears to be a schema validation error in `ajv`.
## Environment
- **Action**: `anthropics/claude-code-action@v1`
- **Agent SDK**: `@anthropic-ai/claude-agent-sdk@0.2.42`
- **Claude Code**: v2.1.31 (bundled), also reproduced with latest via native installer
- **Runner**: `ubuntu-latest`
- **Auth**: OAuth token (`claude_code_oauth_token`)
## Timeline
- **Working**: Feb 14, 2026 -- PR review completed successfully on `push2` branch (20 turns, $0.65 cost)
- **Broken**: Feb 15, 2026 -- same workflow, same config, crashes on startup
Both runs used identical SDK options, identical Claude Code version (2.1.31), identical workflow file.
## Reproduction
Minimal workflow that reproduces the issue:
```yaml
name: PR Review
on:
pull_request:
types: [opened, synchronize]
jobs:
claude-review:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
issues: read
id-token: write
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 1
- uses: anthropics/claude-code-action@v1
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
prompt: "Review this PR"
claude_args: '--allowed-tools "Bash(gh pr diff:*),Bash(gh pr view:*)"'
```
## Error output
The SDK result shows immediate failure:
```json
{
"type": "result",
"subtype": "success",
"is_error": true,
"duration_ms": 183,
"num_turns": 1,
"total_cost_usd": 0,
"permission_denials": []
}
```
Followed by a minified JS stack trace from `ajv` schema validation (`dependencies` keyword handler):
```
SDK execution error: 14 | depsCount: ${X},
15 | deps: ${Y}}`};var Tj={keyword:"dependencies",type:"object",schemaType:"object",...
...
error: Claude Code process exited with code 1
at Y (.../node_modules/@anthropic-ai/claude-agent-sdk/sdk.mjs:19:7919)
at emit (node:events:98:22)
at #handleOnExit (node:child_process:520:14)
```
## What we tried
1. Re-running the job multiple times -- same failure
2. Installing latest Claude Code via native installer (`curl -fsSL https://claude.ai/install.sh | bash`) with `path_to_claude_code_executable` -- same crash
3. Installing via npm (`npm install -g @anthropic-ai/claude-code@latest`) -- SDK rejects non-native binary
## Successful run for comparison
- Run ID: 22025297491 (Feb 14, `push2` branch) -- succeeded
- Run ID: 22029616604 (Feb 15, `email` branch) -- failed
- Both used SDK 0.2.42, Claude Code 2.1.31, identical workflow, identical SDK options
## Failing runs
- https://github.com/Brief-Solutions/brief/actions/runs/22029616604/job/63652731603
- https://github.com/Brief-Solutions/brief/actions/runs/22029979002/job/63653391172
コントリビューションガイド
評価
この issue はまだ評価されていません。