@@ -23,6 +23,8 @@ export class CodeIndexConfigManager {
2323 private qdrantApiKey ?: string
2424 private searchProvider ?: string
2525 private valkeyUrl ?: string = "http://localhost:6379"
26+ private valkeyUsername ?: string
27+ private valkeyPassword ?: string
2628 private searchMinScore ?: number
2729 private searchMaxResults ?: number
2830
@@ -48,6 +50,7 @@ export class CodeIndexConfigManager {
4850 codebaseIndexEnabled : true ,
4951 codebaseIndexQdrantUrl : "http://localhost:6333" ,
5052 codebaseIndexValkeyUrl : "http://localhost:6379" ,
53+ codebaseIndexValkeyUsername : "" ,
5154 codebaseIndexEmbedderProvider : "openai" ,
5255 codebaseIndexEmbedderBaseUrl : "" ,
5356 codebaseIndexEmbedderModelId : "" ,
@@ -59,6 +62,7 @@ export class CodeIndexConfigManager {
5962 codebaseIndexEnabled,
6063 codebaseIndexQdrantUrl,
6164 codebaseIndexValkeyUrl,
65+ codebaseIndexValkeyUsername,
6266 codebaseIndexEmbedderProvider,
6367 codebaseIndexEmbedderBaseUrl,
6468 codebaseIndexEmbedderModelId,
@@ -69,6 +73,7 @@ export class CodeIndexConfigManager {
6973
7074 const openAiKey = this . contextProxy ?. getSecret ( "codeIndexOpenAiKey" ) ?? ""
7175 const qdrantApiKey = this . contextProxy ?. getSecret ( "codeIndexQdrantApiKey" ) ?? ""
76+ const valkeyPassword = this . contextProxy ?. getSecret ( "codeIndexValkeyPassword" ) ?? ""
7277 // Fix: Read OpenAI Compatible settings from the correct location within codebaseIndexConfig
7378 const openAiCompatibleBaseUrl = codebaseIndexConfig . codebaseIndexOpenAiCompatibleBaseUrl ?? ""
7479 const openAiCompatibleApiKey = this . contextProxy ?. getSecret ( "codebaseIndexOpenAiCompatibleApiKey" ) ?? ""
@@ -80,6 +85,8 @@ export class CodeIndexConfigManager {
8085 this . qdrantUrl = codebaseIndexQdrantUrl
8186 this . qdrantApiKey = qdrantApiKey ?? ""
8287 this . valkeyUrl = codebaseIndexValkeyUrl
88+ this . valkeyPassword = valkeyPassword
89+ this . valkeyUsername = codebaseIndexValkeyUsername
8390 this . searchMinScore = codebaseIndexSearchMinScore
8491 this . searchMaxResults = codebaseIndexSearchMaxResults
8592 this . searchProvider = searchProvider
@@ -151,6 +158,8 @@ export class CodeIndexConfigManager {
151158 qdrantUrl ?: string
152159 qdrantApiKey ?: string
153160 valkeyUrl ?: string
161+ valkeyPassword ?: string
162+ valkeyUsername ?: string
154163 searchProvider ?: string
155164 searchMinScore ?: number
156165 }
@@ -171,8 +180,10 @@ export class CodeIndexConfigManager {
171180 mistralApiKey : this . mistralOptions ?. apiKey ?? "" ,
172181 qdrantUrl : this . qdrantUrl ?? "" ,
173182 valkeyUrl : this . valkeyUrl ?? "" ,
183+ valkeyUsername : this . valkeyUsername ?? "" ,
174184 searchProvider : this . searchProvider ?? "" ,
175185 qdrantApiKey : this . qdrantApiKey ?? "" ,
186+ valkeyPassword : this . valkeyPassword ?? "" ,
176187 }
177188
178189 // Refresh secrets from VSCode storage to ensure we have the latest values
@@ -198,6 +209,8 @@ export class CodeIndexConfigManager {
198209 qdrantUrl : this . qdrantUrl ,
199210 qdrantApiKey : this . qdrantApiKey ,
200211 valkeyUrl : this . valkeyUrl ,
212+ valkeyPassword : this . valkeyPassword ,
213+ valkeyUsername : this . valkeyUsername ,
201214 searchProvider : this . searchProvider ,
202215 searchMinScore : this . currentSearchMinScore ,
203216 } ,
@@ -209,30 +222,26 @@ export class CodeIndexConfigManager {
209222 * Checks if the service is properly configured based on the embedder type.
210223 */
211224 public isConfigured ( ) : boolean {
225+ const dbUrlPresent = this . qdrantUrl || this . valkeyUrl
212226 if ( this . embedderProvider === "openai" ) {
213227 const openAiKey = this . openAiOptions ?. openAiNativeApiKey
214- const qdrantUrl = this . qdrantUrl
215- return ! ! ( openAiKey && qdrantUrl )
228+ return ! ! ( openAiKey && dbUrlPresent )
216229 } else if ( this . embedderProvider === "ollama" ) {
217230 // Ollama model ID has a default, so only base URL is strictly required for config
218231 const ollamaBaseUrl = this . ollamaOptions ?. ollamaBaseUrl
219- const qdrantUrl = this . qdrantUrl
220- return ! ! ( ollamaBaseUrl && qdrantUrl )
232+ return ! ! ( ollamaBaseUrl && dbUrlPresent )
221233 } else if ( this . embedderProvider === "openai-compatible" ) {
222234 const baseUrl = this . openAiCompatibleOptions ?. baseUrl
223235 const apiKey = this . openAiCompatibleOptions ?. apiKey
224- const qdrantUrl = this . qdrantUrl
225- const isConfigured = ! ! ( baseUrl && apiKey && qdrantUrl )
236+ const isConfigured = ! ! ( baseUrl && apiKey && dbUrlPresent )
226237 return isConfigured
227238 } else if ( this . embedderProvider === "gemini" ) {
228239 const apiKey = this . geminiOptions ?. apiKey
229- const qdrantUrl = this . qdrantUrl
230- const isConfigured = ! ! ( apiKey && qdrantUrl )
240+ const isConfigured = ! ! ( apiKey && dbUrlPresent )
231241 return isConfigured
232242 } else if ( this . embedderProvider === "mistral" ) {
233243 const apiKey = this . mistralOptions ?. apiKey
234- const qdrantUrl = this . qdrantUrl
235- const isConfigured = ! ! ( apiKey && qdrantUrl )
244+ const isConfigured = ! ! ( apiKey && dbUrlPresent )
236245 return isConfigured
237246 }
238247 return false // Should not happen if embedderProvider is always set correctly
@@ -272,6 +281,8 @@ export class CodeIndexConfigManager {
272281 const prevValkeyUrl = prev ?. valkeyUrl ?? ""
273282 const prevSearchProvider = prev ?. searchProvider ?? ""
274283 const prevQdrantApiKey = prev ?. qdrantApiKey ?? ""
284+ const prevValkeyPassword = prev ?. valkeyPassword ?? ""
285+ const prevValkeyUsername = prev ?. valkeyUsername ?? ""
275286
276287 // 1. Transition from disabled/unconfigured to enabled/configured
277288 if ( ( ! prevEnabled || ! prevConfigured ) && this . codebaseIndexEnabled && nowConfigured ) {
@@ -311,6 +322,8 @@ export class CodeIndexConfigManager {
311322 const currentValkeyUrl = this . valkeyUrl ?? ""
312323 const currentSearchProvider = this . searchProvider ?? ""
313324 const currentQdrantApiKey = this . qdrantApiKey ?? ""
325+ const currentValkeyPassword = this . valkeyPassword ?? ""
326+ const currentValkeyUsername = this . valkeyUsername ?? ""
314327
315328 if ( prevOpenAiKey !== currentOpenAiKey ) {
316329 return true
@@ -352,6 +365,14 @@ export class CodeIndexConfigManager {
352365 return true
353366 }
354367
368+ if ( prevValkeyPassword !== currentValkeyPassword ) {
369+ return true
370+ }
371+
372+ if ( prevValkeyUsername !== currentValkeyUsername ) {
373+ return true
374+ }
375+
355376 if ( currentSearchProvider != prevSearchProvider ) {
356377 return true
357378 }
@@ -408,6 +429,8 @@ export class CodeIndexConfigManager {
408429 qdrantApiKey : this . qdrantApiKey ,
409430 searchProvider : this . searchProvider ,
410431 valkeyUrl : this . valkeyUrl ,
432+ valkeyUsername : this . valkeyUsername ,
433+ valkeyPassword : this . valkeyPassword ,
411434 searchMinScore : this . currentSearchMinScore ,
412435 searchMaxResults : this . currentSearchMaxResults ,
413436 }
0 commit comments