fix(core): remove OAuth check from handleFallback and clean up stray file (#21962)

This commit is contained in:
Sehoon Shon
2026-03-11 00:56:06 -04:00
committed by GitHub
parent 075e0b1a81
commit e54c450bc1
3 changed files with 0 additions and 81 deletions

View File

@@ -59,7 +59,6 @@ vi.mock('../utils/debugLogger.js', () => ({
const MOCK_PRO_MODEL = DEFAULT_GEMINI_MODEL;
const FALLBACK_MODEL = DEFAULT_GEMINI_FLASH_MODEL;
const AUTH_OAUTH = AuthType.LOGIN_WITH_GOOGLE;
const AUTH_API_KEY = AuthType.USE_GEMINI;
const createMockConfig = (overrides: Partial<Config> = {}): Config =>
({
@@ -129,16 +128,6 @@ describe('handleFallback', () => {
);
});
it('should return null immediately if authType is not OAuth', async () => {
const result = await handleFallback(
policyConfig,
MOCK_PRO_MODEL,
AUTH_API_KEY,
);
expect(result).toBeNull();
expect(policyHandler).not.toHaveBeenCalled();
});
it('uses availability selection with correct candidates when enabled', async () => {
// Direct mock manipulation since it's already a vi.fn()
vi.mocked(policyConfig.getModel).mockReturnValue(

View File

@@ -5,7 +5,6 @@
*/
import type { Config } from '../config/config.js';
import { AuthType } from '../core/contentGenerator.js';
import {
openBrowserSecurely,
shouldLaunchBrowser,
@@ -29,10 +28,6 @@ export async function handleFallback(
authType?: string,
error?: unknown,
): Promise<string | boolean | null> {
if (authType !== AuthType.LOGIN_WITH_GOOGLE) {
return null;
}
const chain = resolvePolicyChain(config);
const { failedPolicy, candidates } = buildFallbackPolicyContext(
chain,