@@ -1127,6 +1127,86 @@ describe("CodeIndexConfigManager", () => {
11271127 expect ( requiresRestart ) . toBe ( true )
11281128 } )
11291129 } )
1130+
1131+ describe ( "semble provider configuration" , ( ) => {
1132+ it ( "should load semble provider configuration" , async ( ) => {
1133+ mockContextProxy . getGlobalState . mockReturnValue ( {
1134+ codebaseIndexEnabled : true ,
1135+ codebaseIndexEmbedderProvider : "semble" ,
1136+ } )
1137+ mockContextProxy . getSecret . mockReturnValue ( undefined )
1138+
1139+ const result = await configManager . loadConfiguration ( )
1140+
1141+ expect ( result . currentConfig . embedderProvider ) . toBe ( "semble" )
1142+ expect ( result . currentConfig . isConfigured ) . toBe ( true )
1143+ } )
1144+
1145+ it ( "should require restart when switching from openai to semble" , async ( ) => {
1146+ // Initial state with OpenAI
1147+ mockContextProxy . getGlobalState . mockReturnValue ( {
1148+ codebaseIndexEnabled : true ,
1149+ codebaseIndexQdrantUrl : "http://qdrant.local" ,
1150+ codebaseIndexEmbedderProvider : "openai" ,
1151+ codebaseIndexEmbedderModelId : "text-embedding-3-small" ,
1152+ } )
1153+ setupSecretMocks ( {
1154+ codeIndexOpenAiKey : "test-key" ,
1155+ } )
1156+
1157+ await configManager . loadConfiguration ( )
1158+
1159+ // Switch to semble
1160+ mockContextProxy . getGlobalState . mockReturnValue ( {
1161+ codebaseIndexEnabled : true ,
1162+ codebaseIndexEmbedderProvider : "semble" ,
1163+ } )
1164+ mockContextProxy . getSecret . mockReturnValue ( undefined )
1165+
1166+ const result = await configManager . loadConfiguration ( )
1167+ expect ( result . requiresRestart ) . toBe ( true )
1168+ } )
1169+
1170+ it ( "should require restart when switching from semble to openai" , async ( ) => {
1171+ // Initial state with semble
1172+ mockContextProxy . getGlobalState . mockReturnValue ( {
1173+ codebaseIndexEnabled : true ,
1174+ codebaseIndexEmbedderProvider : "semble" ,
1175+ } )
1176+ mockContextProxy . getSecret . mockReturnValue ( undefined )
1177+
1178+ await configManager . loadConfiguration ( )
1179+
1180+ // Switch to openai
1181+ mockContextProxy . getGlobalState . mockReturnValue ( {
1182+ codebaseIndexEnabled : true ,
1183+ codebaseIndexQdrantUrl : "http://qdrant.local" ,
1184+ codebaseIndexEmbedderProvider : "openai" ,
1185+ codebaseIndexEmbedderModelId : "text-embedding-3-small" ,
1186+ } )
1187+ setupSecretMocks ( {
1188+ codeIndexOpenAiKey : "test-key" ,
1189+ } )
1190+
1191+ const result = await configManager . loadConfiguration ( )
1192+ expect ( result . requiresRestart ) . toBe ( true )
1193+ } )
1194+
1195+ it ( "should not require restart when semble config stays the same" , async ( ) => {
1196+ // Initial state with semble
1197+ mockContextProxy . getGlobalState . mockReturnValue ( {
1198+ codebaseIndexEnabled : true ,
1199+ codebaseIndexEmbedderProvider : "semble" ,
1200+ } )
1201+ mockContextProxy . getSecret . mockReturnValue ( undefined )
1202+
1203+ await configManager . loadConfiguration ( )
1204+
1205+ // Same semble config again
1206+ const result = await configManager . loadConfiguration ( )
1207+ expect ( result . requiresRestart ) . toBe ( false )
1208+ } )
1209+ } )
11301210 } )
11311211
11321212 describe ( "isConfigured" , ( ) => {
@@ -1684,6 +1764,30 @@ describe("CodeIndexConfigManager", () => {
16841764 expect ( configManager . isConfigured ( ) ) . toBe ( false )
16851765 } )
16861766
1767+ it ( "should always return true for semble provider (no API keys or Qdrant needed)" , ( ) => {
1768+ mockContextProxy . getGlobalState . mockReturnValue ( {
1769+ codebaseIndexEnabled : true ,
1770+ codebaseIndexEmbedderProvider : "semble" ,
1771+ } )
1772+ mockContextProxy . getSecret . mockReturnValue ( undefined )
1773+
1774+ configManager = new CodeIndexConfigManager ( mockContextProxy )
1775+ expect ( configManager . isConfigured ( ) ) . toBe ( true )
1776+ } )
1777+
1778+ it ( "should return true for semble even without any other configuration" , ( ) => {
1779+ mockContextProxy . getGlobalState . mockReturnValue ( {
1780+ codebaseIndexEnabled : true ,
1781+ codebaseIndexEmbedderProvider : "semble" ,
1782+ // No qdrant URL, no API keys
1783+ } )
1784+ mockContextProxy . getSecret . mockReturnValue ( undefined )
1785+
1786+ configManager = new CodeIndexConfigManager ( mockContextProxy )
1787+ expect ( configManager . isConfigured ( ) ) . toBe ( true )
1788+ expect ( configManager . isFeatureConfigured ) . toBe ( true )
1789+ } )
1790+
16871791 describe ( "currentModelDimension" , ( ) => {
16881792 beforeEach ( ( ) => {
16891793 vi . clearAllMocks ( )
0 commit comments