From 9d55dde46a71205f25f0aeab06fed0ffb486c8e3 Mon Sep 17 00:00:00 2001 From: Marco Beretta <81851188+berry-13@users.noreply.github.com> Date: Thu, 1 Oct 2026 19:54:48 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=AC=20feat:=20Conversation=20Starters?= =?UTF-8?q?=20in=20Agent=20Builder=20(#16523)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 💬 feat: Conversation Starters in Agent Builder * fix: Preserve untouched agent starters and scope drafts to their agent An unrelated builder save no longer rewrites stored starters: the field is sent only when the list changed, so API-set lists past the builder cap or with padding survive. The draft input is keyed by agent id so unsent text does not follow the user to a new or different agent, and each delete control now sits on its starter's row. Adds Playwright scenarios for the builder-to-landing flow, preservation, clearing and draft scoping. * fix: Keep starter drafts in form state and show saved starters after save The unsent starter draft moves into react-hook-form as a builder-only field, so it survives switching to the Model or Advanced panel and is still cleared by the reset that loads another agent. Enter no longer adds a starter while an IME composition is being committed. After create or update, the starters field is reset to the stored list, so trimmed or dropped rows do not linger and keep the add input disabled. * fix: Keep starter edits made during a save and drop the UI-only length cap Sync the stored starters back into the form only when the rows still hold what the save sent for the same agent, so edits typed while the request was in flight, or another agent selected meanwhile, are not overwritten. Remove the 64-character maxLength: the agent API and schema accept any length and the landing page already clamps display. * fix: Merge a finished agent save only into the agent it was for * test: Switch agents in place while the first save is held --- client/src/common/agents-types.ts | 3 + .../SidePanel/Agents/AgentConfig.tsx | 4 + .../SidePanel/Agents/AgentPanel.tsx | 85 +++- .../SidePanel/Agents/AgentSelect.tsx | 2 + .../components/SidePanel/Agents/Starters.tsx | 147 +++++++ .../__tests__/AgentPanel.helpers.spec.ts | 93 ++++ .../Agents/__tests__/Starters.spec.tsx | 151 +++++++ client/src/utils/forms.tsx | 1 + .../agent-conversation-starters.spec.ts | 396 ++++++++++++++++++ packages/data-provider/src/schemas.ts | 1 + packages/data-provider/src/types/agents.ts | 2 + 11 files changed, 882 insertions(+), 3 deletions(-) create mode 100644 client/src/components/SidePanel/Agents/Starters.tsx create mode 100644 client/src/components/SidePanel/Agents/__tests__/Starters.spec.tsx create mode 100644 e2e/specs/mock/scenarios/agent-conversation-starters.spec.ts diff --git a/client/src/common/agents-types.ts b/client/src/common/agents-types.ts index 72834a7585..eaffe6ee17 100644 --- a/client/src/common/agents-types.ts +++ b/client/src/common/agents-types.ts @@ -64,6 +64,9 @@ export type AgentForm = { [AgentCapabilities.artifacts]?: ArtifactModes | string; recursion_limit?: number; support_contact?: SupportContact; + conversation_starters?: string[]; + /** Unsent starter text; builder-only, never sent to the API. */ + conversation_starter_draft?: string; category: string; // Avatar management fields avatar_file?: File | null; diff --git a/client/src/components/SidePanel/Agents/AgentConfig.tsx b/client/src/components/SidePanel/Agents/AgentConfig.tsx index 89d182583d..6e4de70689 100644 --- a/client/src/components/SidePanel/Agents/AgentConfig.tsx +++ b/client/src/components/SidePanel/Agents/AgentConfig.tsx @@ -12,6 +12,7 @@ import { validateEmail, cn } from '~/utils'; import Instructions from './Instructions'; import FileContext from './FileContext'; import AgentAvatar from './AgentAvatar'; +import Starters from './Starters'; import { Panel } from '~/common'; const fieldClass = 'h-9'; @@ -155,6 +156,9 @@ export default function AgentConfig() { )} + {/* CONVERSATION STARTERS */} + + {/* SUPPORT CONTACT */}