From 4bdaeb6d6e5d206a90b2c4250dce89239ff61458 Mon Sep 17 00:00:00 2001 From: Rob Coenen <753704+rcoenen@users.noreply.github.com> Date: Fri, 31 Jul 2026 11:38:54 -0400 Subject: [PATCH] feat(chat): switch models from the chat panel The chat model chip is a dropdown for built-in providers but a static label for OpenAI-compatible and custom-model setups, so anyone using a custom endpoint had to open Settings to change models -- even with several models already configured. Add a profile switcher that reassigns the design role from the chat panel. It lists saved profiles that can use tools, shows the profile name rather than the raw model ID, and badges the vision-capable ones. It writes the same assignments.design field the Settings dropdown does, so the two stay in sync. Only renders when more than one tools-capable profile exists; a single profile keeps the existing label. Built-in providers keep ProviderModelSelect unchanged. Co-Authored-By: Claude Opus 5 (1M context) --- src/components/chat/ChatInput.vue | 14 +++++ src/components/chat/ChatProfileSelect.vue | 68 +++++++++++++++++++++++ tests/engine/app/ai/model-roles.test.ts | 31 +++++++++++ 3 files changed, 113 insertions(+) create mode 100644 src/components/chat/ChatProfileSelect.vue diff --git a/src/components/chat/ChatInput.vue b/src/components/chat/ChatInput.vue index c1b770e22..91042b127 100644 --- a/src/components/chat/ChatInput.vue +++ b/src/components/chat/ChatInput.vue @@ -2,11 +2,13 @@ import { TooltipProvider } from 'reka-ui' import { computed, ref } from 'vue' +import ChatProfileSelect from '@/components/chat/ChatProfileSelect.vue' import ProviderModelSelect from '@/components/chat/ProviderModelSelect.vue' import AppInput from '@/components/ui/AppInput.vue' import Tip from '@/components/ui/Tip.vue' import { useButtonUI } from '@/components/ui/button' import { useAIChat } from '@/app/ai/chat/use' +import { aiModelSettings, designModelProfile } from '@/app/ai/models' import { openSettingsDialog } from '@/app/settings/dialog' import { useI18n } from '@open-pencil/vue' @@ -58,6 +60,15 @@ const selectedModelName = computed(() => { return providerDef.value.models.find((m) => m.id === modelID.value)?.name ?? modelID.value }) +// Switching between saved profiles only makes sense once more than one can drive the design agent. +const switchableProfiles = computed(() => + aiModelSettings.value.models.filter((profile) => profile.capabilities.includes('tools')) +) +const canSwitchProfile = computed(() => switchableProfiles.value.length > 1) +const selectedProfileName = computed( + () => designModelProfile.value?.name ?? selectedModelName.value +) + function handleSubmit(e: Event) { e.preventDefault() const text = input.value.trim() @@ -78,6 +89,9 @@ function handleSubmit(e: Event) { {{ acpAgentName }} + + +