Accept CLAUDE_CODE_OAUTH_TOKEN for anthropic provider auth#40
Open
ChasLui wants to merge 1 commit into
Open
Conversation
Anthropic Pro/Max subscribers authenticate via OAuth (CLAUDE_CODE_OAUTH_TOKEN) rather than ANTHROPIC_API_KEY. claude-agent-sdk already supports this env var internally — extending the harness allowlist lets subscription users run the Claude harness without provisioning an API key. Other harnesses (codex/opencode/goose/openhands) bind api_key into SDK constructors directly, so OAuth flow is not applicable there and they remain unchanged.
Collaborator
|
@ChasLui Can you attach some terminal logs of it working with CLAUDE_CODE_OAUTH_TOKEN |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CLAUDE_CODE_OAUTH_TOKENto the anthropic provider's accepted env var list insrc/harness/provider_auth.pyMotivation
claude-agent-sdkalready readsCLAUDE_CODE_OAUTH_TOKENinternally (seeclaude_agent_sdk/_internal/session_resume.py), and the bundledclaudeCLI binary picks up subscription credentials from~/.claude/.credentials.json. The only thing blocking subscription users was EvoSkill's own pre-flightensure_provider_api_key("anthropic")check, which hard-requiredANTHROPIC_API_KEY.Scope
This change only touches the
anthropicentry. Other harnesses (codex / opencode / goose / openhands) bindapi_keydirectly into SDK constructors (e.g.Codex({"api_key": api_key}),llm_kwargs["api_key"] = ...), so OAuth-style credentials don't flow through there — those harnesses are intentionally left unchanged.Test plan
evoskill --helpstill loads after installevoskill init→ select claude harness →evoskill runwith onlyCLAUDE_CODE_OAUTH_TOKENexported (noANTHROPIC_API_KEY)