feat: box Claude auth via subscription OAuth token (setup-token)#176
Open
NagariaHussain wants to merge 1 commit into
Open
feat: box Claude auth via subscription OAuth token (setup-token)#176NagariaHussain wants to merge 1 commit into
NagariaHussain wants to merge 1 commit into
Conversation
Adds a "Claude Code OAuth Token" (Password) field to Hive Settings and forwards it to boxes as CLAUDE_CODE_OAUTH_TOKEN in build_boot_env — an alternative to ANTHROPIC_API_KEY for when API access isn't available. Generate it with `claude setup-token` (uses a Claude subscription, not API billing). The box needs no change: devbox-init exports any boot_env key into the shell, and claude falls back to the OAuth token when ANTHROPIC_API_KEY is empty. The token is forwarded only when no API key is set, so the two auth modes never conflict — flip to the API key later by filling anthropic_api_key and clearing this. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011C9jzHhfxDqtU13uWtazZm
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.
Lets agent boxes authenticate Claude via a Claude subscription instead of an Anthropic API key — unblocks running the agent when API access isn't available (the whole v2 test-server validation ran on subscription creds).
What
build_boot_envforwards it to boxes asCLAUDE_CODE_OAUTH_TOKEN, only whenanthropic_api_keyis empty (so the two auth modes never conflict).Why no box/golden change is needed
devbox-init.shwrites MMDS env generically ((.env) | to_entries | map("export "+.key…)), so a new boot_env key flows into the box shell automatically.ANTHROPIC_API_KEYis empty,claudefalls back toCLAUDE_CODE_OAUTH_TOKEN.Usage
claude setup-tokenlocally → long-lived subscription token.anthropic_api_keyand clearing this field.Validation
hive_settings.jsonvalid;service.pycompiles; migrate clean onpms.localhost— field present as Password. Auth branch: API-key-set → forwardsANTHROPIC_API_KEYonly; API-key-empty → forwardsCLAUDE_CODE_OAUTH_TOKENonly.Deploys via Frappe Cloud on merge (adds the field on migrate).
🤖 Generated with Claude Code