Switch models from the Command Center (#2147)

* Switch models from the Command Center

Add a model switcher to the Command-K Command Center. Typing surfaces a
flat, filterable list of "Model › Provider › Name" breadcrumb rows with
provider icons:

- Running agent: its own provider's models (a live agent can't change
  provider); selecting calls setAgentModel.
- New draft tab: every available provider's models in one flat list;
  selecting sets provider + model on the draft via a focused-draft
  controller published to a global store (the draft form state is local
  to the composer subtree and otherwise unreachable from the global
  Command Center).

Models only appear once the user starts typing, so the default palette
view is unchanged. Reuses useProvidersSnapshot and the existing
setAgentModel RPC — no protocol changes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* Update packages/app/src/components/command-center.tsx

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

* Update packages/app/src/hooks/use-command-center.ts

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

* refactor(app): make Command Center extensible

Let focused features register stable actions while the palette owns search, selection, and a single virtualized result projection.

* fix(app): save model preference after agent switch

Persist the shared model choice only after the daemon confirms the live agent switched successfully.

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: Mohamed Boudra <boudra.moha@gmail.com>
This commit is contained in:
Michał Kędrzyński
2026-07-18 16:54:41 +02:00
committed by GitHub
co-authored by Claude Opus 4.8 greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> Mohamed Boudra
parent 7917532716
commit 45bbb973a3
25 changed files with 1636 additions and 1227 deletions
+4
View File
@@ -184,6 +184,10 @@ describe("translation resources", () => {
expect(en.shell.commandCenter.newAgent).toBe("New agent");
expect(en.shell.commandCenter.addProject).toBe("Add project");
expect(en.shell.commandCenter.home).toBe("Home");
expect(en.shell.commandCenter.modelGroupLabel).toBe("Model");
expect(en.shell.commandCenter.modelSearchKeywords).toBe(
"switch model change model set model select model",
);
});
it("includes composer and agent workflow keys for the Batch 2 migration", () => {
+2
View File
@@ -62,6 +62,8 @@ export const ar: TranslationResources = {
newAgent: "وكيل جديد",
addProject: "إضافة مشروع",
home: "بيت",
modelGroupLabel: "النموذج",
modelSearchKeywords: "تبديل النموذج تغيير النموذج تعيين النموذج اختيار النموذج",
},
},
composer: {
+2
View File
@@ -60,6 +60,8 @@ export const en = {
newAgent: "New agent",
addProject: "Add project",
home: "Home",
modelGroupLabel: "Model",
modelSearchKeywords: "switch model change model set model select model",
},
},
composer: {
+2
View File
@@ -62,6 +62,8 @@ export const es: TranslationResources = {
newAgent: "Nuevo agente",
addProject: "Agregar proyecto",
home: "Hogar",
modelGroupLabel: "Modelo",
modelSearchKeywords: "cambiar modelo modificar modelo establecer modelo seleccionar modelo",
},
},
composer: {
+3
View File
@@ -63,6 +63,9 @@ export const fr: TranslationResources = {
newAgent: "Nouvel agent",
addProject: "Ajouter un projet",
home: "Maison",
modelGroupLabel: "Modèle",
modelSearchKeywords:
"changer de modèle modifier le modèle définir le modèle sélectionner le modèle",
},
},
composer: {
+2
View File
@@ -62,6 +62,8 @@ export const ja: TranslationResources = {
newAgent: "新しいエージェント",
addProject: "プロジェクトを追加",
home: "ホーム",
modelGroupLabel: "モデル",
modelSearchKeywords: "モデルを切り替え モデルを変更 モデルを設定 モデルを選択",
},
},
composer: {
+2
View File
@@ -62,6 +62,8 @@ export const ptBR: TranslationResources = {
newAgent: "Novo agente",
addProject: "Adicionar projeto",
home: "Início",
modelGroupLabel: "Modelo",
modelSearchKeywords: "trocar modelo mudar modelo definir modelo selecionar modelo",
},
},
composer: {
+2
View File
@@ -62,6 +62,8 @@ export const ru: TranslationResources = {
newAgent: "Новый агент",
addProject: "Добавить проект",
home: "Дом",
modelGroupLabel: "Модель",
modelSearchKeywords: "сменить модель изменить модель выбрать модель установить модель",
},
},
composer: {
+2
View File
@@ -62,6 +62,8 @@ export const zhCN: TranslationResources = {
newAgent: "新建 Agent",
addProject: "添加 project",
home: "首页",
modelGroupLabel: "模型",
modelSearchKeywords: "切换模型 更改模型 设置模型 选择模型",
},
},
composer: {