diff --git a/open-sse/services/autoCombo/virtualFactory.ts b/open-sse/services/autoCombo/virtualFactory.ts index 123af3bda7..d8777fd6f5 100644 --- a/open-sse/services/autoCombo/virtualFactory.ts +++ b/open-sse/services/autoCombo/virtualFactory.ts @@ -55,13 +55,6 @@ export async function createVirtualAutoCombo( weights: { ...DEFAULT_WEIGHTS }, explorationRate: 0.05, routerStrategy: "lkgp", - config: { - candidatePool: emptyPool, - weights: { ...DEFAULT_WEIGHTS }, - explorationRate: 0.05, - routingStrategy: "lkgp", - }, - models: emptyPool, }; } @@ -122,20 +115,9 @@ export async function createVirtualAutoCombo( id: `virtual-auto-${variant || "default"}`, name: `Auto ${variant || "Default"}`, type: "auto", - // Root-level fields for AutoComboConfig type compatibility candidatePool: pool, weights: weights, explorationRate: explorationRate, routerStrategy: routerStrategy, - // Nested config for combo router's auto-type handler - // (reads via: combo?.autoConfig || combo?.config?.auto || combo?.config || {}) - config: { - candidatePool: pool, - weights: weights, - explorationRate: explorationRate, - routingStrategy: routerStrategy, - }, - // models array so resolveComboTargets doesn't get an empty array - models: pool, }; } diff --git a/tests/unit/models-catalog-route.test.ts b/tests/unit/models-catalog-route.test.ts index b6045efe90..495b730abf 100644 --- a/tests/unit/models-catalog-route.test.ts +++ b/tests/unit/models-catalog-route.test.ts @@ -24,16 +24,19 @@ async function resetStorage() { fs.mkdirSync(TEST_DATA_DIR, { recursive: true }); } -async function seedConnection(provider, overrides = {}) { +async function seedConnection( + provider: string, + overrides: Record = {} +) { return providersDb.createProviderConnection({ provider, - authType: overrides.authType || "apikey", - name: overrides.name || `${provider}-${Math.random().toString(16).slice(2, 8)}`, - apiKey: overrides.apiKey || "sk-test", - accessToken: overrides.accessToken, - isActive: overrides.isActive ?? true, - testStatus: overrides.testStatus || "active", - providerSpecificData: overrides.providerSpecificData || {}, + authType: (overrides.authType as string) || "apikey", + name: (overrides.name as string) || `${provider}-${Math.random().toString(16).slice(2, 8)}`, + apiKey: (overrides.apiKey as string) || "sk-test", + accessToken: overrides.accessToken as string | undefined, + isActive: (overrides.isActive as boolean) ?? true, + testStatus: (overrides.testStatus as string) || "active", + providerSpecificData: (overrides.providerSpecificData as Record) || {}, }); }