mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-29 14:34:55 -07:00
chore(core): remove redundant isModelAvailabilityServiceEnabled toggle and clean up dead code (#15207)
This commit is contained in:
@@ -119,7 +119,6 @@ describe('policyHelpers', () => {
|
||||
overrides: Partial<Config> = {},
|
||||
): Config => {
|
||||
const defaults = {
|
||||
isModelAvailabilityServiceEnabled: () => true,
|
||||
getModelAvailabilityService: () => mockAvailabilityService,
|
||||
setActiveModel: vi.fn(),
|
||||
modelConfigService: mockModelConfigService,
|
||||
@@ -131,15 +130,6 @@ describe('policyHelpers', () => {
|
||||
vi.clearAllMocks();
|
||||
});
|
||||
|
||||
it('returns requested model if availability service is disabled', () => {
|
||||
const config = createExtendedMockConfig({
|
||||
isModelAvailabilityServiceEnabled: () => false,
|
||||
});
|
||||
const result = applyModelSelection(config, 'gemini-pro');
|
||||
expect(result.model).toBe('gemini-pro');
|
||||
expect(config.setActiveModel).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('returns requested model if it is available', () => {
|
||||
const config = createExtendedMockConfig();
|
||||
mockAvailabilityService.selectFirstAvailable.mockReturnValue({
|
||||
|
||||
@@ -117,9 +117,6 @@ export function createAvailabilityContextProvider(
|
||||
modelGetter: () => string,
|
||||
): () => RetryAvailabilityContext | undefined {
|
||||
return () => {
|
||||
if (!config.isModelAvailabilityServiceEnabled()) {
|
||||
return undefined;
|
||||
}
|
||||
const service = config.getModelAvailabilityService();
|
||||
const currentModel = modelGetter();
|
||||
|
||||
@@ -138,11 +135,7 @@ export function createAvailabilityContextProvider(
|
||||
export function selectModelForAvailability(
|
||||
config: Config,
|
||||
requestedModel: string,
|
||||
): ModelSelectionResult | undefined {
|
||||
if (!config.isModelAvailabilityServiceEnabled()) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
): ModelSelectionResult {
|
||||
const chain = resolvePolicyChain(config, requestedModel);
|
||||
const selection = config
|
||||
.getModelAvailabilityService()
|
||||
|
||||
Reference in New Issue
Block a user