@@ -179,7 +179,12 @@ export function getAppModelOptions(
179179 selectedModel ?: string | null ,
180180) : AppModelOption [ ] {
181181 const rawModels = getProviderModels ( providers , provider ) ;
182- const options : AppModelOption [ ] = rawModels . map ( toAppModelOption ) ;
182+ // Server-reported custom rows mirror settings and can lag a removal, so
183+ // only built-ins are taken from the snapshot; custom rows are rebuilt from
184+ // settings below.
185+ const options : AppModelOption [ ] = rawModels
186+ . filter ( ( model ) => ! model . isCustom )
187+ . map ( toAppModelOption ) ;
183188 const seen = new Set ( options . map ( ( option ) => option . slug ) ) ;
184189 const builtInModelSlugs = new Set (
185190 Arr . filterMap ( getProviderModels ( providers , provider ) , ( model ) =>
@@ -225,14 +230,18 @@ export function getAppModelOptions(
225230 * when present, falling back to the legacy per-kind
226231 * `settings.providers[driverKind].customModels` bucket for default
227232 * instances only. This keeps two instances of the same kind from leaking
228- * custom slugs into each other.
233+ * custom slugs into each other. Custom rows reported by the server are
234+ * ignored so a slug removed in Settings disappears without waiting for the
235+ * next provider probe.
229236 */
230237export function getAppModelOptionsForInstance (
231238 settings : UnifiedSettings ,
232239 entry : ProviderInstanceEntry ,
233240 selectedModel ?: string | null ,
234241) : AppModelOption [ ] {
235- const options : AppModelOption [ ] = entry . models . map ( toAppModelOption ) ;
242+ const options : AppModelOption [ ] = entry . models
243+ . filter ( ( model ) => ! model . isCustom )
244+ . map ( toAppModelOption ) ;
236245 const seen = new Set ( options . map ( ( option ) => option . slug ) ) ;
237246 const builtInModelSlugs = new Set (
238247 Arr . filterMap ( entry . models , ( model ) =>
0 commit comments