feat(claude): add Claude 5 models and Claude Code OAuth scopes - #68
Open
mahdiwafy wants to merge 3 commits into
Open
feat(claude): add Claude 5 models and Claude Code OAuth scopes#68mahdiwafy wants to merge 3 commits into
mahdiwafy wants to merge 3 commits into
Conversation
The Claude Code (cc) provider's model list stopped at Opus 4.8 and was missing the entire Claude 5 generation — even though the CLI defaults in cliTools.js already point at cc/claude-fable-5 and cc/claude-sonnet-5. Add the three generally-available Claude 5 models (per Anthropic's model docs), keeping 4.x as legacy entries: - claude-fable-5 ($10/$50, 1M ctx, adaptive thinking always-on) - claude-opus-5 ($5/$25, 1M ctx, adaptive thinking) - claude-sonnet-5 ($3/$15, 1M ctx, adaptive thinking) Also add exact capabilities entries for claude-opus-5 / claude-fable-5 (so the generic *claude* pattern doesn't downgrade them to claude-budget thinking) and canonical pricing for claude-opus-5 / claude-sonnet-5. claude-mythos-5 is intentionally omitted — it is invitation-only (Project Glasswing) and not generally accessible. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Match the official Claude Code OAuth client scope set by requesting user:sessions:claude_code and user:mcp_servers in addition to the existing profile/inference scopes. Tokens minted without these scopes can connect for basic OAuth but fail Claude Code session/usage endpoints or org policy checks. Also send the same Claude CLI fingerprint headers to the OAuth usage endpoint that we already use for Claude Code inference. When Anthropic rejects OAuth for an organization, surface an explicit org-policy message instead of falling back to the misleading legacy admin-permissions text. Note that oauth_not_allowed_for_organization is still an Anthropic org policy decision; users must reconnect after this change to mint a fresh scoped token, and accounts in orgs that disable OAuth still need an org admin or a different Claude account. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
claude.ai/oauth/authorize rejects our redirect_uri (https://api.bevansatria.my.id/callback) with "Redirect URI ... is not supported by client" because it isn't on the whitelist for the public Claude Code client_id. Switch to the same redirect Anthropic's own Claude Code CLI uses (https://platform.claude.com/oauth/code/callback), which is whitelisted. Since that redirect lands on Anthropic's domain instead of our own /callback route, the popup can never postMessage/BroadcastChannel the code back to us — force manual-paste mode for the claude provider and accept Anthropic's bare `code#state` callback format (not a full URL). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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
Scope
Focused only on Claude model catalog and Claude Code OAuth behavior.
Verification
npm run lint:undef