From 970774ec3ce2756f45b892ec1208bc73ba6f612d Mon Sep 17 00:00:00 2001 From: Sviatoslav Abakumov Date: Fri, 20 Mar 2026 02:40:07 +0400 Subject: [PATCH] fix(coding-agent): /model shows stale scoped models (#2408) After updating models.json, the scoped model selector still shows the old values when opened. Switching to the "all" scope, however, shows updated model definitions. --- .../src/modes/interactive/components/model-selector.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/coding-agent/src/modes/interactive/components/model-selector.ts b/packages/coding-agent/src/modes/interactive/components/model-selector.ts index e1ceeaf1..d14002a2 100644 --- a/packages/coding-agent/src/modes/interactive/components/model-selector.ts +++ b/packages/coding-agent/src/modes/interactive/components/model-selector.ts @@ -164,6 +164,10 @@ export class ModelSelectorComponent extends Container implements Focusable { } this.allModels = this.sortModels(models); + this.scopedModels = this.scopedModels.map((scoped) => { + const refreshed = this.modelRegistry.find(scoped.model.provider, scoped.model.id); + return refreshed ? { ...scoped, model: refreshed } : scoped; + }); this.scopedModelItems = this.sortModels( this.scopedModels.map((scoped) => ({ provider: scoped.model.provider,