@@ -247,20 +247,46 @@ class LLMModelManager(
247247 }
248248 }
249249 }else {
250- // Initialize GitHub Copilot in background andupdate UI when ready
250+ // Initialize GitHub Copilot in background andincrementally add models
251251AutoDevAppScope .workerScope().launch {
252252try {
253253GithubCopilotManager .getInstance().initialize()
254- // After initialization, update the UI on the EDT
254+ // Get fresh GitHub models after initialization
255+ val freshGithubModels= manager.getSupportedModels(forceRefresh= false )
256+
257+ // Add GitHub models incrementally without clearing existing items
255258SwingUtilities .invokeLater {
256- updateAllDropdowns(
257- defaultModelDropdown,
258- planLLMDropdown,
259- actLLMDropdown,
260- completionLLMDropdown,
261- embeddingLLMDropdown,
262- fastApplyLLMDropdown
263- )
259+ freshGithubModels?.forEach { model->
260+ val modelItem= ModelItem (" Github:${model.id} " , model.id,false )
261+
262+ // Check if we need to replace placeholder items
263+ fun ComboBox<ModelItem>.replaceOrAddModel (newItem : ModelItem ) {
264+ // Look for placeholder with same modelId
265+ for (iin 0 untilthis .itemCount) {
266+ val existingItem= this .getItemAt(i)
267+ if (existingItem.modelId== newItem.modelId&&
268+ existingItem.displayName.contains(" (loading...)" )) {
269+ // Replace placeholder with real model
270+ this .removeItemAt(i)
271+ this .insertItemAt(newItem, i)
272+ this .selectedItem= newItem
273+ return
274+ }
275+ }
276+ // No placeholder found, just add the model
277+ this .addItem(newItem)
278+ }
279+
280+ if (model.isEmbedding) {
281+ embeddingLLMDropdown.replaceOrAddModel(modelItem)
282+ }else {
283+ defaultModelDropdown.replaceOrAddModel(modelItem)
284+ planLLMDropdown.replaceOrAddModel(modelItem)
285+ actLLMDropdown.replaceOrAddModel(modelItem)
286+ completionLLMDropdown.replaceOrAddModel(modelItem)
287+ fastApplyLLMDropdown.replaceOrAddModel(modelItem)
288+ }
289+ }
264290 }
265291 }catch (e: Exception ) {
266292// Silently handle initialization failures
@@ -301,13 +327,25 @@ class LLMModelManager(
301327fun ComboBox<ModelItem>.selectModelById (modelId : String ) {
302328if (modelId.isEmpty())return
303329
330+ // First try to find existing item
304331for (iin 0 untilthis .itemCount) {
305332val item= this .getItemAt(i)
306333if (item.modelId== modelId) {
307334this .selectedItem= item
308- break
335+ return
309336 }
310337 }
338+
339+ // If not found, check if it's likely a GitHub Copilot model
340+ val userModels= LlmConfig .load()
341+ val isUserCustomModel= userModels.any { it.name== modelId }
342+
343+ if (! isUserCustomModel&& modelId.isNotEmpty()) {
344+ // This is likely a GitHub Copilot model that's not loaded yet
345+ val placeholderItem= ModelItem (" Github:$modelId (loading...)" , modelId,false )
346+ this .addItem(placeholderItem)
347+ this .selectedItem= placeholderItem
348+ }
311349 }
312350
313351// Set default model