fix(desktop): label the Anthropic OAuth/Pro card 'Anthropic Account'
The accounts page and onboarding picker labeled the anthropic entry 'Anthropic API Key' even though that flow (hermes auth add anthropic) connects the Claude Pro/Max subscription via OAuth/PKCE. Users with a subscription read the label literally, concluded they needed an API key, and went key-hunting. The entry that actually wants a pasted key is 'claude-code' (claude setup-token), which keeps its own name. Rename the shared PROVIDER_DISPLAY_NAMES entry and the dashboard provider-catalog name to 'Anthropic Account', and update the onboarding test assertions. Fixes #59071 Salvages #59073 (same rename, authored by Kailigithub) Co-authored-by: Kailigithub <12250313+Kailigithub@users.noreply.github.com>
This commit is contained in:
@@ -57,12 +57,12 @@ describe('onboarding Picker', () => {
|
||||
// Fireworks stays behind the disclosure with the other alternatives; only
|
||||
// Nous Portal is visible before the user expands the list.
|
||||
expect(screen.queryByText('Fireworks AI')).toBeNull()
|
||||
expect(screen.queryByText('Anthropic API Key')).toBeNull()
|
||||
expect(screen.queryByText('Anthropic Account')).toBeNull()
|
||||
|
||||
fireEvent.click(screen.getByRole('button', { name: 'Other providers' }))
|
||||
|
||||
expect(screen.getByText('Fireworks AI')).toBeTruthy()
|
||||
expect(screen.getByText('Anthropic API Key')).toBeTruthy()
|
||||
expect(screen.getByText('Anthropic Account')).toBeTruthy()
|
||||
expect(screen.getByRole('button', { name: 'Collapse' })).toBeTruthy()
|
||||
})
|
||||
|
||||
@@ -74,7 +74,7 @@ describe('onboarding Picker', () => {
|
||||
render(<Picker ctx={ctx} />)
|
||||
|
||||
expect(screen.getByText('Fireworks AI')).toBeTruthy()
|
||||
expect(screen.getByText('Anthropic API Key')).toBeTruthy()
|
||||
expect(screen.getByText('Anthropic Account')).toBeTruthy()
|
||||
expect(screen.getByText('ChatGPT or Codex Subscription')).toBeTruthy()
|
||||
expect(screen.queryByText('Other sign-in options')).toBeNull()
|
||||
expect(screen.queryByText('Recommended')).toBeNull()
|
||||
|
||||
@@ -36,7 +36,7 @@ export function currentPickerSelection(
|
||||
* `xai-oauth` never reads as the plain `xai` key path, and internal route names
|
||||
* never reach user-facing copy. */
|
||||
export const PROVIDER_DISPLAY_NAMES: Readonly<Record<string, string>> = {
|
||||
anthropic: 'Anthropic API Key',
|
||||
anthropic: 'Anthropic Account',
|
||||
'claude-code': 'Anthropic OAuth: Required Extra Usage Credits to Use Subscription',
|
||||
'minimax-oauth': 'MiniMax',
|
||||
nous: 'Nous Portal',
|
||||
|
||||
@@ -41,7 +41,7 @@ def _token_status(source: str, source_label: str, creds: Dict[str, Any]) -> Dict
|
||||
|
||||
|
||||
def _anthropic_oauth_status() -> Dict[str, Any]:
|
||||
"""Status for the "Anthropic API Key" card: Hermes-managed PKCE file first, then the
|
||||
"""Status for the "Anthropic Account" card: Hermes-managed PKCE file first, then the
|
||||
registry-ordered env vars (process env — where Bitwarden-sourced secrets land — then .env).
|
||||
|
||||
Claude Code's ``~/.claude/.credentials.json`` is deliberately NOT read here; it has its own
|
||||
@@ -167,7 +167,7 @@ _OAUTH_PROVIDER_CATALOG: tuple[Dict[str, Any], ...] = (
|
||||
# in-dashboard Connect button would let a scriptable HTTP endpoint mint Claude Pro/Max
|
||||
# subscription tokens outside Anthropic's own client, against its OAuth usage policies.
|
||||
# Login works via the terminal (`hermes auth add anthropic`) or a plain API key.
|
||||
{"id": "anthropic", "name": "Anthropic API Key", "flow": "external", "cli_command": "hermes auth add anthropic",
|
||||
{"id": "anthropic", "name": "Anthropic Account", "flow": "external", "cli_command": "hermes auth add anthropic",
|
||||
"docs_url": "https://docs.claude.com/en/api/getting-started", "status_fn": _anthropic_oauth_status},
|
||||
{"id": "claude-code", "name": "Anthropic OAuth: Required Extra Usage Credits to Use Subscription",
|
||||
"flow": "external", "cli_command": "claude setup-token",
|
||||
|
||||
Reference in New Issue
Block a user