anthropics / anthropics/claude-code-action

claude_code_oauth_token (sk-ant-oat01-*) fails with Header 14 invalid value

Open
#1,316 0 comments 11 reactions 0 assignees View on GitHub
bug p2 provider:1p
Dominant language
TypeScript
Stars
8.9k
Forks
2.1k
Avg merge
3d 9h
Merged PRs (30d)
10

Description

## Bug Description

When using `claude_code_oauth_token` with a token generated by `claude setup-token` (prefix `sk-ant-oat01-*`), the action fails with:

```
API Error: Header '14' has invalid value: '***'
```

The same token works correctly when used locally with `claude -p`.

## Steps to Reproduce

1. Generate OAuth token: `claude setup-token` (Max 5x plan, `sk-ant-oat01-*` format)
2. Store as GitHub secret `CLAUDE_CODE_OAUTH_TOKEN`
3. Configure workflow with `claude_code_oauth_token` parameter
4. Trigger via `@claude` comment on a PR

## Observed Behavior

The OIDC and app token exchange succeed, but Claude Code SDK fails:

```
OIDC token successfully obtained
App token successfully obtained
...
SDK execution error: Error: Claude Code returned an error result: API Error: Header '14' has invalid value
```

## Also Tried

- Passing the same OAuth token via `anthropic_api_key` parameter: `Invalid API key` error (expected, different code path)
- Token works locally: `ANTHROPIC_API_KEY=sk-ant-oat01-... claude -p "echo test"` succeeds

## Environment

- Plan: Max 5x
- Auth method: claude.ai (OAuth)
- Action version: v1 (SHA: 51ea8ea73a139f2a74ff649e3092c25a904aed7e)
- Runner: ubuntu-latest (Ubuntu 24.04)
- Workflow permissions include id-token: write
- claude auth status locally shows: loggedIn: true, authMethod: claude.ai, subscriptionType: max

Contributor guide

Open the contributing guide

Research direction

Start by tracing the workflow's claude_code_oauth_token path from the OIDC and app token exchange into Claude Code SDK execution, comparing it with the local claude -p path. Reproduce with a sk-ant-oat01-* token and confirm the workflow completes without the Header '14' invalid-value error.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, typescript
Domain
authentication, ci-cd
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.