anthropics / anthropics/claude-code-action

claude.ai onboarding flow fails silently, blocking github app oidc authentication

未关闭
#873 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
area:installation area:permissions bug p1 provider:1p
主要语言
TypeScript
星标
8.9k
派生
2.1k
平均合并
3 天 9 小时
30 天内合并 PR
10

描述

**Describe the bug**

The `/install-github-app` onboarding flow at claude.ai fails silently, preventing users from completing the GitHub App → Anthropic account linking required for OIDC authentication. The onboarding page displays a spinner indefinitely with no error message.

**To Reproduce**

1. Install the Claude GitHub App on an organization via GitHub
2. Navigate to claude.ai to complete the onboarding/linking process
3. The page shows "Let's create your account" or onboarding wizard
4. Page spins indefinitely, never completes

**Browser Console Errors**

The following CORS errors appear repeatedly in the browser console:

```
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://statsig.anthropic.com/v1/rgstr?...
(Reason: CORS request did not succeed). Status code: (null).

ERROR [Statsig] A networking error occurred during POST request to https://statsig.anthropic.com/v1/rgstr...
TypeError: NetworkError when attempting to fetch resource.

WARN [Statsig] Failed to flush events.
```

These errors suggest the onboarding page depends on statsig.anthropic.com for feature flags/analytics, but requests are being blocked. This affects users with:
- Firefox Enhanced Tracking Protection
- Privacy-focused browser extensions (uBlock Origin, Privacy Badger, etc.)
- Network-level ad blocking (Pi-hole, etc.)

**Expected behavior**

1. Onboarding should complete successfully, or
2. If statsig requests fail, the page should gracefully degrade and still allow completion, or
3. At minimum, show a clear error message explaining what's blocking completion

**Workflow Result**

Because onboarding never completes, the GitHub Action fails with:

```
Requesting OIDC token...
OIDC token successfully obtained
Exchanging OIDC token for app token...
App token exchange failed: 401 Unauthorized - Invalid OIDC token
```

The OIDC token is valid (from GitHub), but Anthropic's backend rejects it because the GitHub App installation was never linked to an Anthropic account.

**Workaround**

Adding `github_token: ${{ secrets.GITHUB_TOKEN }}` to the workflow bypasses OIDC entirely, but this:
- Loses the `claude[bot]` branding (comments come from `github-actions[bot]`)
- Disables `use_sticky_comment` feature

**Workflow yml file**

```yaml
- uses: anthropics/claude-code-action@v1
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
# github_token: ${{ secrets.GITHUB_TOKEN }} # Workaround
```

**API Provider**

[x] Anthropic First-Party API (default)
[ ] AWS Bedrock
[ ] GCP Vertex

**Additional context**

- Browser: Firefox with Enhanced Tracking Protection
- GitHub App shows as properly installed on the organization
- The onboarding issue persists even after disabling some tracking protection (other dependencies may also be blocked)
- Multiple users report similar issues in existing GitHub issues (#701, #721, #522)

**Suggested improvements**

1. Make statsig dependency non-blocking for core onboarding functionality
2. Add clear error messaging when onboarding cannot complete
3. Update documentation to prominently feature the `github_token` workaround
4. Consider making the generated workflow from `/install-github-app` include `github_token` by default

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。