@@ -32,7 +32,7 @@ describe("CodeIndexConfigManager", () => {
3232 describe ( "constructor" , ( ) => {
3333 it ( "should initialize with ContextProxy" , ( ) => {
3434 expect ( configManager ) . toBeDefined ( )
35- expect ( configManager . isFeatureEnabled ) . toBe ( false )
35+ expect ( configManager . isFeatureEnabled ) . toBe ( true )
3636 expect ( configManager . currentEmbedderProvider ) . toBe ( "openai" )
3737 } )
3838 } )
@@ -45,7 +45,6 @@ describe("CodeIndexConfigManager", () => {
4545 const result = await configManager . loadConfiguration ( )
4646
4747 expect ( result . currentConfig ) . toEqual ( {
48- isEnabled : false ,
4948 isConfigured : false ,
5049 embedderProvider : "openai" ,
5150 modelId : undefined ,
@@ -77,7 +76,6 @@ describe("CodeIndexConfigManager", () => {
7776 const result = await configManager . loadConfiguration ( )
7877
7978 expect ( result . currentConfig ) . toEqual ( {
80- isEnabled : true ,
8179 isConfigured : true ,
8280 embedderProvider : "openai" ,
8381 modelId : "text-embedding-3-large" ,
@@ -111,7 +109,6 @@ describe("CodeIndexConfigManager", () => {
111109 const result = await configManager . loadConfiguration ( )
112110
113111 expect ( result . currentConfig ) . toEqual ( {
114- isEnabled : true ,
115112 isConfigured : true ,
116113 embedderProvider : "openai-compatible" ,
117114 modelId : "text-embedding-3-large" ,
@@ -149,7 +146,6 @@ describe("CodeIndexConfigManager", () => {
149146 const result = await configManager . loadConfiguration ( )
150147
151148 expect ( result . currentConfig ) . toEqual ( {
152- isEnabled : true ,
153149 isConfigured : true ,
154150 embedderProvider : "openai-compatible" ,
155151 modelId : "custom-model" ,
@@ -188,7 +184,6 @@ describe("CodeIndexConfigManager", () => {
188184 const result = await configManager . loadConfiguration ( )
189185
190186 expect ( result . currentConfig ) . toEqual ( {
191- isEnabled : true ,
192187 isConfigured : true ,
193188 embedderProvider : "openai-compatible" ,
194189 modelId : "custom-model" ,
@@ -227,7 +222,6 @@ describe("CodeIndexConfigManager", () => {
227222 const result = await configManager . loadConfiguration ( )
228223
229224 expect ( result . currentConfig ) . toEqual ( {
230- isEnabled : true ,
231225 isConfigured : true ,
232226 embedderProvider : "openai-compatible" ,
233227 modelId : "custom-model" ,
@@ -326,14 +320,14 @@ describe("CodeIndexConfigManager", () => {
326320 } )
327321
328322 it ( "should detect restart requirement when transitioning to enabled+configured" , async ( ) => {
329- // Initial state - disabled
323+ // Initial state - enabled but not configured
330324 mockContextProxy . getGlobalState . mockReturnValue ( {
331- codebaseIndexEnabled : false ,
325+ codebaseIndexEnabled : true ,
332326 } )
333327
334328 await configManager . loadConfiguration ( )
335329
336- // Enable and configure
330+ // Configure the feature
337331 mockContextProxy . getGlobalState . mockReturnValue ( {
338332 codebaseIndexEnabled : true ,
339333 codebaseIndexQdrantUrl : "http://qdrant.local" ,
@@ -689,29 +683,28 @@ describe("CodeIndexConfigManager", () => {
689683 expect ( result . requiresRestart ) . toBe ( true )
690684 } )
691685
692- it ( "should not require restart when disabled remains disabled " , async ( ) => {
693- // Initial state - disabled but configured
686+ it ( "should require restart when enabled and provider changes even if unconfigured " , async ( ) => {
687+ // Initial state - enabled but not configured (missing API key)
694688 mockContextProxy . getGlobalState . mockReturnValue ( {
695- codebaseIndexEnabled : false ,
689+ codebaseIndexEnabled : true ,
696690 codebaseIndexQdrantUrl : "http://qdrant.local" ,
697691 codebaseIndexEmbedderProvider : "openai" ,
698692 } )
699- setupSecretMocks ( {
700- codeIndexOpenAiKey : "test-key" ,
701- } )
693+ setupSecretMocks ( { } )
702694
703695 await configManager . loadConfiguration ( )
704696
705- // Still disabled but change other settings
697+ // Still enabled but change provider while remaining unconfigured
706698 mockContextProxy . getGlobalState . mockReturnValue ( {
707- codebaseIndexEnabled : false ,
708- codebaseIndexQdrantUrl : "http://different- qdrant.local" ,
699+ codebaseIndexEnabled : true ,
700+ codebaseIndexQdrantUrl : "http://qdrant.local" ,
709701 codebaseIndexEmbedderProvider : "ollama" ,
710702 codebaseIndexEmbedderBaseUrl : "http://ollama.local" ,
711703 } )
712704
713705 const result = await configManager . loadConfiguration ( )
714- expect ( result . requiresRestart ) . toBe ( false )
706+ // Should require restart because provider changed while enabled
707+ expect ( result . requiresRestart ) . toBe ( true )
715708 } )
716709
717710 it ( "should not require restart when unconfigured remains unconfigured" , async ( ) => {
@@ -970,7 +963,7 @@ describe("CodeIndexConfigManager", () => {
970963 it ( "should not require restart when API keys transition from undefined to empty string" , async ( ) => {
971964 // Initial state with undefined API keys
972965 mockContextProxy . getGlobalState . mockReturnValue ( {
973- codebaseIndexEnabled : false , // Start disabled to avoid restart due to enable+configure
966+ codebaseIndexEnabled : true , // Always enabled now
974967 codebaseIndexQdrantUrl : "http://qdrant.local" ,
975968 codebaseIndexEmbedderProvider : "openai" ,
976969 } )
@@ -1208,7 +1201,6 @@ describe("CodeIndexConfigManager", () => {
12081201 it ( "should return correct configuration via getConfig" , ( ) => {
12091202 const config = configManager . getConfig ( )
12101203 expect ( config ) . toEqual ( {
1211- isEnabled : true ,
12121204 isConfigured : true ,
12131205 embedderProvider : "openai" ,
12141206 modelId : "text-embedding-3-large" ,
@@ -1267,7 +1259,7 @@ describe("CodeIndexConfigManager", () => {
12671259 it ( "should properly initialize with current config to prevent false restarts" , async ( ) => {
12681260 // Setup configuration
12691261 mockContextProxy . getGlobalState . mockReturnValue ( {
1270- codebaseIndexEnabled : false , // Start disabled to avoid transition restart
1262+ codebaseIndexEnabled : true , // Always enabled now
12711263 codebaseIndexQdrantUrl : "http://qdrant.local" ,
12721264 codebaseIndexEmbedderProvider : "openai" ,
12731265 codebaseIndexEmbedderModelId : "text-embedding-3-small" ,
0 commit comments