Skip to content

fix: clarify Claude Code credential auth error#20283

Open
Joeyzzyy wants to merge 1 commit intoanomalyco:devfrom
Joeyzzyy:fix/claude-code-credential-guidance
Open

fix: clarify Claude Code credential auth error#20283
Joeyzzyy wants to merge 1 commit intoanomalyco:devfrom
Joeyzzyy:fix/claude-code-credential-guidance

Conversation

@Joeyzzyy
Copy link
Copy Markdown

@Joeyzzyy Joeyzzyy commented Mar 31, 2026

Issue for this PR

Closes #7456

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

When OpenCode receives Anthropic auth errors for Claude Code-only credentials, the existing error text does not clearly tell the user what to do next.

This change detects that specific credential error and replaces it with clearer guidance that says the credential is restricted to Claude Code, cannot be used with OpenCode, and that the user should use a standard Anthropic API key and run opencode auth login anthropic.

The change is intentionally narrow and only affects provider error messaging for this specific Anthropic auth case.

How did you verify your code works?

  • added a focused provider error test for the Claude Code-only credential case
  • ran bun test test/provider/error.test.ts
  • ran bun typecheck
  • verified generic Anthropic auth errors are not rewritten into the Claude Code-specific guidance

Screenshots / recordings

Not a UI change.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions github-actions bot added needs:compliance This means the issue will auto-close after 2 hours. and removed needs:compliance This means the issue will auto-close after 2 hours. labels Mar 31, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

@Joeyzzyy
Copy link
Copy Markdown
Author

Joeyzzyy commented Apr 1, 2026

I checked the failing e2e jobs and they are both failing in packages/app e2e review flows (), which looks unrelated to this provider error messaging change.

The provider-focused test and typecheck pass locally. I have re-run the failed jobs to check whether this is a flaky CI failure.

@Joeyzzyy
Copy link
Copy Markdown
Author

Joeyzzyy commented Apr 1, 2026

I checked the failing e2e jobs and they are both failing in packages/app e2e review flows (session-review.spec.ts), which looks unrelated to this provider error messaging change.

The provider-focused test and typecheck pass locally. I have re-run the failed jobs to check whether this is a flaky CI failure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: Claude Code API credentials

1 participant