* CCR and Claude Desktop spawn the CLI with OAuth and should never fall back * to the user's ~/.claude/settings.json API-key config (apiKeyHelper, * env.ANTHROPIC_API_KEY, env.ANTHROPIC_AUTH_TOKEN). Those settings exist for * the user's terminal CLI, not managed sessions. Without this guard, a us
()
| 89 | * also use that key — and fail if it's stale/wrong-org. |
| 90 | */ |
| 91 | function isManagedOAuthContext(): boolean { |
| 92 | return ( |
| 93 | isEnvTruthy(process.env.CLAUDE_CODE_REMOTE) || |
| 94 | process.env.CLAUDE_CODE_ENTRYPOINT === 'claude-desktop' |
| 95 | ) |
| 96 | } |
| 97 | |
| 98 | /** Whether we are supporting direct 1P auth. */ |
| 99 | // this code is closely related to getAuthTokenSource |
no test coverage detected