File tree Expand file tree Collapse file tree 4 files changed +27
-4
lines changed
webview-ui/src/components/settings Expand file tree Collapse file tree 4 files changed +27
-4
lines changed Original file line number Diff line number Diff line change @@ -824,6 +824,11 @@ export class ClineProvider extends EventEmitter<ClineProviderEvents> implements
824824 this . contextProxy . setProviderSettings ( providerSettings ) ,
825825 ] )
826826
827+ // Notify CodeIndexManager about the settings change
828+ if ( this . codeIndexManager ) {
829+ await this . codeIndexManager . handleExternalSettingsChange ( )
830+ }
831+
827832 // Change the provider for the current task.
828833 // TODO: We should rename `buildApiHandler` for clarity (e.g. `getProviderClient`).
829834 const task = this . getCurrentCline ( )
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ export class CodeIndexConfigManager {
1414 private modelId ?: string
1515 private openAiOptions ?: ApiHandlerOptions
1616 private ollamaOptions ?: ApiHandlerOptions
17- private qdrantUrl ?: string
17+ private qdrantUrl ?: string = "http://localhost:6333"
1818 private qdrantApiKey ?: string
1919 private searchMinScore ?: number
2020
@@ -103,11 +103,18 @@ export class CodeIndexConfigManager {
103103 * Checks if the service is properly configured based on the embedder type.
104104 */
105105 public isConfigured ( ) : boolean {
106+
106107 if ( this . embedderProvider === "openai" ) {
107- return ! ! ( this . openAiOptions ?. openAiNativeApiKey && this . qdrantUrl )
108+ const openAiKey = this . openAiOptions ?. openAiNativeApiKey
109+ const qdrantUrl = this . qdrantUrl
110+ const isConfigured = ! ! ( openAiKey && qdrantUrl )
111+ return isConfigured
108112 } else if ( this . embedderProvider === "ollama" ) {
109113 // Ollama model ID has a default, so only base URL is strictly required for config
110- return ! ! ( this . ollamaOptions ?. ollamaBaseUrl && this . qdrantUrl )
114+ const ollamaBaseUrl = this . ollamaOptions ?. ollamaBaseUrl
115+ const qdrantUrl = this . qdrantUrl
116+ const isConfigured = ! ! ( ollamaBaseUrl && qdrantUrl )
117+ return isConfigured
111118 }
112119 return false // Should not happen if embedderProvider is always set correctly
113120 }
Original file line number Diff line number Diff line change @@ -244,4 +244,15 @@ export class CodeIndexManager {
244244 this . assertInitialized ( )
245245 return this . _searchService ! . searchIndex ( query , directoryPrefix )
246246 }
247+
248+ /**
249+ * Handles external settings changes by reloading configuration.
250+ * This method should be called when API provider settings are updated
251+ * to ensure the CodeIndexConfigManager picks up the new configuration.
252+ */
253+ public async handleExternalSettingsChange ( ) : Promise < void > {
254+ if ( this . _configManager ) {
255+ await this . _configManager . loadConfiguration ( )
256+ }
257+ }
247258}
Original file line number Diff line number Diff line change @@ -300,7 +300,7 @@ export const CodeIndexSettings: React.FC<CodeIndexSettingsProps> = ({
300300 </ div >
301301 < div >
302302 < VSCodeTextField
303- value = { codebaseIndexConfig . codebaseIndexQdrantUrl }
303+ value = { codebaseIndexConfig . codebaseIndexQdrantUrl || "http://localhost:6333" }
304304 onInput = { ( e : any ) =>
305305 setCachedStateField ( "codebaseIndexConfig" , {
306306 ...codebaseIndexConfig ,
You can’t perform that action at this time.
0 commit comments