Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.
Go
MUL-6629: feat(agents): add per-agent starter prompts for chat (#7261)
Yuri Guif8ec870f305b
diff --git a/apps/docs/content/docs/agents-create.ja.mdx b/apps/docs/content/docs/agents-create.ja.mdxindex 534a0c86f8..556c7f8c73 100644--- a/apps/docs/content/docs/agents-create.ja.mdx+++ b/apps/docs/content/docs/agents-create.ja.mdx@@ -63,6 +63,12 @@ Build with AI には、Builder との対話のためにオンラインのランスキルは、エージェント間で再利用できる手法や資料の保存に向いています。このエージェントだけの長期的な要件は、指示に書いてください。+## おすすめの最初のアクション++最初のチャットメッセージを送る前に、このエージェントが得意なことを伝える**おすすめの最初のアクション**を3件まで追加できます。各候補には短いラベルと完全なプロンプトがあります。選ぶと送信せずに入力欄へ入り、ユーザーが確認・編集できます。++空のままなら、チャットにはローカライズされた汎用候補が表示されます。エージェントの役割と境界に合わせた例のほうが通常は役立ちます。+## ランタイム・モデル・思考レベルの選択ランタイムは、それぞれ 1 つの AI コーディングツールに対応しています。ランタイムを選ぶと、そのツールがサポートするモデルと思考レベルを続けて選べます。一部のツール(Codex など)ではサービスティアも選べます。@@ -127,7 +133,7 @@ MCP 構成にはトークンが含まれることがあり、保存と表示の## エージェントの複製-複製すると、名前以外のほとんどの作業構成が引き継がれます。指示、スキル、カスタム引数、アバター、同時実行上限、Access 設定が含まれます。モデル、思考レベル、サービスティアも一緒に引き継がれますが、元のランタイムが利用できず、複製がやむを得ず別のランタイムに移る場合、この 3 つはクリアされるため選び直しが必要です。+複製すると、名前以外のほとんどの作業構成が引き継がれます。指示、おすすめの最初のアクション、スキル、カスタム引数、アバター、同時実行上限、Access 設定が含まれます。モデル、思考レベル、サービスティアも一緒に引き継がれますが、元のランタイムが利用できず、複製がやむを得ず別のランタイムに移る場合、この 3 つはクリアされるため選び直しが必要です。環境変数の値と MCP 構成は、どんな場合も複製されません。新しいエージェントで設定し直してください。複製では、元のエージェントのランタイム紐づけと Access 設定が保持されます。diff --git a/apps/docs/content/docs/agents-create.ko.mdx b/apps/docs/content/docs/agents-create.ko.mdxindex 3e04403646..13e929c8bb 100644--- a/apps/docs/content/docs/agents-create.ko.mdx+++ b/apps/docs/content/docs/agents-create.ko.mdx@@ -63,6 +63,12 @@ AI로 만들려면 Builder 대화를 진행할 온라인 런타임이 필요합스킬은 여러 에이전트가 재사용할 수 있는 방법과 자료를 저장하기에 적합합니다. 이 에이전트에만 적용되는 장기 요구 사항은 지시문에 작성하세요.+## 추천 첫 작업++첫 채팅 메시지를 보내기 전에 이 에이전트가 잘하는 일을 보여 주는 **추천 첫 작업**을 최대 3개 추가할 수 있습니다. 각 추천에는 짧은 라벨과 전체 프롬프트가 있습니다. 선택하면 전송하지 않고 입력창에 채워져 사용자가 먼저 확인하거나 수정할 수 있습니다.++목록을 비워 두면 채팅에 현지화된 범용 추천이 표시됩니다. 에이전트의 역할과 경계에 맞춘 예시가 보통 더 유용합니다.+## 런타임, 모델, 사고 강도 선택런타임은 이미 특정 AI 코딩 도구에 대응합니다. 런타임을 선택한 뒤 해당 도구가 지원하는 모델과 사고 강도를 선택할 수 있습니다. Codex 같은 일부 도구에서는 속도 단계도 선택할 수 있습니다.@@ -127,7 +133,7 @@ MCP 설정에는 token이 포함될 수 있으며 저장 및 표시 규칙은## 에이전트 복사-복사하면 이름을 제외한 대부분의 작업 설정이 포함됩니다. 지시문, 스킬, 사용자 지정 인수, 아바타, 동시 실행 상한, Access 설정이 복사됩니다. 모델, 사고 강도, 속도 단계도 함께 복사되지만 원래 런타임을 사용할 수 없어 다른 런타임으로 바꿔야 하면 이 세 항목이 비워지므로 다시 선택해야 합니다.+복사하면 이름을 제외한 대부분의 작업 설정이 포함됩니다. 지시문, 추천 첫 작업, 스킬, 사용자 지정 인수, 아바타, 동시 실행 상한, Access 설정이 복사됩니다. 모델, 사고 강도, 속도 단계도 함께 복사되지만 원래 런타임을 사용할 수 없어 다른 런타임으로 바꿔야 하면 이 세 항목이 비워지므로 다시 선택해야 합니다.환경 변수 값과 MCP 설정은 어떤 경우에도 복사되지 않으며 새 에이전트에서 다시 설정해야 합니다. 복사본은 원래 에이전트의 런타임 연결과 Access 설정을 유지합니다.diff --git a/apps/docs/content/docs/agents-create.mdx b/apps/docs/content/docs/agents-create.mdxindex cb2ce05875..19e0a544fc 100644--- a/apps/docs/content/docs/agents-create.mdx+++ b/apps/docs/content/docs/agents-create.mdx@@ -63,6 +63,12 @@ During creation you can pick one or more [skills](/skills) from the workspace.Skills suit methods and material reused across agents; long-lived requirements that belong only to this agent go in the instructions.+## Suggested first actions++Add up to three **suggested first actions** to show people what this agent is good at before they send a first chat message. Each suggestion has a short label and a complete prompt. Selecting one fills the composer so the user can review or edit it; it never starts a run automatically.++If you leave the list empty, Chat shows localized general-purpose suggestions. Agent-specific examples are usually more useful because they can reflect the role and boundaries in the instructions.+## Runtime, model, and thinking levelEach runtime already maps to one AI coding tool. After picking a runtime, you can pick a model and thinking level the tool supports; some tools (such as Codex) also offer a service tier:@@ -127,7 +133,7 @@ MCP configuration may contain tokens; its storage and display rules match enviro## Duplicating an agent-Duplicating carries over most working configuration except the name, including instructions, skills, custom arguments, avatar, concurrency limit, and Access settings. The model, thinking level, and service tier come along too; if the original runtime is unavailable and the copy is forced onto another runtime, those three are cleared and must be re-selected.+Duplicating carries over most working configuration except the name, including instructions, suggested first actions, skills, custom arguments, avatar, concurrency limit, and Access settings. The model, thinking level, and service tier come along too; if the original runtime is unavailable and the copy is forced onto another runtime, those three are cleared and must be re-selected.Environment variable values and MCP configuration are never copied and must be set again on the new agent. Duplication keeps the original agent's runtime binding and Access settings.diff --git a/apps/docs/content/docs/agents-create.zh.mdx b/apps/docs/content/docs/agents-create.zh.mdxindex cbd3bd29a9..466796e54b 100644--- a/apps/docs/content/docs/agents-create.zh.mdx+++ b/apps/docs/content/docs/agents-create.zh.mdx@@ -63,6 +63,12 @@ import { Callout } from "fumadocs-ui/components/callout";Skill 适合保存可以跨智能体复用的方法和资料;只属于这名智能体的长期要求写在指令中。+## 推荐的初始操作++最多添加三个**推荐的初始操作**,让用户在发送第一条对话消息前了解这个智能体擅长什么。每项包含一个简短标题和一条完整提示词。选择后只会填入输入框,用户可以先检查或修改,不会自动开始执行。++留空时,对话页会显示本地化的通用建议。针对智能体职责和边界编写的示例通常更有帮助。+## 选择运行时、模型和思考强度运行时已经对应一款 AI 编程工具。选择运行时后,可以继续选择该工具支持的模型和思考强度;部分工具(如 Codex)还可选择速度档:@@ -127,7 +133,7 @@ MCP 配置可能包含 token,保存与展示规则和环境变量相同。只## 复制智能体-复制会带上名称之外的大部分工作配置,包括指令、skill、自定义参数、头像、并发上限和 Access 设置。模型、思考强度和速度档也会一并带走;如果原运行时不可用、复制被迫换到其他运行时,这三项会清空,需要重新选择。+复制会带上名称之外的大部分工作配置,包括指令、推荐的初始操作、skill、自定义参数、头像、并发上限和 Access 设置。模型、思考强度和速度档也会一并带走;如果原运行时不可用、复制被迫换到其他运行时,这三项会清空,需要重新选择。环境变量的值和 MCP 配置在任何情况下都不会复制,需要在新智能体中重新设置。复制会保留原智能体的运行时绑定和 Access 设置。diff --git a/apps/docs/content/docs/agents.ja.mdx b/apps/docs/content/docs/agents.ja.mdxindex 61178a6ced..4792593b4e 100644--- a/apps/docs/content/docs/agents.ja.mdx+++ b/apps/docs/content/docs/agents.ja.mdx@@ -15,6 +15,7 @@ import { Callout } from "fumadocs-ui/components/callout";|---|---|| **名前・アバター・説明** | それが誰で、何に向いているかをチームに伝えます。説明は表示専用で、実行プロンプトには入りません。 || **指示** | 職責、仕事の進め方、境界、成果物の要件を定めます。毎回の実行で使われます。 |+| **おすすめの最初のアクション** | エージェント別のチャット開始例を3件まで提示します。選ぶと送信せずに入力欄へ入ります。 || **スキル** | 再利用できる手法、参考資料、補助ファイルを提供します。 || **ランタイム・モデル・思考レベル** | どのランタイムで、どの AI コーディングツールとモデルで実行するかを決めます。一部のツール(Codex など)ではサービスティアも選べます。 || **Access** | どのメンバーが実行できるかを決めます。 |diff --git a/apps/docs/content/docs/agents.ko.mdx b/apps/docs/content/docs/agents.ko.mdxindex d436f8d696..e5912cc685 100644--- a/apps/docs/content/docs/agents.ko.mdx+++ b/apps/docs/content/docs/agents.ko.mdx@@ -15,6 +15,7 @@ import { Callout } from "fumadocs-ui/components/callout";|---|---|| **이름, 아바타, 설명** | 팀에 에이전트가 누구이며 어떤 작업에 적합한지 알려 줍니다. 설명은 표시용이며 실행 프롬프트에 포함되지 않습니다. || **지시문** | 역할, 작업 방식, 경계, 결과물 요구 사항을 규정합니다. 모든 실행에서 사용됩니다. |+| **추천 첫 작업** | 에이전트별 채팅 시작 예시를 최대 3개 제공합니다. 선택하면 전송하지 않고 입력창에 채웁니다. || **스킬** | 재사용 가능한 방법, 참고 자료, 지원 파일을 제공합니다. || **런타임, 모델, 사고 강도** | 어느 런타임에서 어떤 AI 코딩 도구와 모델을 사용할지 결정합니다. Codex 같은 일부 도구에서는 속도 단계도 선택할 수 있습니다. || **Access** | 어떤 멤버가 에이전트를 실행할 수 있는지 결정합니다. |diff --git a/apps/docs/content/docs/agents.mdx b/apps/docs/content/docs/agents.mdxindex 7c4cdd7963..52ed453202 100644--- a/apps/docs/content/docs/agents.mdx+++ b/apps/docs/content/docs/agents.mdx@@ -15,6 +15,7 @@ An agent is not a continuously running process. It is a reusable identity and co|---|---|| **Name, avatar, and description** | Tell the team who the agent is and what it is good at. The description is display-only and never enters the execution prompt. || **Instructions** | Define its responsibilities, working style, boundaries, and delivery requirements. Used on every run. |+| **Suggested first actions** | Give people up to three agent-specific examples for starting a chat. Selecting one fills the composer without sending. || **Skills** | Provide reusable methods, reference material, and supporting files. || **Runtime, model, and thinking level** | Decide which runtime, AI coding tool, and model it runs on; some tools (such as Codex) also offer a service tier. || **Access** | Decides which members can run it. |diff --git a/apps/docs/content/docs/agents.zh.mdx b/apps/docs/content/docs/agents.zh.mdxindex 1d5d5c0a82..eccc510408 100644--- a/apps/docs/content/docs/agents.zh.mdx+++ b/apps/docs/content/docs/agents.zh.mdx@@ -15,6 +15,7 @@ import { Callout } from "fumadocs-ui/components/callout";|---|---|| **名称、头像和描述** | 让团队知道它是谁、适合做什么。描述只用于展示,不会进入执行提示。 || **指令** | 规定它的职责、工作方式、边界和交付要求。每次执行都会使用。 |+| **推荐的初始操作** | 提供最多三个针对该智能体的对话起步示例。选择后只会填入输入框,不会发送。 || **Skills** | 提供可以复用的方法、参考资料和支持文件。 || **运行时、模型和思考强度** | 决定在哪个运行时、用哪款 AI 编程工具和哪个模型执行;部分工具(如 Codex)还可选择速度档。 || **Access** | 决定哪些成员可以运行它。 |diff --git a/apps/docs/content/docs/chat.ja.mdx b/apps/docs/content/docs/chat.ja.mdxindex ea8f1c1b96..67ddeba2a3 100644--- a/apps/docs/content/docs/chat.ja.mdx+++ b/apps/docs/content/docs/chat.ja.mdx@@ -24,6 +24,8 @@ import { Callout } from "fumadocs-ui/components/callout";ランタイムがオフラインの場合、メッセージはオンラインに戻るまで待機します。エージェントがアーカイブされたり、あなたが実行権限を失ったりすると、新しいメッセージは送信できません。+最初のメッセージの前に、選択したエージェントに設定された候補が最大3件表示されます。選ぶと完全なプロンプトが送信されずに入力欄へ入り、先に調整できます。候補が未設定のエージェントでは、ローカライズされた汎用例が使われます。+## チャットとイシューの使い分け| 目的 | 適した選択 |diff --git a/apps/docs/content/docs/chat.ko.mdx b/apps/docs/content/docs/chat.ko.mdxindex be5052da94..bad8ed2f7e 100644--- a/apps/docs/content/docs/chat.ko.mdx+++ b/apps/docs/content/docs/chat.ko.mdx@@ -24,6 +24,8 @@ import { Callout } from "fumadocs-ui/components/callout";런타임이 오프라인이면 다시 온라인이 될 때까지 메시지가 기다립니다. 에이전트가 보관 처리되거나 호출 권한을 잃으면 새 메시지를 보낼 수 없습니다.+첫 메시지를 보내기 전에 선택한 에이전트에 설정된 추천이 최대 3개 표시됩니다. 선택하면 전체 프롬프트가 전송되지 않고 입력창에 채워져 먼저 수정할 수 있습니다. 추천이 없는 에이전트에는 현지화된 범용 예시가 사용됩니다.+## 대화와 이슈 선택| 필요 | 더 적합한 방식 |diff --git a/apps/docs/content/docs/chat.mdx b/apps/docs/content/docs/chat.mdxindex af63d3cfa6..f25904dfc4 100644--- a/apps/docs/content/docs/chat.mdx+++ b/apps/docs/content/docs/chat.mdx@@ -24,6 +24,8 @@ A chat can also carry background. Click **+** at the bottom left of the input anIf the runtime is offline, the message waits until it comes back online. Once the agent is archived, or you lose permission to run it, you can't send new messages.+Before the first message, Chat shows up to three suggestions configured for the selected agent. Selecting one copies its full prompt into the composer without sending it, so you can adapt it first. Agents without configured suggestions use localized general-purpose examples.+## Chat vs. issues| Need | Better fit |diff --git a/apps/docs/content/docs/chat.zh.mdx b/apps/docs/content/docs/chat.zh.mdxindex 0d1ac27cbb..ec2fa338d8 100644--- a/apps/docs/content/docs/chat.zh.mdx+++ b/apps/docs/content/docs/chat.zh.mdx@@ -24,6 +24,8 @@ import { Callout } from "fumadocs-ui/components/callout";运行时离线时,消息会等待它重新上线。智能体被归档,或者你失去调用权限后,不能继续发送新消息。+第一条消息发送前,对话页会显示所选智能体配置的最多三个建议。选择后会把完整提示词填入输入框而不会发送,方便你先调整。未配置建议的智能体会使用本地化的通用示例。+## 对话与 issue 的选择| 需要 | 更适合 |diff --git a/apps/mobile/app/(app)/[workspace]/(tabs)/chat.tsx b/apps/mobile/app/(app)/[workspace]/(tabs)/chat.tsxindex 3eb4beec6f..e378859548 100644--- a/apps/mobile/app/(app)/[workspace]/(tabs)/chat.tsx+++ b/apps/mobile/app/(app)/[workspace]/(tabs)/chat.tsx@@ -520,7 +520,7 @@ export default function ChatTab() {messages={visibleMessages}loading={messagesLoading}hasSessions={sessions.length > 0}- agentName={currentAgent?.name}+ agent={currentAgent}onPickPrompt={(text) => setDraft(draftKey, text)}onQuickAction={(action) =>handleSend(action.prompt, [], { clearDraft: false })diff --git a/apps/mobile/components/chat/chat-empty-state.tsx b/apps/mobile/components/chat/chat-empty-state.tsxindex 15d76d25a9..41f986b5ed 100644--- a/apps/mobile/components/chat/chat-empty-state.tsx+++ b/apps/mobile/components/chat/chat-empty-state.tsx@@ -4,12 +4,10 @@* Two modes mirror web (packages/views/chat/components/chat-window.tsx* `EmptyState`):*- * - first-time (the workspace has never started a chat) → educate. Tell- * the user what chat is for; don't surface starter prompts yet, they- * presume context the user doesn't have.- * - returning (at least one prior session exists) → starter prompts.- * Three taps, three common workflows; tapping prefills the composer- * draft so the user can edit before sending.+ * - first-time (the workspace has never started a chat) → educate and+ * offer starter prompts so the composer is not a blank dead end.+ * - returning (at least one prior session exists) → lead with starter+ * prompts. Tapping prefills the draft so the user can edit before sending.** Copy mirrors the web `chat.json` namespace 1:1. Mobile doesn't have* i18n yet so the strings are inlined in English — when mobile adopts@@ -18,76 +16,70 @@* key-by-key swap.*/import { View } from "react-native";+import type { Agent, AgentStarterPrompt } from "@multica/core/types";import { Text } from "@/components/ui/text";import { Button } from "@/components/ui/button";-const STARTER_PROMPTS: { icon: string; text: string }[] = [- { icon: "📋", text: "List my open issues by priority" },- { icon: "📝", text: "Summarize what I did today" },- { icon: "💡", text: "Help me plan what to do next" },+const FALLBACK_STARTER_PROMPTS: AgentStarterPrompt[] = [+ {+ label: "What can you help with?",+ prompt: "What are you best at helping with? Give me a concise overview.",+ },+ {+ label: "Suggest a first task",+ prompt: "Suggest three useful tasks I could delegate to you.",+ },+ {+ label: "Recommend an action",+ prompt:+ "Review what you know about my workspace and recommend a useful first action.",+ },];interface Props {hasSessions: boolean;- agentName?: string;+ agent: Agent | null;onPickPrompt: (text: string) => void;}-export function ChatEmptyState({ hasSessions, agentName, onPickPrompt }: Props) {- // First-time experience: educate before suggesting actions. Starter- // prompts here would presume the user already knows what chat is for.- if (!hasSessions) {- return (- <View className="flex-1 items-center justify-center px-6 py-8">- <View className="max-w-xs items-center gap-3">- <Text className="text-base font-semibold text-foreground text-center">- Chat with your agents- </Text>- <Text className="text-sm text-muted-foreground text-center">- <Text className="text-sm text-muted-foreground">- ✨ They know your workspace —{" "}- </Text>- <Text className="text-sm font-medium text-foreground">- issues, projects, skills- </Text>- <Text className="text-sm text-muted-foreground">.</Text>- </Text>- <Text className="text-sm text-muted-foreground text-center">- Ask for a summary, plan your day, or hand off a small task.- </Text>- </View>- </View>- );- }-- // Returning user: starter prompts are the fastest path back to action.- const title = agentName ? `Hi, I'm ${agentName}` : "Welcome back to Multica";+export function ChatEmptyState({ hasSessions, agent, onPickPrompt }: Props) {+ const title = agent ? `Hi, I'm ${agent.name}` : "Chat with your agents";+ const configured = (agent?.starter_prompts ?? []).filter(+ (item) => item.label.trim() && item.prompt.trim(),+ );+ const prompts = configured.length > 0 ? configured : FALLBACK_STARTER_PROMPTS;return (<View className="flex-1 items-center justify-center px-6 py-8 gap-5"><View className="items-center gap-1"><Text className="text-base font-semibold text-foreground text-center">{title}</Text>- <Text className="text-sm text-muted-foreground text-center">- Try asking- </Text>- </View>- <View className="w-full max-w-xs gap-2">- {STARTER_PROMPTS.map((p) => (- <Button- key={p.text}- variant="outline"- onPress={() => onPickPrompt(p.text)}- className="h-auto justify-start px-3 py-2.5"- accessibilityLabel={p.text}- >- <Text className="text-sm text-foreground">- <Text className="text-sm">{p.icon} </Text>- {p.text}- </Text>- </Button>- ))}+ {agent?.description ? (+ <Text className="text-sm text-muted-foreground text-center">+ {agent.description}+ </Text>+ ) : null}+ {!hasSessions ? (+ <Text className="text-sm text-muted-foreground text-center">+ Pick an example to start, then edit it before sending.+ </Text>+ ) : null}</View>+ {agent ? (+ <View className="w-full max-w-xs gap-2">+ {prompts.map((item, index) => (+ <Button+ key={index}+ variant="outline"+ onPress={() => onPickPrompt(item.prompt)}+ className="h-auto justify-start px-3 py-2.5"+ accessibilityLabel={item.label}+ >+ <Text className="text-sm text-foreground">{item.label}</Text>+ </Button>+ ))}+ </View>+ ) : null}</View>);}diff --git a/apps/mobile/components/chat/chat-message-list.tsx b/apps/mobile/components/chat/chat-message-list.tsxindex 7d9fd95a37..c7836435e2 100644--- a/apps/mobile/components/chat/chat-message-list.tsx+++ b/apps/mobile/components/chat/chat-message-list.tsx@@ -46,6 +46,7 @@ import { FlashList } from "@shopify/flash-list";import { Ionicons } from "@expo/vector-icons";import { useQuery } from "@tanstack/react-query";import type {+ Agent,ChatMessage,ChatPendingTask,ChatQuickAction,@@ -79,8 +80,8 @@ interface Props {loading: boolean;/** Has the workspace ever started a chat? Drives empty-state copy. */hasSessions: boolean;- /** Currently picked / inherited agent's display name. */- agentName?: string;+ /** Currently picked / inherited agent. */+ agent: Agent | null;/** Receive a starter-prompt tap. Caller writes into the draft store* (or focuses the composer with the text) — empty state stays neutral* about send vs. preview. */@@ -105,7 +106,7 @@ export function ChatMessageList({messages,loading,hasSessions,- agentName,+ agent,onPickPrompt,onQuickAction,quickActionsDisabled = false,@@ -151,7 +152,7 @@ export function ChatMessageList({return (<ChatEmptyStatehasSessions={hasSessions}- agentName={agentName}+ agent={agent}onPickPrompt={onPickPrompt}/>);diff --git a/apps/mobile/data/schemas.ts b/apps/mobile/data/schemas.tsindex a64a02c20b..d5985cf7e6 100644--- a/apps/mobile/data/schemas.ts+++ b/apps/mobile/data/schemas.ts@@ -611,6 +611,17 @@ export const AgentSchema: z.ZodType<Agent> = z.object({name: z.string().default(""),description: z.string().default(""),instructions: z.string().default(""),+ starter_prompts: z+ .array(+ z+ .object({+ label: z.string().default(""),+ prompt: z.string().default(""),+ })+ .loose(),+ )+ .catch([])+ .default([]),avatar_url: z.string().nullable().default(null),runtime_mode: z.string().catch("daemon") as unknown as z.ZodType<Agent["runtime_mode"]diff --git a/apps/mobile/lib/agent-schema.test.ts b/apps/mobile/lib/agent-schema.test.tsindex fb5e37670f..77943200ac 100644--- a/apps/mobile/lib/agent-schema.test.ts+++ b/apps/mobile/lib/agent-schema.test.ts@@ -49,4 +49,22 @@ describe("AgentSchema invocation permissions", () => {expect(parsed.runtime_id).toBe("");expect(parsed.runtime_bound).toBe(false);});++ it("parses starter prompts and degrades malformed additive data", () => {+ expect(+ AgentSchema.parse({+ id: "agent-1",+ starter_prompts: [+ { label: "Review a PR", prompt: "Review the open pull request." },+ ],+ }).starter_prompts,+ ).toEqual([+ { label: "Review a PR", prompt: "Review the open pull request." },+ ]);++ expect(+ AgentSchema.parse({ id: "agent-1", starter_prompts: "invalid" })+ .starter_prompts,+ ).toEqual([]);+ });});diff --git a/docs/assets/pr-5537/agent-create-before-after.png b/docs/assets/pr-5537/agent-create-before-after.pngnew file mode 100644index 0000000000..da67381041Binary files /dev/null and b/docs/assets/pr-5537/agent-create-before-after.png differdiff --git a/docs/assets/pr-5537/chat-before-after.png b/docs/assets/pr-5537/chat-before-after.pngnew file mode 100644index 0000000000..490f9abeafBinary files /dev/null and b/docs/assets/pr-5537/chat-before-after.png differdiff --git a/packages/core/agents/builder-protocol.test.ts b/packages/core/agents/builder-protocol.test.tsindex 71aec0f687..fe98faff26 100644--- a/packages/core/agents/builder-protocol.test.ts+++ b/packages/core/agents/builder-protocol.test.ts@@ -13,6 +13,7 @@ const draft = (): AgentDraft => ({name: "Old name",description: "Old description",instructions: "Old instructions",+ starterPrompts: [],avatarUrl: null,runtimeId: "runtime-1",model: "model-1",@@ -37,14 +38,33 @@ describe("agent builder protocol", () => {expect(parseBuilderDraft("<agent_draft>not json</agent_draft>")).toBeNull();});+ it("accepts up to three complete starter prompts from the builder", () => {+ const merged = mergeBuilderDraft(+ draft(),+ {+ starter_prompts: [+ { label: " Review a PR ", prompt: " Review the open PR. " },+ { label: "", prompt: "Ignored" },+ ],+ },+ new Set(),+ new Set(),+ new Set(["model-1"]),+ );++ expect(merged.starterPrompts).toEqual([+ { label: "Review a PR", prompt: "Review the open PR." },+ ]);+ });+// Streaming delivers the reply token by token, so for the seconds it takes to// emit the JSON there is an opening tag and no closing one. The closed-form// pattern cannot match that, and the raw payload scrolled past the user on// every turn.it("hides a block that is still being streamed", () => {- expect(- stripBuilderDraft('Here you go.\n<agent_draft>{"name":"Rel'),- ).toBe("Here you go.");+ expect(stripBuilderDraft('Here you go.\n<agent_draft>{"name":"Rel')).toBe(+ "Here you go.",+ );});it("repairs literal line breaks emitted inside the instructions string", () => {@@ -56,14 +76,19 @@ Return findings."}</agent_draft>`;expect(parseBuilderDraft(content)).toEqual({name: "Reviewer",- instructions: "# Role\nReview every change.\n\n# Output\nReturn findings.",+ instructions:+ "# Role\nReview every change.\n\n# Output\nReturn findings.",});});it("round-trips only the user's natural-language request for chat display", () => {+ const currentDraft = draft();+ currentDraft.starterPrompts = [+ { label: "Plan a release", prompt: "Plan the next release." },+ ];const content = encodeBuilderInput("Create a release manager",- draft(),+ currentDraft,[],[],{ id: "runtime-1", name: "Codex", provider: "codex" },@@ -80,6 +105,11 @@ Return findings."}</agent_draft>`;available_runtime_models: [{ id: "gpt-5.5", label: "GPT-5.5", provider: "openai" },],+ current_draft: {+ starter_prompts: [+ { label: "Plan a release", prompt: "Plan the next release." },+ ],+ },});expect(decodeBuilderInput("ordinary chat message")).toBe("ordinary chat message",@@ -101,10 +131,12 @@ Return findings."}</agent_draft>`;[],);- expect(pickBuilderRestore(null, { id: "msg-1", content: encoded })).toEqual({- id: "msg-1",- content: "Create a release manager",- });+ expect(pickBuilderRestore(null, { id: "msg-1", content: encoded })).toEqual(+ {+ id: "msg-1",+ content: "Create a release manager",+ },+ );expect(pickBuilderRestore(null, null)).toBeNull();});@@ -193,8 +225,13 @@ Return findings."}</agent_draft>`;).model,).toBe("model-1");expect(- mergeBuilderDraft(draft(), { model: "model-1" }, new Set(), new Set(), null)- .model,+ mergeBuilderDraft(+ draft(),+ { model: "model-1" },+ new Set(),+ new Set(),+ null,+ ).model,).toBe("model-1");expect(mergeBuilderDraft(diff --git a/packages/core/agents/builder-protocol.ts b/packages/core/agents/builder-protocol.tsindex 7120d934bc..8f8e987693 100644--- a/packages/core/agents/builder-protocol.ts+++ b/packages/core/agents/builder-protocol.ts@@ -1,4 +1,9 @@import type { RuntimeDevice, RuntimeModel } from "../types";+import {+ AGENT_STARTER_PROMPT_LABEL_MAX_LENGTH,+ AGENT_STARTER_PROMPT_MAX_LENGTH,+ AGENT_STARTER_PROMPTS_MAX,+} from "./constants";import type { AgentDraft } from "./draft";/**@@ -22,6 +27,7 @@ export interface BuilderDraftPayload {name?: unknown;description?: unknown;instructions?: unknown;+ starter_prompts?: unknown;model?: unknown;skill_ids?: unknown;permission_scope?: unknown;@@ -130,6 +136,7 @@ export function encodeBuilderInput(name: draft.name,description: draft.description,instructions: draft.instructions,+ starter_prompts: draft.starterPrompts,model: draft.model,skill_ids: [...draft.skillIds],permission_scope: draft.permissionScope,@@ -244,6 +251,28 @@ export function mergeBuilderDraft(? payload.model: current.model;+ const starterPrompts = Array.isArray(payload.starter_prompts)+ ? payload.starter_prompts+ .slice(0, AGENT_STARTER_PROMPTS_MAX)+ .filter(+ (item): item is { label: string; prompt: string } =>+ !!item &&+ typeof item === "object" &&+ typeof (item as { label?: unknown }).label === "string" &&+ typeof (item as { prompt?: unknown }).prompt === "string" &&+ (item as { label: string }).label.trim().length > 0 &&+ (item as { prompt: string }).prompt.trim().length > 0,+ )+ .map((item) => ({+ label: [...item.label.trim()]+ .slice(0, AGENT_STARTER_PROMPT_LABEL_MAX_LENGTH)+ .join(""),+ prompt: [...item.prompt.trim()]+ .slice(0, AGENT_STARTER_PROMPT_MAX_LENGTH)+ .join(""),+ }))+ : current.starterPrompts;+return {...current,name: typeof payload.name === "string" ? payload.name : current.name,@@ -255,6 +284,7 @@ export function mergeBuilderDraft(typeof payload.instructions === "string"? payload.instructions: current.instructions,+ starterPrompts,model,// The builder can move the model, which invalidates whatever thinking /// speed the user picked for the previous one. It never sets these twodiff --git a/packages/core/agents/constants.ts b/packages/core/agents/constants.tsindex 815fa613cf..b8589908e6 100644--- a/packages/core/agents/constants.ts+++ b/packages/core/agents/constants.ts@@ -3,6 +3,10 @@// Kept in core so both apps and the test suite read from one source.export const AGENT_DESCRIPTION_MAX_LENGTH = 255;+export const AGENT_STARTER_PROMPTS_MAX = 3;+export const AGENT_STARTER_PROMPT_LABEL_MAX_LENGTH = 80;+export const AGENT_STARTER_PROMPT_MAX_LENGTH = 4000;+// Valid range for the per-agent scheduler cap. Kept here so creation,// duplication, and settings editing cannot silently drift.export const AGENT_MAX_CONCURRENT_TASKS_MIN = 1;diff --git a/packages/core/agents/draft.test.ts b/packages/core/agents/draft.test.tsindex 5fb0077100..a954ee1abf 100644--- a/packages/core/agents/draft.test.ts+++ b/packages/core/agents/draft.test.ts@@ -15,6 +15,7 @@ const draft = (): AgentDraft => ({name: "Old name",description: "Old description",instructions: "Old instructions",+ starterPrompts: [],avatarUrl: null,runtimeId: "runtime-1",model: "model-1",@@ -102,6 +103,54 @@ describe("duplicate access", () => {});});+describe("agent starter prompts", () => {+ it("copies prompts into a duplicate and the create request", () => {+ const starterPrompts = [+ { label: "Review a PR", prompt: "Review the open pull request." },+ ];+ const duplicate = buildDuplicateDraft(+ sourceAgent({ starter_prompts: starterPrompts }),+ {+ runtimes: [CODEX_RUNTIME],+ currentUserId: "user-1",+ fallbackRuntimeId: "runtime-2",+ nameSuffix: " (Copy)",+ },+ );++ expect(duplicate.starterPrompts).toEqual(starterPrompts);+ expect(+ buildCreateAgentRequest({ draft: duplicate, runtimeId: "runtime-1" })+ .starter_prompts,+ ).toEqual(starterPrompts);+ });++ it("trims prompt fields before submission", () => {+ const request = buildCreateAgentRequest({+ draft: {+ ...draft(),+ starterPrompts: [+ { label: " Plan a release ", prompt: " Plan the next release. " },+ ],+ },+ runtimeId: "runtime-1",+ });++ expect(request.starter_prompts).toEqual([+ { label: "Plan a release", prompt: "Plan the next release." },+ ]);+ });++ it("omits the field when there are no prompts", () => {+ const request = buildCreateAgentRequest({+ draft: draft(),+ runtimeId: "runtime-1",+ });++ expect(request).not.toHaveProperty("starter_prompts");+ });+});+// MUL-5390: thinking_level / service_tier are runtime + model scoped. The create// flow never exposed them, so a Fast Codex agent could only be configured after// the fact and a Duplicate silently dropped the setting.diff --git a/packages/core/agents/draft.ts b/packages/core/agents/draft.tsindex f847378cd2..770674c0f1 100644--- a/packages/core/agents/draft.ts+++ b/packages/core/agents/draft.ts@@ -3,6 +3,7 @@ import type {Agent,AgentInvocationTargetInput,AgentPermissionScope,+ AgentStarterPrompt,CreateAgentRequest,RuntimeDevice,} from "../types";@@ -25,6 +26,7 @@ export interface AgentDraft {name: string;description: string;instructions: string;+ starterPrompts: AgentStarterPrompt[];avatarUrl: string | null;runtimeId: string;model: string;@@ -43,6 +45,7 @@ export const EMPTY_AGENT_DRAFT: AgentDraft = {name: "",description: "",instructions: "",+ starterPrompts: [],avatarUrl: null,runtimeId: "",model: "",@@ -186,6 +189,7 @@ export function buildDuplicateDraft(name: `${source.name}${options.nameSuffix}`,description: source.description ?? "",instructions: source.instructions ?? "",+ starterPrompts: (source.starter_prompts ?? []).map((item) => ({ ...item })),avatarUrl: source.avatar_url ?? null,runtimeId: keepsRuntime? (source.runtime_id as string)@@ -216,6 +220,14 @@ export function buildCreateAgentRequest(options: {name: draft.name.trim(),description: draft.description.trim(),instructions: draft.instructions.trim() || undefined,+ ...(draft.starterPrompts.length > 0+ ? {+ starter_prompts: draft.starterPrompts.map((item) => ({+ label: item.label.trim(),+ prompt: item.prompt.trim(),+ })),+ }+ : {}),avatar_url: draft.avatarUrl ?? undefined,runtime_id: runtimeId,model: draft.model.trim() || undefined,diff --git a/packages/core/agents/stored-draft.test.ts b/packages/core/agents/stored-draft.test.tsindex 6d0f6131f9..dc187799fb 100644--- a/packages/core/agents/stored-draft.test.ts+++ b/packages/core/agents/stored-draft.test.ts@@ -10,6 +10,9 @@ const draft = (): AgentDraft => ({name: "Release manager",description: "Ships carefully",instructions: "# Role\nShip.",+ starterPrompts: [+ { label: "Plan a release", prompt: "Plan the next release." },+ ],avatarUrl: "🚀",runtimeId: "runtime-1",model: "gpt-5.6-sol",diff --git a/packages/core/agents/stored-draft.ts b/packages/core/agents/stored-draft.tsindex e5a26c5b23..6490ef7f57 100644--- a/packages/core/agents/stored-draft.ts+++ b/packages/core/agents/stored-draft.ts@@ -11,6 +11,7 @@ export function toStoredAgentDraft(name: draft.name,description: draft.description,instructions: draft.instructions,+ starter_prompts: draft.starterPrompts,avatar_url: draft.avatarUrl,model: draft.model,thinking_level: draft.thinkingLevel,@@ -36,6 +37,7 @@ export function fromStoredAgentDraft(name: stored.name,description: stored.description,instructions: stored.instructions,+ starterPrompts: stored.starter_prompts ?? [],avatarUrl: stored.avatar_url,runtimeId,model: stored.model,diff --git a/packages/core/api/client.test.ts b/packages/core/api/client.test.tsindex 89db50b8fb..0b55c29adf 100644--- a/packages/core/api/client.test.ts+++ b/packages/core/api/client.test.ts@@ -1,11 +1,78 @@import { afterEach, describe, expect, it, vi } from "vitest";+import { configStore } from "../config";import { ApiClient, ApiError, CHAT_DRAFT_RESTORE_CAPABILITY, clientErrorMessage } from "./client";import { EMPTY_PLUGIN_PACKAGE_LIST, EMPTY_PLUGIN_PREVIEW, EMPTY_PLUGIN_SURFACE_LAUNCH } from "./schemas";afterEach(() => {+ configStore.getState().setAgentStarterPromptsSupported(false);vi.unstubAllGlobals();});+describe("ApiClient agent starter-prompt compatibility", () => {+ const prompt = {+ label: "Review a PR",+ prompt: "Review the open pull request.",+ };++ it("rejects create writes before an older backend can drop them", async () => {+ const fetchMock = vi.fn();+ vi.stubGlobal("fetch", fetchMock);+ const client = new ApiClient("https://api.example.test");++ await expect(+ client.createAgent({+ name: "Reviewer",+ runtime_id: "runtime-1",+ starter_prompts: [prompt],+ }),+ ).rejects.toThrow(/server version does not support agent starter prompts/i);+ expect(fetchMock).not.toHaveBeenCalled();+ });++ it("rejects update writes before an older backend can drop them", async () => {+ const fetchMock = vi.fn();+ vi.stubGlobal("fetch", fetchMock);+ const client = new ApiClient("https://api.example.test");++ await expect(+ client.updateAgent("agent-1", { starter_prompts: [prompt] }),+ ).rejects.toThrow(/server version does not support agent starter prompts/i);+ expect(fetchMock).not.toHaveBeenCalled();+ });++ it("allows declared-capability create and update writes through", async () => {+ configStore.getState().setAgentStarterPromptsSupported(true);+ const fetchMock = vi.fn().mockImplementation(() =>+ Promise.resolve(+ new Response(JSON.stringify({ id: "agent-1" }), {+ status: 200,+ headers: { "Content-Type": "application/json" },+ }),+ ),+ );+ vi.stubGlobal("fetch", fetchMock);++ const client = new ApiClient("https://api.example.test");+ await client.createAgent({+ name: "Reviewer",+ runtime_id: "runtime-1",+ starter_prompts: [prompt],+ });+ await client.updateAgent("agent-1", {+ starter_prompts: [prompt],+ });++ expect(JSON.parse(String(fetchMock.mock.calls[0]?.[1]?.body))).toEqual({+ name: "Reviewer",+ runtime_id: "runtime-1",+ starter_prompts: [prompt],+ });+ expect(JSON.parse(String(fetchMock.mock.calls[1]?.[1]?.body))).toEqual({+ starter_prompts: [prompt],+ });+ });+});+describe("ApiClient edit guards", () => {it("serializes field baselines for issue and comment writes", async () => {const fetchMock = vi.fn().mockImplementation(() => Promise.resolve(diff --git a/packages/core/api/client.ts b/packages/core/api/client.tsindex 96451dbbe6..8679914d5e 100644--- a/packages/core/api/client.ts+++ b/packages/core/api/client.ts@@ -1,3 +1,4 @@+import { configStore } from "../config";import type {Issue,IssuePriority,@@ -503,6 +504,19 @@ export class ApiError extends Error {}}+function assertAgentStarterPromptsWriteSupported(data: {+ starter_prompts?: unknown;+}): void {+ if (+ Object.prototype.hasOwnProperty.call(data, "starter_prompts") &&+ !configStore.getState().agentStarterPromptsSupported+ ) {+ throw new Error(+ "This server version does not support agent starter prompts. Update the server before saving them.",+ );+ }+}+// errorCode extracts the stable `code` a handler attaches to a failure// (writeErrorCode), so a caller can render its own localized sentence instead// of toasting the server's English one. Returns undefined for a non-ApiError,@@ -1411,6 +1425,7 @@ export class ApiClient {}async createAgent(data: CreateAgentRequest): Promise<Agent> {+ assertAgentStarterPromptsWriteSupported(data);return this.fetch("/api/agents", {method: "POST",body: JSON.stringify(data),@@ -1526,6 +1541,7 @@ export class ApiClient {}async updateAgent(id: string, data: UpdateAgentRequest): Promise<Agent> {+ assertAgentStarterPromptsWriteSupported(data);return this.fetch(`/api/agents/${id}`, {method: "PUT",body: JSON.stringify(data),diff --git a/packages/core/api/schemas.test.ts b/packages/core/api/schemas.test.tsindex 5a715be67b..673da1f012 100644--- a/packages/core/api/schemas.test.ts+++ b/packages/core/api/schemas.test.ts@@ -1151,6 +1151,26 @@ describe("AppConfigSchema local_worktree_supported drift", () => {});});+describe("AppConfigSchema agent_starter_prompts_supported drift", () => {+ it("defaults to false when the server predates the persistence contract", () => {+ expect(AppConfigSchema.parse({}).agent_starter_prompts_supported).toBe(false);+ });++ it("coerces a malformed declaration to false", () => {+ expect(+ AppConfigSchema.parse({ agent_starter_prompts_supported: "yes" })+ .agent_starter_prompts_supported,+ ).toBe(false);+ });++ it("carries a genuine declaration through", () => {+ expect(+ AppConfigSchema.parse({ agent_starter_prompts_supported: true })+ .agent_starter_prompts_supported,+ ).toBe(true);+ });+});+describe("AppConfigSchema cdn_signed drift", () => {it("defaults cdn_signed to false when the server omits it (pre-MUL-3254 servers)", () => {const parsed = AppConfigSchema.parse({ cdn_domain: "cdn.example.com" });diff --git a/packages/core/api/schemas.ts b/packages/core/api/schemas.tsindex 61684ed1ee..9118ed3254 100644--- a/packages/core/api/schemas.ts+++ b/packages/core/api/schemas.ts@@ -748,6 +748,9 @@ export interface AppConfigResponse {* signal do validate but cannot say so, and are treated as unable: the client* has no way to tell them apart, and only one of the two answers is safe. */local_worktree_supported?: boolean;+ /** Whether agent create/update persists `starter_prompts`. Older servers+ * silently ignored the unknown field, so absent must be treated as false. */+ agent_starter_prompts_supported?: boolean;server_version?: string;}@@ -944,6 +947,7 @@ export const AppConfigSchema = z.object({vcs_integration_available: BooleanWithDefaultSchema(false).optional(),feature_flags: FeatureFlagsSchema,local_worktree_supported: BooleanWithDefaultSchema(false),+ agent_starter_prompts_supported: BooleanWithDefaultSchema(false),server_version: OptionalStringSchema,}).loose();@@ -959,6 +963,8 @@ export const EMPTY_APP_CONFIG: AppConfigResponse = {// Fail closed: an unreadable config must not look like a server that// validates execution_mode.local_worktree_supported: false,+ // Fail closed: old servers returned success while dropping the field.+ agent_starter_prompts_supported: false,feature_flags: {},};@@ -1947,6 +1953,14 @@ export const StoredAgentDraftSchema = z.object({name: z.string().catch(""),description: z.string().catch(""),instructions: z.string().catch(""),+ starter_prompts: z+ .array(+ z.object({+ label: z.string().catch(""),+ prompt: z.string().catch(""),+ }),+ )+ .catch([]),avatar_url: z.string().nullable().catch(null),model: z.string().catch(""),thinking_level: z.string().catch(""),diff --git a/packages/core/config/index.ts b/packages/core/config/index.tsindex 3b6f8b0081..ea6d559adf 100644--- a/packages/core/config/index.ts+++ b/packages/core/config/index.ts@@ -32,6 +32,10 @@ interface ConfigState {// predate this signal are caught by the same net — indistinguishable from// here, and only one of the two answers is safe to guess.localWorktreeSupported: boolean;+ // Whether this server persists starter_prompts on agent create/update.+ // Older handlers accepted the unknown field and returned success while+ // dropping it, so absent must fail closed.+ agentStarterPromptsSupported: boolean;setCdnConfig: (config: { cdnDomain: string; cdnSigned?: boolean }) => void;setAuthConfig: (config: {allowSignup: boolean;@@ -46,6 +50,7 @@ interface ConfigState {setFeatureFlags: (flags?: Record<string, boolean>) => void;setServerVersion: (version?: string) => void;setLocalWorktreeSupported: (supported?: boolean) => void;+ setAgentStarterPromptsSupported: (supported?: boolean) => void;}export const configStore = createStore<ConfigState>((set) => ({@@ -60,6 +65,7 @@ export const configStore = createStore<ConfigState>((set) => ({featureFlags: {},serverVersion: "",localWorktreeSupported: false,+ agentStarterPromptsSupported: false,setCdnConfig: ({ cdnDomain, cdnSigned = false }) => set({ cdnDomain, cdnSigned }),setAuthConfig: ({allowSignup,@@ -73,6 +79,8 @@ export const configStore = createStore<ConfigState>((set) => ({setServerVersion: (version = "") => set({ serverVersion: version }),setLocalWorktreeSupported: (supported = false) =>set({ localWorktreeSupported: supported === true }),+ setAgentStarterPromptsSupported: (supported = false) =>+ set({ agentStarterPromptsSupported: supported === true }),}));export function useConfigStore(): ConfigState;diff --git a/packages/core/platform/auth-initializer.tsx b/packages/core/platform/auth-initializer.tsxindex f70efe3eca..e023736d72 100644--- a/packages/core/platform/auth-initializer.tsx+++ b/packages/core/platform/auth-initializer.tsx@@ -86,6 +86,14 @@ export function AuthInitializer({configStore.getState().setLocalWorktreeSupported(cfg.local_worktree_supported === true);+ // Older agent handlers returned success while silently dropping this+ // additive field, so writes stay disabled unless the server declares+ // the persistence contract explicitly.+ configStore+ .getState()+ .setAgentStarterPromptsSupported(+ cfg.agent_starter_prompts_supported === true,+ );if (cfg.posthog_key) {initAnalytics({key: cfg.posthog_key,diff --git a/packages/core/types/agent.ts b/packages/core/types/agent.tsindex d797672f2e..ec9e5e110e 100644--- a/packages/core/types/agent.ts+++ b/packages/core/types/agent.ts@@ -477,6 +477,8 @@ export interface Agent {/** What this agent's owner wrote. For a system agent this holds only the* workspace's own notes — the product half is `system_instructions`. */instructions: string;+ /** Up to three agent-authored first-turn suggestions. Older servers omit it. */+ starter_prompts?: AgentStarterPrompt[];/** Set for product-defined agents (e.g. "mika"). Absent for user- and* template-created agents. Identity for "maintained by Multica" checks —* never the display name, which owners may change. */@@ -588,6 +590,13 @@ export interface Agent {archived_by: string | null;}+export interface AgentStarterPrompt {+ /** Short chip label shown in the empty state. */+ label: string;+ /** Full editable text copied into the composer when selected. */+ prompt: string;+}+export interface DisabledRuntimeSkill {runtime_id: string;provider: string;@@ -625,6 +634,7 @@ export interface CreateAgentRequest {name: string;description?: string;instructions?: string;+ starter_prompts?: AgentStarterPrompt[];avatar_url?: string;runtime_id: string;runtime_config?: Record<string, unknown>;@@ -677,6 +687,7 @@ export interface StoredAgentDraft {name: string;description: string;instructions: string;+ starter_prompts: AgentStarterPrompt[];avatar_url: string | null;model: string;thinking_level: string;@@ -719,6 +730,7 @@ export interface UpdateAgentRequest {name?: string;description?: string;instructions?: string;+ starter_prompts?: AgentStarterPrompt[];avatar_url?: string;runtime_id?: string;runtime_config?: Record<string, unknown>;diff --git a/packages/core/types/index.ts b/packages/core/types/index.tsindex 0382e981fd..198e6ae143 100644--- a/packages/core/types/index.ts+++ b/packages/core/types/index.ts@@ -8,6 +8,7 @@ export type {} from "./issue-status";export type {Agent,+ AgentStarterPrompt,AgentStatus,AgentRuntimeMode,AgentVisibility,diff --git a/packages/views/agents/components/agent-overview-pane.tsx b/packages/views/agents/components/agent-overview-pane.tsxindex 26199709bc..4471f88f44 100644--- a/packages/views/agents/components/agent-overview-pane.tsx+++ b/packages/views/agents/components/agent-overview-pane.tsx@@ -426,9 +426,7 @@ export function AgentOverviewPane({{effectiveView === "instructions" && (<InstructionsTabagent={agent}- onSave={(instructions) =>- onUpdate(agent.id, { instructions })- }+ onSave={(updates) => onUpdate(agent.id, updates)}onDirtyChange={setActiveDirty}/>)}diff --git a/packages/views/agents/components/starter-prompts-editor.tsx b/packages/views/agents/components/starter-prompts-editor.tsxnew file mode 100644index 0000000000..ba6f544376--- /dev/null+++ b/packages/views/agents/components/starter-prompts-editor.tsx@@ -0,0 +1,115 @@+"use client";++import { Plus, Trash2 } from "lucide-react";+import {+ AGENT_STARTER_PROMPT_LABEL_MAX_LENGTH,+ AGENT_STARTER_PROMPT_MAX_LENGTH,+ AGENT_STARTER_PROMPTS_MAX,+} from "@multica/core/agents";+import type { AgentStarterPrompt } from "@multica/core/types";+import { Button } from "@multica/ui/components/ui/button";+import { Input } from "@multica/ui/components/ui/input";+import { Textarea } from "@multica/ui/components/ui/textarea";+import { useT } from "../../i18n";++export function StarterPromptsEditor({+ value,+ onChange,+ disabled = false,+}: {+ value: AgentStarterPrompt[];+ onChange: (value: AgentStarterPrompt[]) => void;+ disabled?: boolean;+}) {+ const { t } = useT("agents");+ const hasIncompletePrompt = value.some(+ (item) => !item.label.trim() || !item.prompt.trim(),+ );++ const update = (+ index: number,+ field: keyof AgentStarterPrompt,+ nextValue: string,+ ) => {+ onChange(+ value.map((item, itemIndex) =>+ itemIndex === index ? { ...item, [field]: nextValue } : item,+ ),+ );+ };++ return (+ <div className="space-y-3">+ <div>+ <p className="text-body font-medium">+ {t(($) => $.starter_prompts.label)}+ </p>+ <p className="mt-1 text-caption leading-5 text-muted-foreground">+ {t(($) => $.starter_prompts.hint)}+ </p>+ </div>++ {value.map((item, index) => (+ <div key={index} className="rounded-lg border bg-muted/20 p-3">+ <div className="flex items-center gap-2">+ <Input+ value={item.label}+ maxLength={AGENT_STARTER_PROMPT_LABEL_MAX_LENGTH}+ disabled={disabled}+ aria-label={t(($) => $.starter_prompts.item_label, {+ number: index + 1,+ })}+ placeholder={t(($) => $.starter_prompts.label_placeholder)}+ onChange={(event) => update(index, "label", event.target.value)}+ />+ <Button+ type="button"+ variant="ghost"+ size="icon-sm"+ disabled={disabled}+ aria-label={t(($) => $.starter_prompts.remove, {+ number: index + 1,+ })}+ onClick={() =>+ onChange(value.filter((_, itemIndex) => itemIndex !== index))+ }+ >+ <Trash2 className="size-4" aria-hidden="true" />+ </Button>+ </div>+ <Textarea+ value={item.prompt}+ maxLength={AGENT_STARTER_PROMPT_MAX_LENGTH}+ disabled={disabled}+ rows={3}+ className="mt-2 resize-y"+ aria-label={t(($) => $.starter_prompts.prompt_label, {+ number: index + 1,+ })}+ placeholder={t(($) => $.starter_prompts.prompt_placeholder)}+ onChange={(event) => update(index, "prompt", event.target.value)}+ />+ </div>+ ))}++ {value.length < AGENT_STARTER_PROMPTS_MAX ? (+ <Button+ type="button"+ variant="outline"+ size="sm"+ disabled={disabled}+ onClick={() => onChange([...value, { label: "", prompt: "" }])}+ >+ <Plus className="size-4" aria-hidden="true" />+ {t(($) => $.starter_prompts.add)}+ </Button>+ ) : null}++ {hasIncompletePrompt ? (+ <p className="text-caption text-destructive" role="alert">+ {t(($) => $.starter_prompts.incomplete)}+ </p>+ ) : null}+ </div>+ );+}diff --git a/packages/views/agents/components/tabs/instructions-tab.test.tsx b/packages/views/agents/components/tabs/instructions-tab.test.tsxnew file mode 100644index 0000000000..f29122d99e--- /dev/null+++ b/packages/views/agents/components/tabs/instructions-tab.test.tsx@@ -0,0 +1,171 @@+// @vitest-environment jsdom++import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";+import { act, render, screen } from "@testing-library/react";+import userEvent from "@testing-library/user-event";+import { configStore } from "@multica/core/config";+import { I18nProvider } from "@multica/core/i18n/react";+import type { Agent } from "@multica/core/types";+import enCommon from "../../../locales/en/common.json";+import enAgents from "../../../locales/en/agents.json";+import { InstructionsTab } from "./instructions-tab";++const TEST_RESOURCES = { en: { common: enCommon, agents: enAgents } };+const persistedPrompt = {+ label: "Review a PR",+ prompt: "Review the open pull request.",+};+const baseAgent: Agent = {+ id: "agent-1",+ workspace_id: "ws-1",+ runtime_id: "runtime-1",+ name: "Reviewer",+ description: "",+ instructions: "Review carefully.",+ starter_prompts: [persistedPrompt],+ avatar_url: null,+ runtime_mode: "local",+ runtime_config: {},+ custom_args: [],+ visibility: "workspace",+ permission_mode: "public_to",+ invocation_targets: [{ target_type: "workspace", target_id: null }],+ status: "idle",+ max_concurrent_tasks: 1,+ model: "",+ owner_id: "user-1",+ skills: [],+ created_at: "2026-08-24T00:00:00Z",+ updated_at: "2026-08-24T00:00:00Z",+ archived_at: null,+ archived_by: null,+};++function tab(agent: Agent, onSave = vi.fn().mockResolvedValue(undefined)) {+ return (+ <I18nProvider locale="en" resources={TEST_RESOURCES}>+ <InstructionsTab agent={agent} onSave={onSave} />+ </I18nProvider>+ );+}++describe("InstructionsTab persisted-state synchronization", () => {+ beforeEach(() => {+ configStore.getState().setAgentStarterPromptsSupported(true);+ });++ afterEach(() => {+ act(() => {+ configStore.getState().setAgentStarterPromptsSupported(false);+ });+ });++ it("preserves an unsaved prompt across an equivalent agent-list refetch", async () => {+ const user = userEvent.setup();+ const { rerender } = render(tab(baseAgent));+ const label = screen.getByLabelText("Suggestion 1 label");+ await user.clear(label);+ await user.type(label, "Inspect the patch");++ rerender(+ tab({+ ...baseAgent,+ starter_prompts: [{ ...persistedPrompt }],+ }),+ );++ expect(screen.getByLabelText("Suggestion 1 label")).toHaveValue(+ "Inspect the patch",+ );+ });++ it("preserves dirty local state when persisted contents change", async () => {+ const user = userEvent.setup();+ const { rerender } = render(tab(baseAgent));+ const label = screen.getByLabelText("Suggestion 1 label");+ await user.clear(label);+ await user.type(label, "Inspect the patch");++ rerender(+ tab({+ ...baseAgent,+ starter_prompts: [+ { label: "Server-side change", prompt: "A different prompt." },+ ],+ }),+ );++ expect(screen.getByLabelText("Suggestion 1 label")).toHaveValue(+ "Inspect the patch",+ );+ });++ it("preserves submitted prompt edits when an optimistic update rolls back", async () => {+ let rejectSave!: (reason?: unknown) => void;+ const onSave = vi.fn(+ () =>+ new Promise<void>((_, reject) => {+ rejectSave = reject;+ }),+ );+ const user = userEvent.setup();+ const { rerender } = render(tab(baseAgent, onSave));+ const label = screen.getByLabelText("Suggestion 1 label");+ const prompt = screen.getByLabelText("Suggestion 1 prompt");+ await user.clear(label);+ await user.type(label, "Inspect the patch");+ await user.clear(prompt);+ await user.type(prompt, "Inspect the patch for correctness.");+ await user.click(screen.getByRole("button", { name: "Save" }));++ const optimisticPrompt = {+ label: "Inspect the patch",+ prompt: "Inspect the patch for correctness.",+ };+ rerender(+ tab(+ {+ ...baseAgent,+ starter_prompts: [optimisticPrompt],+ },+ onSave,+ ),+ );+ rerender(+ tab(+ {+ ...baseAgent,+ starter_prompts: [{ ...persistedPrompt }],+ },+ onSave,+ ),+ );+ await act(async () => rejectSave(new Error("Update failed")));++ expect(screen.getByLabelText("Suggestion 1 label")).toHaveValue(+ "Inspect the patch",+ );+ expect(screen.getByLabelText("Suggestion 1 prompt")).toHaveValue(+ "Inspect the patch for correctness.",+ );+ });++ it("omits starter prompts from settings writes to an older backend", async () => {+ configStore.getState().setAgentStarterPromptsSupported(false);+ const onSave = vi.fn().mockResolvedValue(undefined);+ const user = userEvent.setup();+ render(tab(baseAgent, onSave));++ expect(+ screen.queryByText("Suggested first actions"),+ ).not.toBeInTheDocument();+ const instructions = screen.getByLabelText("System prompt");+ await user.clear(instructions);+ await user.type(instructions, "Updated instructions.");+ await user.click(screen.getByRole("button", { name: "Save" }));++ expect(onSave).toHaveBeenCalledWith({+ instructions: "Updated instructions.",+ });+ });+});diff --git a/packages/views/agents/components/tabs/instructions-tab.tsx b/packages/views/agents/components/tabs/instructions-tab.tsxindex 4fef58d4e7..cce8c4361e 100644--- a/packages/views/agents/components/tabs/instructions-tab.tsx+++ b/packages/views/agents/components/tabs/instructions-tab.tsx@@ -1,26 +1,62 @@"use client";-import { useEffect, useState } from "react";+import { useEffect, useRef, useState } from "react";import { Loader2, Save } from "lucide-react";-import type { Agent } from "@multica/core/types";+import { useConfigStore } from "@multica/core/config";+import type { Agent, AgentStarterPrompt } from "@multica/core/types";import { Button } from "@multica/ui/components/ui/button";import { Textarea } from "@multica/ui/components/ui/textarea";import { useT } from "../../../i18n";+import { StarterPromptsEditor } from "../starter-prompts-editor";+export function InstructionsTab({agent,onSave,onDirtyChange,}: {agent: Agent;- onSave: (instructions: string) => Promise<void>;+ onSave: (updates: {+ instructions: string;+ starter_prompts?: AgentStarterPrompt[];+ }) => Promise<void>;onDirtyChange?: (dirty: boolean) => void;}) {const { t } = useT("agents");+ const starterPromptsSupported = useConfigStore(+ (state) => state.agentStarterPromptsSupported,+ );const [value, setValue] = useState(agent.instructions ?? "");+ const [starterPrompts, setStarterPrompts] = useState<AgentStarterPrompt[]>(+ agent.starter_prompts ?? [],+ );const [saving, setSaving] = useState(false);const [systemOpen, setSystemOpen] = useState(false);- const isDirty = value !== (agent.instructions ?? "");+ const persistedStarterPromptsKey = JSON.stringify(+ agent.starter_prompts ?? [],+ );+ const persistedRef = useRef({+ agentId: agent.id,+ instructions: agent.instructions ?? "",+ starterPromptsKey: persistedStarterPromptsKey,+ });+ const localRef = useRef({+ instructions: value,+ starterPromptsKey: JSON.stringify(starterPrompts),+ });+ localRef.current = {+ instructions: value,+ starterPromptsKey: JSON.stringify(starterPrompts),+ };+ const isDirty =+ value !== (agent.instructions ?? "") ||+ (starterPromptsSupported &&+ JSON.stringify(starterPrompts) !== persistedStarterPromptsKey);+ const starterPromptsValid =+ !starterPromptsSupported ||+ starterPrompts.every(+ (item) => item.label.trim() && item.prompt.trim(),+ );// A system agent's prompt has two halves: the product half ships with the// backend and updates on deploy, so it is shown read-only; the editable@@ -29,10 +65,39 @@ export function InstructionsTab({const systemInstructions = agent.system_instructions?.trim() ?? "";const hasSystemLayer = systemInstructions.length > 0;- // Sync when switching between agents.+ // Refetches replace nested arrays even when their contents are unchanged.+ // Compare against the last persisted semantic snapshot so those refetches+ // do not erase local edits. A real server change is adopted only when the+ // local form was clean; switching agents always loads the selected agent.useEffect(() => {- setValue(agent.instructions ?? "");- }, [agent.id, agent.instructions]);+ const previous = persistedRef.current;+ const switchingAgents = previous.agentId !== agent.id;++ // The parent publishes these fields optimistically while a save is in+ // flight. Neither that snapshot nor a later rollback is confirmed server+ // state, so keep the submitted values available for retry on failure.+ if (!switchingAgents && saving) return;++ const local = localRef.current;+ const wasLocallyDirty =+ local.instructions !== previous.instructions ||+ local.starterPromptsKey !== previous.starterPromptsKey;+ const persistedContentsChanged =+ previous.instructions !== (agent.instructions ?? "") ||+ previous.starterPromptsKey !== persistedStarterPromptsKey;++ persistedRef.current = {+ agentId: agent.id,+ instructions: agent.instructions ?? "",+ starterPromptsKey: persistedStarterPromptsKey,+ };+ if (switchingAgents || (!wasLocallyDirty && persistedContentsChanged)) {+ setValue(agent.instructions ?? "");+ setStarterPrompts(+ JSON.parse(persistedStarterPromptsKey) as AgentStarterPrompt[],+ );+ }+ }, [agent.id, agent.instructions, persistedStarterPromptsKey, saving]);// Report dirty state up so the parent can guard tab switches.useEffect(() => {@@ -42,7 +107,12 @@ export function InstructionsTab({const handleSave = async () => {setSaving(true);try {- await onSave(value);+ await onSave({+ instructions: value,+ ...(starterPromptsSupported+ ? { starter_prompts: starterPrompts }+ : {}),+ });} catch {// toast handled by parent} finally {@@ -112,14 +182,23 @@ export function InstructionsTab({/></div>+ {starterPromptsSupported ? (+ <StarterPromptsEditor+ value={starterPrompts}+ onChange={setStarterPrompts}+ />+ ) : null}+<div className="flex items-center justify-end gap-3">{isDirty && (- <span className="text-caption text-muted-foreground">{t(($) => $.tab_body.common.unsaved_changes)}</span>+ <span className="text-caption text-muted-foreground">+ {t(($) => $.tab_body.common.unsaved_changes)}+ </span>)}<Buttonsize="sm"onClick={handleSave}- disabled={!isDirty || saving}+ disabled={!isDirty || !starterPromptsValid || saving}>{saving ? (<Loader2diff --git a/packages/views/agents/create/agent-configuration-panel.tsx b/packages/views/agents/create/agent-configuration-panel.tsxindex a335ea9114..89f0b3a78a 100644--- a/packages/views/agents/create/agent-configuration-panel.tsx+++ b/packages/views/agents/create/agent-configuration-panel.tsx@@ -8,6 +8,7 @@ import {type AgentDraft,type AgentPermissionScope,} from "@multica/core/agents";+import { useConfigStore } from "@multica/core/config";import type { MemberWithUser, RuntimeDevice } from "@multica/core/types";import { Checkbox } from "@multica/ui/components/ui/checkbox";import { Input } from "@multica/ui/components/ui/input";@@ -26,6 +27,7 @@ import { ThinkingSettingField } from "../components/inspector/thinking-prop-row"import { ModelDropdown } from "../components/model-dropdown";import { RuntimePicker } from "../components/runtime-picker";import { SkillMultiSelect } from "../components/skill-multi-select";+import { StarterPromptsEditor } from "../components/starter-prompts-editor";const PERMISSION_SCOPES: AgentPermissionScope[] = ["private",@@ -66,6 +68,9 @@ export function AgentConfigurationPanel({runtimeSwitchInFlight?: boolean;}) {const { t } = useT("agents");+ const starterPromptsSupported = useConfigStore(+ (state) => state.agentStarterPromptsSupported,+ );const selectedRuntime =runtimes.find((runtime) => runtime.id === draft.runtimeId) ?? null;const set = <K extends keyof AgentDraft>(key: K, value: AgentDraft[K]) =>@@ -170,6 +175,14 @@ export function AgentConfigurationPanel({className="min-h-44 resize-y font-mono text-label leading-6"/></DraftFieldRow>+ {starterPromptsSupported ? (+ <div className="px-4 py-4">+ <StarterPromptsEditor+ value={draft.starterPrompts}+ onChange={(value) => set("starterPrompts", value)}+ />+ </div>+ ) : null}<div className="px-4 py-4"><SkillMultiSelectselectedIds={draft.skillIds}diff --git a/packages/views/agents/create/agent-execution-overrides.test.tsx b/packages/views/agents/create/agent-execution-overrides.test.tsxindex de4467946a..2b422129e5 100644--- a/packages/views/agents/create/agent-execution-overrides.test.tsx+++ b/packages/views/agents/create/agent-execution-overrides.test.tsx@@ -71,6 +71,7 @@ const baseDraft: AgentDraft = {name: "Fast Codex",description: "",instructions: "",+ starterPrompts: [],avatarUrl: null,runtimeId: "runtime-1",model: "gpt-5.6-sol",diff --git a/packages/views/agents/create/use-create-agent-form.ts b/packages/views/agents/create/use-create-agent-form.tsindex bf66a8d597..3684c5ac47 100644--- a/packages/views/agents/create/use-create-agent-form.ts+++ b/packages/views/agents/create/use-create-agent-form.ts@@ -11,6 +11,8 @@ import { useQuery } from "@tanstack/react-query";import {EMPTY_AGENT_DRAFT,isDraftDescriptionWithinLimit,+ AGENT_STARTER_PROMPT_LABEL_MAX_LENGTH,+ AGENT_STARTER_PROMPT_MAX_LENGTH,type AgentDraft,} from "@multica/core/agents";import { useAuthStore } from "@multica/core/auth";@@ -124,6 +126,14 @@ export function useCreateAgentForm(options?: {draft.memberIds.size === 0 &&draft.teamIds.size === 0;+ const starterPromptsInvalid = draft.starterPrompts.some(+ (item) =>+ item.label.trim().length === 0 ||+ item.prompt.trim().length === 0 ||+ [...item.label].length > AGENT_STARTER_PROMPT_LABEL_MAX_LENGTH ||+ [...item.prompt].length > AGENT_STARTER_PROMPT_MAX_LENGTH,+ );+return {draft,setDraft,@@ -139,6 +149,7 @@ export function useCreateAgentForm(options?: {selectedRuntime != null &&isRuntimeUsableForUser(selectedRuntime, currentUserId) &&isDraftDescriptionWithinLimit(draft.description) &&- !accessInvalid,+ !accessInvalid &&+ !starterPromptsInvalid,};}diff --git a/packages/views/chat/chat-page.tsx b/packages/views/chat/chat-page.tsxindex 940580d4e5..49b0261e22 100644--- a/packages/views/chat/chat-page.tsx+++ b/packages/views/chat/chat-page.tsx@@ -283,7 +283,11 @@ export function ChatPage() {quickActionsPendingMessageId={quickActionsPending?.message_id ?? null}/>) : (- <EmptyState agent={c.activeAgent} />+ <EmptyState+ agent={c.activeAgent}+ hasSessions={c.sessions.length > 0}+ onPickPrompt={c.prefillStarterPrompt}+ />)}{c.isAgentAccessRevoked ? (@@ -314,6 +318,8 @@ export function ChatPage() {<ChatInputonSend={c.handleSend}restoreDraftRequest={c.restoreDraftRequest}+ starterPromptRequest={c.starterPromptRequest}+ onStarterPromptApplied={c.handleStarterPromptApplied}onRestoreDraftApplied={c.handleRestoreDraftApplied}uploadEnabled={c.uploadEnabled && !c.isAgentAccessRevoked}onStop={c.handleStop}diff --git a/packages/views/chat/components/chat-empty-state.test.tsx b/packages/views/chat/components/chat-empty-state.test.tsxnew file mode 100644index 0000000000..8afe8059b1--- /dev/null+++ b/packages/views/chat/components/chat-empty-state.test.tsx@@ -0,0 +1,71 @@+// @vitest-environment jsdom++import { cleanup, fireEvent, render, screen } from "@testing-library/react";+import { afterEach, describe, expect, it, vi } from "vitest";+import { I18nProvider } from "@multica/core/i18n/react";+import type { Agent } from "@multica/core/types";+import enChat from "../../locales/en/chat.json";++vi.mock("../../common/actor-avatar", () => ({+ ActorAvatar: () => <div data-testid="agent-avatar" />,+}));++import { EmptyState } from "./chat-empty-state";++const agent = (starterPrompts: Agent["starter_prompts"] = []): Agent =>+ ({+ id: "agent-1",+ name: "Reviewer",+ description: "Reviews changes before they merge.",+ starter_prompts: starterPrompts,+ }) as Agent;++function renderEmptyState(value: Agent) {+ const onPickPrompt = vi.fn();+ render(+ <I18nProvider locale="en" resources={{ en: { chat: enChat } }}>+ <EmptyState+ agent={value}+ hasSessions={false}+ onPickPrompt={onPickPrompt}+ />+ </I18nProvider>,+ );+ return onPickPrompt;+}++describe("chat empty-state starter prompts", () => {+ afterEach(cleanup);++ it("prefers the selected agent's configured prompts", () => {+ const onPickPrompt = renderEmptyState(+ agent([+ {+ label: "Review the release PR",+ prompt: "Review the release PR and summarize its risks.",+ },+ ]),+ );++ fireEvent.click(+ screen.getByRole("button", { name: "Review the release PR" }),+ );++ expect(onPickPrompt).toHaveBeenCalledWith(+ "Review the release PR and summarize its risks.",+ );+ expect(screen.queryByText("What can you help with?")).toBeNull();+ });++ it("shows localized fallbacks for agents without configuration", () => {+ const onPickPrompt = renderEmptyState(agent());++ fireEvent.click(+ screen.getByRole("button", { name: "Suggest a first task" }),+ );++ expect(onPickPrompt).toHaveBeenCalledWith(+ "Suggest three useful tasks I could delegate to you.",+ );+ });+});diff --git a/packages/views/chat/components/chat-empty-state.tsx b/packages/views/chat/components/chat-empty-state.tsxindex 4c70ccd9b5..5d3c8a2375 100644--- a/packages/views/chat/components/chat-empty-state.tsx+++ b/packages/views/chat/components/chat-empty-state.tsx@@ -1,16 +1,44 @@"use client";-import type { Agent } from "@multica/core/types";+import type { Agent, AgentStarterPrompt } from "@multica/core/types";import { ActorAvatar } from "../../common/actor-avatar";import { useT } from "../../i18n";/** Empty compose placeholder shown before the first user message. */-export function EmptyState({ agent }: { agent: Agent | null }) {+export function EmptyState({+ agent,+ hasSessions = true,+ onPickPrompt,+}: {+ agent: Agent | null;+ hasSessions?: boolean;+ onPickPrompt: (prompt: string) => void;+}) {const { t } = useT("chat");const description = agent?.description?.trim();+ const fallbackPrompts: AgentStarterPrompt[] = [+ {+ label: t(($) => $.starter_prompts.capabilities.label),+ prompt: t(($) => $.starter_prompts.capabilities.prompt),+ },+ {+ label: t(($) => $.starter_prompts.first_task.label),+ prompt: t(($) => $.starter_prompts.first_task.prompt),+ },+ {+ label: t(($) => $.starter_prompts.recommend.label),+ prompt: t(($) => $.starter_prompts.recommend.prompt),+ },+ ];+ const configuredPrompts = (agent?.starter_prompts ?? []).filter(+ (item) => item.label.trim() && item.prompt.trim(),+ );+ const prompts =+ configuredPrompts.length > 0 ? configuredPrompts : fallbackPrompts;+return (- <div className="flex flex-1 flex-col items-center justify-center gap-4 px-6 py-8">+ <div className="flex min-h-0 flex-1 flex-col items-center justify-center-safe gap-5 overflow-y-auto px-6 py-8">{agent && (<ActorAvataractorType="agent"@@ -28,7 +56,29 @@ export function EmptyState({ agent }: { agent: Agent | null }) {{description && (<p className="text-body text-muted-foreground">{description}</p>)}+ {!hasSessions && (+ <p className="text-body text-muted-foreground">+ {t(($) => $.empty_state.first_time_actions)}+ </p>+ )}</div>+ {agent ? (+ <div+ className="w-full max-w-sm space-y-2"+ aria-label={t(($) => $.starter_prompts.aria_label)}+ >+ {prompts.map((item, index) => (+ <button+ key={index}+ type="button"+ onClick={() => onPickPrompt(item.prompt)}+ className="w-full rounded-lg border border-border bg-card px-3 py-2.5 text-left text-body text-foreground transition-colors hover:border-brand/40 hover:bg-accent"+ >+ {item.label}+ </button>+ ))}+ </div>+ ) : null}</div>);}diff --git a/packages/views/chat/components/chat-input.test.tsx b/packages/views/chat/components/chat-input.test.tsxindex 4c104b530c..766ef00f01 100644--- a/packages/views/chat/components/chat-input.test.tsx+++ b/packages/views/chat/components/chat-input.test.tsx@@ -61,7 +61,12 @@ const editorProps = vi.hoisted(() => ({}));// Records imperative editor calls so tests can assert whether a commit// scrubbed the editor (clearEditor) or left it intact (fire-and-forget).-const editorState = vi.hoisted(() => ({ cleared: 0, blurred: 0, focused: 0 }));+const editorState = vi.hoisted(() => ({+ cleared: 0,+ blurred: 0,+ focused: 0,+ adopted: [] as string[],+}));vi.mock("../../editor", async () => ({// Real submit gate (pure React) driven by the mock editor's@@ -163,6 +168,7 @@ vi.mock("../../editor", async () => ({// Same file: the upload-pinned adopt path needs the real Guard 0, which// this mock has no concept of. Kept so the ref honours the full contract.adoptContent: (markdown: string) => {+ editorState.adopted.push(markdown);valueRef.current = markdown;},}));@@ -248,6 +254,7 @@ beforeEach(() => {editorState.cleared = 0;editorState.blurred = 0;editorState.focused = 0;+ editorState.adopted = [];const state = useChatStore.getState() as unknown as {activeSessionId: string | null;selectedAgentId: string;@@ -494,6 +501,45 @@ describe("ChatInput focusRequest", () => {});});+describe("ChatInput starter prompt prefill", () => {+ it("replaces live editor text and the stored draft", () => {+ const onStarterPromptApplied = vi.fn();+ const { rerender } = renderInput();++ fireEvent.change(screen.getByTestId("editor"), {+ target: { value: "unfinished local text" },+ });+ rerender(+ element({+ starterPromptRequest: {+ id: 1,+ content: "Review the release pull request.",+ },+ onStarterPromptApplied,+ }),+ );++ expect(useChatStore.getState().setInputDraft).toHaveBeenLastCalledWith(+ "__draft_new__",+ "Review the release pull request.",+ );+ expect(editorState.adopted).toEqual(["Review the release pull request."]);+ expect(onStarterPromptApplied).toHaveBeenCalledTimes(1);+ });++ it("applies each request only once", () => {+ const request = {+ id: 1,+ content: "Review the release pull request.",+ };+ const { rerender } = renderInput({ starterPromptRequest: request });++ rerender(element({ starterPromptRequest: request }));++ expect(editorState.adopted).toEqual([request.content]);+ });+});+describe("ChatInput @ context wiring", () => {it("configures chat @ with current/recent issue/project context", () => {const contextItems = [diff --git a/packages/views/chat/components/chat-input.tsx b/packages/views/chat/components/chat-input.tsxindex d261fac2bc..ad0e867960 100644--- a/packages/views/chat/components/chat-input.tsx+++ b/packages/views/chat/components/chat-input.tsx@@ -73,6 +73,15 @@ interface ChatInputProps {*/sessionId?: string;} | null;+ /** Explicit replacement requested by a starter-prompt button. Unlike a+ * synchronized draft write, this may intentionally replace dirty editor+ * content, so ChatInput adopts it after cancelling any pending debounce. */+ starterPromptRequest?: {+ id: number;+ content: string;+ } | null;+ /** Fired after the request has replaced both the stored and live draft. */+ onStarterPromptApplied?: () => void;/*** Fired when — and only when — the restore's content/attachments were written* into the draft. A restore the composer cannot apply yet (the user has work@@ -140,6 +149,8 @@ interface ChatInputProps {export function ChatInput({onSend,restoreDraftRequest,+ starterPromptRequest,+ onStarterPromptApplied,onRestoreDraftApplied,uploadEnabled: uploadAllowed,onStop,@@ -217,6 +228,7 @@ export function ChatInput({// reads the live editor and bails when it is empty.const hasNothingToSend = isEmpty && !inputDraft.trim();const appliedRestoreIdRef = useRef<string | null>(null);+ const appliedStarterPromptIdRef = useRef<number | null>(null);const editorKey = editorKeyOverride ?? CHAT_COMPOSER_EDITOR_KEY;// The draft whose document the editor instance is currently HOLDING.@@ -365,6 +377,32 @@ export function ChatInput({editorRef.current?.focus();}, [focusRequest]);+ // A starter-prompt click is an explicit replacement, not an ordinary+ // external store sync. ContentEditor deliberately rejects external values+ // while it has dirty local text, so adopting here prevents the old text's+ // pending debounce from winning the race and overwriting the chosen prompt.+ // Wait out active uploads: adopting content while an upload node is present+ // would strand its completion callback.+ useLayoutEffect(() => {+ if (!starterPromptRequest) return;+ if (appliedStarterPromptIdRef.current === starterPromptRequest.id) return;+ if (editorDraftKeyRef.current !== draftKey) return;+ if (editorRef.current?.hasActiveUploads() === true) return;++ editorRef.current?.flushPendingUpdate();+ appliedStarterPromptIdRef.current = starterPromptRequest.id;+ commitDraft(draftKey, starterPromptRequest.content);+ editorRef.current?.adoptContent(starterPromptRequest.content);+ setIsEmpty(!starterPromptRequest.content.trim());+ onStarterPromptApplied?.();+ }, [+ commitDraft,+ draftKey,+ onStarterPromptApplied,+ starterPromptRequest,+ uploadGate.uploading,+ ]);+useEffect(() => {if (!restoreDraftRequest) {appliedRestoreIdRef.current = null;diff --git a/packages/views/chat/components/chat-window.tsx b/packages/views/chat/components/chat-window.tsxindex 4b9f25907e..c45859a50d 100644--- a/packages/views/chat/components/chat-window.tsx+++ b/packages/views/chat/components/chat-window.tsx@@ -72,6 +72,7 @@ import { useChatInputFocus } from "./use-chat-input-focus";import { ChatMessageList, ChatMessageSkeleton } from "./chat-message-list";import { ChatInput } from "./chat-input";import { ChatQueue } from "./chat-queue";+import { EmptyState } from "./chat-empty-state";import { SessionRenameInput } from "./session-rename-input";import { ChatResizeHandles } from "./chat-resize-handles";import { useChatContextItems } from "./use-chat-context-items";@@ -187,6 +188,25 @@ export function ChatWindow() {// Nonce handed to ChatInput to pull focus into the compose box: when a new// chat starts (⊕ or switching agent), and whenever the window itself opens.const { focusRequest, requestInputFocus } = useChatInputFocus(isOpen);+ const [starterPromptRequest, setStarterPromptRequest] = useState<{+ id: number;+ content: string;+ } | null>(null);+ const nextStarterPromptRequestIdRef = useRef(0);+ const prefillStarterPrompt = useCallback(+ (prompt: string) => {+ setStarterPromptRequest({+ id: ++nextStarterPromptRequestIdRef.current,+ content: prompt,+ });+ requestInputFocus();+ },+ [requestInputFocus],+ );+ const handleStarterPromptApplied = useCallback(+ () => setStarterPromptRequest(null),+ [],+ );// Legacy archived sessions (the old soft-archive feature was removed but// pre-existing rows with status='archived' may still exist) are excluded@@ -918,9 +938,9 @@ export function ChatWindow() {/>) : (<EmptyState+ agent={activeAgent}hasSessions={sessions.length > 0}- agentName={activeAgent?.name}- onPickPrompt={(text) => handleSend(text)}+ onPickPrompt={prefillStarterPrompt}/>)}@@ -964,6 +984,8 @@ export function ChatWindow() {<ChatInputonSend={handleSend}restoreDraftRequest={restoreDraftRequest}+ starterPromptRequest={starterPromptRequest}+ onStarterPromptApplied={handleStarterPromptApplied}onRestoreDraftApplied={handleRestoreDraftApplied}uploadEnabled={!!activeAgent && !isAgentAccessRevoked}onStop={handleStop}@@ -1623,85 +1645,3 @@ function useFormatTimeAgo(): (dateStr: string) => string {return date.toLocaleDateString();};}--// Three starter prompts shown on the empty state. Each is keyed into the-// chat namespace so labels translate per locale; the icon stays raw since-// emojis are locale-neutral.-const STARTER_KEYS: ("list_open" | "summarize_today" | "plan_next")[] = [- "list_open",- "summarize_today",- "plan_next",-];-const STARTER_ICONS: Record<(typeof STARTER_KEYS)[number], string> = {- list_open: "📋",- summarize_today: "📝",- plan_next: "💡",-};--function EmptyState({- hasSessions,- agentName,- onPickPrompt,-}: {- hasSessions: boolean;- agentName?: string;- onPickPrompt: (text: string) => void;-}) {- const { t } = useT("chat");- // First-time experience: the user has never started a chat in this- // workspace. Educate before suggesting actions — starter prompts- // presume the user already knows what chat is for.- if (!hasSessions) {- return (- <div className="flex min-h-0 flex-1 flex-col items-center justify-center-safe gap-3 overflow-y-auto px-6 py-8">- <div className="text-center space-y-3">- <h3 className="text-title-sm font-semibold">- {t(($) => $.empty_state.first_time_title)}- </h3>- <p className="text-body text-muted-foreground">- {t(($) => $.empty_state.first_time_intro)}{" "}- <span className="font-medium text-foreground">- {t(($) => $.empty_state.first_time_pillars)}- </span>- {t(($) => $.empty_state.first_time_pillars_suffix)}- </p>- <p className="text-body text-muted-foreground">- {t(($) => $.empty_state.first_time_actions)}- </p>- </div>- </div>- );- }-- // Returning user: starter prompts are the fastest path back to action.- return (- <div className="flex min-h-0 flex-1 flex-col items-center justify-center-safe gap-5 overflow-y-auto px-6 py-8">- <div className="text-center space-y-1">- <h3 className="text-title-sm font-semibold">- {agentName- ? t(($) => $.empty_state.returning_title_named, { name: agentName })- : t(($) => $.empty_state.returning_title_default)}- </h3>- <p className="text-body text-muted-foreground">- {t(($) => $.empty_state.returning_subtitle)}- </p>- </div>- <div className="w-full max-w-xs space-y-2">- {STARTER_KEYS.map((key) => {- const text = t(($) => $.starter_prompts[key]);- return (- <button- key={key}- type="button"- onClick={() => onPickPrompt(text)}- className="w-full rounded-lg border border-border bg-card px-3 py-2 text-left text-body text-foreground transition-colors hover:bg-accent hover:border-brand/40"- >- <span className="mr-2">{STARTER_ICONS[key]}</span>- {text}- </button>- );- })}- </div>- </div>- );-}diff --git a/packages/views/chat/components/use-chat-controller.ts b/packages/views/chat/components/use-chat-controller.tsindex 09b2d73b77..95deab6423 100644--- a/packages/views/chat/components/use-chat-controller.ts+++ b/packages/views/chat/components/use-chat-controller.ts@@ -277,6 +277,25 @@ export function useChatController(opts?: { isActive?: boolean }) {() => setFocusInputRequest((n) => n + 1),[],);+ const [starterPromptRequest, setStarterPromptRequest] = useState<{+ id: number;+ content: string;+ } | null>(null);+ const nextStarterPromptRequestIdRef = useRef(0);+ const prefillStarterPrompt = useCallback(+ (prompt: string) => {+ setStarterPromptRequest({+ id: ++nextStarterPromptRequestIdRef.current,+ content: prompt,+ });+ requestInputFocus();+ },+ [requestInputFocus],+ );+ const handleStarterPromptApplied = useCallback(+ () => setStarterPromptRequest(null),+ [],+ );const currentSession = activeSessionId? sessions.find((s) => s.id === activeSessionId)@@ -832,6 +851,9 @@ export function useChatController(opts?: { isActive?: boolean }) {handleRestoreDraftApplied,// compose-box focus nonce (bumped on new chat)focusInputRequest,+ starterPromptRequest,+ handleStarterPromptApplied,+ prefillStarterPrompt,// actionshandleSend,handleStop,diff --git a/packages/views/locales/en/agents.json b/packages/views/locales/en/agents.jsonindex 53e99b1ec2..f4c44c0b46 100644--- a/packages/views/locales/en/agents.json+++ b/packages/views/locales/en/agents.json@@ -444,6 +444,17 @@"upload_failed_toast": "Avatar upload failed"}},+ "starter_prompts": {+ "label": "Suggested first actions",+ "hint": "Add up to three examples that show people how to start with this agent. Selecting one fills the composer without sending it.",+ "add": "Add suggestion",+ "item_label": "Suggestion {{number}} label",+ "prompt_label": "Suggestion {{number}} prompt",+ "label_placeholder": "Review a pull request",+ "prompt_placeholder": "Review the open pull request, summarize the risks, and recommend next steps.",+ "incomplete": "Complete or remove each suggestion before saving.",+ "remove": "Remove suggestion {{number}}"+ },"tab_body": {"common": {"save": "Save",diff --git a/packages/views/locales/en/chat.json b/packages/views/locales/en/chat.jsonindex 45c1c8a1ae..cc9b372047 100644--- a/packages/views/locales/en/chat.json+++ b/packages/views/locales/en/chat.json@@ -151,9 +151,19 @@"chat_with_named": "Chat with {{name}}"},"starter_prompts": {- "list_open": "List my open tasks by priority",- "summarize_today": "Summarize what I did today",- "plan_next": "Plan what to work on next"+ "aria_label": "Suggested first actions",+ "capabilities": {+ "label": "What can you help with?",+ "prompt": "What are you best at helping with? Give me a concise overview."+ },+ "first_task": {+ "label": "Suggest a first task",+ "prompt": "Suggest three useful tasks I could delegate to you."+ },+ "recommend": {+ "label": "Recommend an action",+ "prompt": "Review what you know about my workspace and recommend a useful first action."+ }},"onboarding_cards": {"aria_label": "Ways to start",diff --git a/packages/views/locales/ja/agents.json b/packages/views/locales/ja/agents.jsonindex e033052288..96f8ebf92b 100644--- a/packages/views/locales/ja/agents.json+++ b/packages/views/locales/ja/agents.json@@ -327,6 +327,17 @@"upload_failed_toast": "アバターのアップロードに失敗しました"}},+ "starter_prompts": {+ "label": "おすすめの最初のアクション",+ "hint": "このエージェントの使い始め方が伝わる例を3件まで追加できます。選ぶと送信せずに入力欄へ入ります。",+ "add": "候補を追加",+ "item_label": "候補 {{number}} のラベル",+ "prompt_label": "候補 {{number}} のプロンプト",+ "label_placeholder": "プルリクエストをレビュー",+ "prompt_placeholder": "開いているプルリクエストをレビューし、リスクと次の手順をまとめてください。",+ "incomplete": "各候補を完成させるか削除してから保存してください。",+ "remove": "候補 {{number}} を削除"+ },"tab_body": {"common": {"save": "保存",diff --git a/packages/views/locales/ja/chat.json b/packages/views/locales/ja/chat.jsonindex 63b061c64e..6eaca37217 100644--- a/packages/views/locales/ja/chat.json+++ b/packages/views/locales/ja/chat.json@@ -147,9 +147,19 @@"chat_with_named": "{{name}} とチャット"},"starter_prompts": {- "list_open": "オープンなタスクを優先度順にまとめて",- "summarize_today": "今日やったことを要約して",- "plan_next": "次に取り組むことを計画して"+ "aria_label": "おすすめの最初のアクション",+ "capabilities": {+ "label": "何を手伝えますか?",+ "prompt": "あなたが得意な支援を簡潔に教えてください。"+ },+ "first_task": {+ "label": "最初のタスクを提案",+ "prompt": "あなたに任せられる実用的なタスクを3つ提案してください。"+ },+ "recommend": {+ "label": "アクションを提案",+ "prompt": "私のワークスペースについて知っていることを踏まえ、最初に役立つアクションを提案してください。"+ }},"onboarding_cards": {"aria_label": "はじめ方",diff --git a/packages/views/locales/ko/agents.json b/packages/views/locales/ko/agents.jsonindex cf5a6003bc..27e33f4311 100644--- a/packages/views/locales/ko/agents.json+++ b/packages/views/locales/ko/agents.json@@ -335,6 +335,17 @@"upload_failed_toast": "아바타 업로드 실패"}},+ "starter_prompts": {+ "label": "추천 첫 작업",+ "hint": "이 에이전트를 어떻게 시작할지 보여주는 예시를 최대 3개 추가하세요. 선택하면 전송하지 않고 입력창에 채웁니다.",+ "add": "추천 추가",+ "item_label": "추천 {{number}} 라벨",+ "prompt_label": "추천 {{number}} 프롬프트",+ "label_placeholder": "풀 리퀘스트 리뷰",+ "prompt_placeholder": "열린 풀 리퀘스트를 리뷰하고 위험과 다음 단계를 요약해 주세요.",+ "incomplete": "각 제안을 완성하거나 삭제한 후 저장하세요.",+ "remove": "추천 {{number}} 삭제"+ },"tab_body": {"common": {"save": "저장",diff --git a/packages/views/locales/ko/chat.json b/packages/views/locales/ko/chat.jsonindex d6a9de73f8..f1e3e483fc 100644--- a/packages/views/locales/ko/chat.json+++ b/packages/views/locales/ko/chat.json@@ -147,9 +147,19 @@"chat_with_named": "{{name}}와 채팅"},"starter_prompts": {- "list_open": "열린 태스크를 우선순위별로 정리해 줘",- "summarize_today": "오늘 내가 한 일을 요약해 줘",- "plan_next": "다음에 할 일을 계획해 줘"+ "aria_label": "추천 첫 작업",+ "capabilities": {+ "label": "어떤 일을 도와줄 수 있나요?",+ "prompt": "가장 잘 도울 수 있는 일을 간단히 알려 주세요."+ },+ "first_task": {+ "label": "첫 태스크 추천",+ "prompt": "당신에게 맡길 수 있는 유용한 태스크 세 가지를 추천해 주세요."+ },+ "recommend": {+ "label": "작업 추천",+ "prompt": "내 워크스페이스에 대해 알고 있는 내용을 바탕으로 유용한 첫 작업을 추천해 주세요."+ }},"onboarding_cards": {"aria_label": "시작 방법",diff --git a/packages/views/locales/zh-Hans/agents.json b/packages/views/locales/zh-Hans/agents.jsonindex 5b6351827b..7c79e4a5d9 100644--- a/packages/views/locales/zh-Hans/agents.json+++ b/packages/views/locales/zh-Hans/agents.json@@ -434,6 +434,17 @@"upload_failed_toast": "头像上传失败"}},+ "starter_prompts": {+ "label": "推荐的初始操作",+ "hint": "最多添加三个示例,帮助用户开始使用此智能体。选择后只会填入输入框,不会立即发送。",+ "add": "添加建议",+ "item_label": "建议 {{number}} 的标题",+ "prompt_label": "建议 {{number}} 的提示词",+ "label_placeholder": "审查拉取请求",+ "prompt_placeholder": "审查当前拉取请求,总结风险并建议下一步。",+ "incomplete": "请填写完整或移除每条建议后再保存。",+ "remove": "移除建议 {{number}}"+ },"tab_body": {"common": {"save": "保存",diff --git a/packages/views/locales/zh-Hans/chat.json b/packages/views/locales/zh-Hans/chat.jsonindex 398cfcc789..ec03263429 100644--- a/packages/views/locales/zh-Hans/chat.json+++ b/packages/views/locales/zh-Hans/chat.json@@ -147,9 +147,19 @@"chat_with_named": "与 {{name}} 对话"},"starter_prompts": {- "list_open": "按优先级列出我未完成的任务",- "summarize_today": "总结一下我今天做了什么",- "plan_next": "规划接下来该做什么"+ "aria_label": "推荐的初始操作",+ "capabilities": {+ "label": "你能帮我做什么?",+ "prompt": "你最擅长帮我做什么?请简要介绍。"+ },+ "first_task": {+ "label": "建议第一个任务",+ "prompt": "建议三个适合交给你的实用任务。"+ },+ "recommend": {+ "label": "推荐一个操作",+ "prompt": "根据你对我的工作区的了解,推荐一个有用的初始操作。"+ }},"onboarding_cards": {"aria_label": "开始方式",diff --git a/server/cmd/multica/cmd_agent_copy.go b/server/cmd/multica/cmd_agent_copy.goindex d84fe2ad1d..d5623267a5 100644--- a/server/cmd/multica/cmd_agent_copy.go+++ b/server/cmd/multica/cmd_agent_copy.go@@ -28,6 +28,8 @@ var agentCopyCmd = &cobra.Command{The source agent is left untouched. By default the copy lands on the sameruntime as the source; pass --runtime-id to fork it onto a different runtime.+Copied by default without a dedicated override flag: starter prompts.+Copied by default, each overridable with the matching flag: name (suffixed" (copy)"), description, instructions, avatar, custom_args, max_concurrent_tasks,invocation permission (permission_mode + allow-list), assigned workspace skills,@@ -150,6 +152,9 @@ func runAgentCopy(cmd *cobra.Command, args []string) error {v, _ := cmd.Flags().GetString("instructions")body["instructions"] = v}+ if starterPrompts, ok := src["starter_prompts"].([]any); ok {+ body["starter_prompts"] = starterPrompts+ }// Avatar reference travels with the copy (both agents point at the same// uploaded image URL), matching the web Duplicate flow.diff --git a/server/cmd/multica/cmd_agent_copy_test.go b/server/cmd/multica/cmd_agent_copy_test.goindex 727fa042b1..e36a1e7846 100644--- a/server/cmd/multica/cmd_agent_copy_test.go+++ b/server/cmd/multica/cmd_agent_copy_test.go@@ -26,11 +26,14 @@ func newAgentCopyTestCmd() *cobra.Command {// portable field populated, so copy tests can assert the whole whitelist.func fullSourceAgent() map[string]any {return map[string]any{- "id": "agent-src",- "name": "Src",- "runtime_id": "runtime-1",- "description": "a description",- "instructions": "some instructions",+ "id": "agent-src",+ "name": "Src",+ "runtime_id": "runtime-1",+ "description": "a description",+ "instructions": "some instructions",+ "starter_prompts": []any{+ map[string]any{"label": "Review a PR", "prompt": "Review the open pull request."},+ },"avatar_url": "https://img.example/a.png","custom_args": []any{"--foo", "--bar"},"max_concurrent_tasks": 9,@@ -110,6 +113,11 @@ func TestAgentCopySameRuntimeCopiesPortableFields(t *testing.T) {if gotBody["instructions"] != "some instructions" {t.Errorf("instructions = %v", gotBody["instructions"])}+ if !reflect.DeepEqual(gotBody["starter_prompts"], []any{+ map[string]any{"label": "Review a PR", "prompt": "Review the open pull request."},+ }) {+ t.Errorf("starter_prompts = %v", gotBody["starter_prompts"])+ }if gotBody["avatar_url"] != "https://img.example/a.png" {t.Errorf("avatar_url = %v", gotBody["avatar_url"])}diff --git a/server/internal/handler/agent.go b/server/internal/handler/agent.goindex 2ff161242c..07c3a16e32 100644--- a/server/internal/handler/agent.go+++ b/server/internal/handler/agent.go@@ -35,6 +35,17 @@ import (// char_length and the front-end's String.prototype.length-with-counter UX.const maxAgentDescriptionLength = 255+const (+ maxAgentStarterPrompts = 3+ maxAgentStarterPromptLabel = 80+ maxAgentStarterPromptLength = 4000+)++type AgentStarterPrompt struct {+ Label string `json:"label"`+ Prompt string `json:"prompt"`+}+type AgentResponse struct {ID string `json:"id"`WorkspaceID string `json:"workspace_id"`@@ -54,6 +65,9 @@ type AgentResponse struct {// holds only the workspace's own notes — the product half lives in// SystemInstructions and is never stored on the row.Instructions string `json:"instructions"`+ // StarterPrompts are optional, agent-specific first-turn suggestions. An+ // empty list tells clients to render their localized fallback prompts.+ StarterPrompts []AgentStarterPrompt `json:"starter_prompts"`// SystemKey identifies a product-defined agent (e.g. "mika"). Empty for// every user- or template-created agent. The UI keys "this is maintained// by Multica" off this rather than off the display name, which owners may@@ -167,6 +181,14 @@ func (h *Handler) agentToResponse(a db.Agent) AgentResponse {mcpConfig = json.RawMessage(a.McpConfig)}+ starterPrompts := []AgentStarterPrompt{}+ if len(a.StarterPrompts) > 0 {+ if err := json.Unmarshal(a.StarterPrompts, &starterPrompts); err != nil {+ slog.Warn("failed to unmarshal agent starter_prompts", "agent_id", uuidToString(a.ID), "error", err)+ starterPrompts = []AgentStarterPrompt{}+ }+ }+// composio_toolkit_allowlist: the column is stored as TEXT[] and arrives// here as a []string (sqlc). NULL and `{}` both serialize as nil through// the postgres driver — both correctly mean "no toolkits", but the API@@ -184,6 +206,7 @@ func (h *Handler) agentToResponse(a db.Agent) AgentResponse {Name: a.Name,Description: a.Description,Instructions: a.Instructions,+ StarterPrompts: starterPrompts,SystemKey: a.SystemKey.String,SystemInstructions: systemInstructionsFor(a),AvatarURL: h.resolveAvatarURLPtr(textToPtr(a.AvatarUrl)),@@ -1081,16 +1104,17 @@ func (h *Handler) GetAgent(w http.ResponseWriter, r *http.Request) {}type CreateAgentRequest struct {- Name string `json:"name"`- Description string `json:"description"`- Instructions string `json:"instructions"`- AvatarURL *string `json:"avatar_url"`- RuntimeID string `json:"runtime_id"`- RuntimeConfig any `json:"runtime_config"`- CustomEnv map[string]string `json:"custom_env"`- CustomArgs []string `json:"custom_args"`- McpConfig json.RawMessage `json:"mcp_config"`- Visibility string `json:"visibility"`+ Name string `json:"name"`+ Description string `json:"description"`+ Instructions string `json:"instructions"`+ StarterPrompts []AgentStarterPrompt `json:"starter_prompts"`+ AvatarURL *string `json:"avatar_url"`+ RuntimeID string `json:"runtime_id"`+ RuntimeConfig any `json:"runtime_config"`+ CustomEnv map[string]string `json:"custom_env"`+ CustomArgs []string `json:"custom_args"`+ McpConfig json.RawMessage `json:"mcp_config"`+ Visibility string `json:"visibility"`// PermissionMode + InvocationTargets are the new invocation-permission// inputs (MUL-3963). When permission_mode is present it is authoritative// and Visibility is ignored; when absent, legacy Visibility is mapped@@ -1139,6 +1163,32 @@ func decodeJSONBodyWithRawFields(body io.Reader, dst any) (map[string]json.RawMereturn raw, nil}+func normaliseAgentStarterPrompts(prompts []AgentStarterPrompt) ([]AgentStarterPrompt, error) {+ if len(prompts) > maxAgentStarterPrompts {+ return nil, fmt.Errorf("starter_prompts must contain at most %d items", maxAgentStarterPrompts)+ }++ normalised := make([]AgentStarterPrompt, 0, len(prompts))+ for i, item := range prompts {+ item.Label = strings.TrimSpace(item.Label)+ item.Prompt = strings.TrimSpace(item.Prompt)+ if item.Label == "" {+ return nil, fmt.Errorf("starter_prompts[%d].label is required", i)+ }+ if item.Prompt == "" {+ return nil, fmt.Errorf("starter_prompts[%d].prompt is required", i)+ }+ if utf8.RuneCountInString(item.Label) > maxAgentStarterPromptLabel {+ return nil, fmt.Errorf("starter_prompts[%d].label must be %d characters or fewer", i, maxAgentStarterPromptLabel)+ }+ if utf8.RuneCountInString(item.Prompt) > maxAgentStarterPromptLength {+ return nil, fmt.Errorf("starter_prompts[%d].prompt must be %d characters or fewer", i, maxAgentStarterPromptLength)+ }+ normalised = append(normalised, item)+ }+ return normalised, nil+}+func (h *Handler) CreateAgent(w http.ResponseWriter, r *http.Request) {workspaceID := h.resolveWorkspaceID(r)@@ -1166,6 +1216,11 @@ func (h *Handler) CreateAgent(w http.ResponseWriter, r *http.Request) {writeError(w, http.StatusBadRequest, "runtime_id is required")return}+ starterPrompts, err := normaliseAgentStarterPrompts(req.StarterPrompts)+ if err != nil {+ writeError(w, http.StatusBadRequest, err.Error())+ return+ }if req.Visibility == "" {req.Visibility = "private"}@@ -1268,6 +1323,8 @@ func (h *Handler) CreateAgent(w http.ResponseWriter, r *http.Request) {ca = []byte("[]")}+ sp, _ := json.Marshal(starterPrompts)+var mc []byteif rawMcpConfig, ok := rawFields["mcp_config"]; ok && !bytes.Equal(bytes.TrimSpace(rawMcpConfig), []byte("null")) {mc = append([]byte(nil), rawMcpConfig...)@@ -1330,6 +1387,7 @@ func (h *Handler) CreateAgent(w http.ResponseWriter, r *http.Request) {Model: pgtype.Text{String: req.Model, Valid: req.Model != ""},ThinkingLevel: pgtype.Text{String: req.ThinkingLevel, Valid: req.ThinkingLevel != ""},ServiceTier: pgtype.Text{String: req.ServiceTier, Valid: req.ServiceTier != ""},+ StarterPrompts: sp,ComposioToolkitAllowlist: allowlist,})if err != nil {@@ -1396,12 +1454,13 @@ func (h *Handler) CreateAgent(w http.ResponseWriter, r *http.Request) {}type UpdateAgentRequest struct {- Name *string `json:"name"`- Description *string `json:"description"`- Instructions *string `json:"instructions"`- AvatarURL *string `json:"avatar_url"`- RuntimeID *string `json:"runtime_id"`- RuntimeConfig any `json:"runtime_config"`+ Name *string `json:"name"`+ Description *string `json:"description"`+ Instructions *string `json:"instructions"`+ StarterPrompts *[]AgentStarterPrompt `json:"starter_prompts"`+ AvatarURL *string `json:"avatar_url"`+ RuntimeID *string `json:"runtime_id"`+ RuntimeConfig any `json:"runtime_config"`// custom_env is intentionally NOT updatable through this endpoint.// Use `PUT /api/agents/{id}/env` for env changes — that path admits// the agent owner or a workspace owner/admin, denies agent actors,@@ -1666,6 +1725,15 @@ func (h *Handler) UpdateAgent(w http.ResponseWriter, r *http.Request) {if req.Instructions != nil {params.Instructions = pgtype.Text{String: *req.Instructions, Valid: true}}+ if req.StarterPrompts != nil {+ starterPrompts, err := normaliseAgentStarterPrompts(*req.StarterPrompts)+ if err != nil {+ writeError(w, http.StatusBadRequest, err.Error())+ return+ }+ encoded, _ := json.Marshal(starterPrompts)+ params.StarterPrompts = encoded+ }if req.AvatarURL != nil {avatarURL, ok := h.acceptAvatarURL(w, r, *req.AvatarURL, existing.AvatarUrl.String)if !ok {diff --git a/server/internal/handler/agent_builder.go b/server/internal/handler/agent_builder.goindex 3cb1351d26..3547df3f33 100644--- a/server/internal/handler/agent_builder.go+++ b/server/internal/handler/agent_builder.go@@ -21,7 +21,7 @@ const agentBuilderInstructions = `You are Multica Agent Builder. Help the user dYour job is to propose and refine configuration, never to create resources yourself. Ask only questions that materially change behavior. Prefer making a reasonable draft immediately, then ask at most two focused questions per turn.Every response MUST end with exactly one <agent_draft> JSON block using this shape:-<agent_draft>{"name":"","description":"","instructions":"","model":"","skill_ids":[],"permission_scope":"private","member_ids":[]}</agent_draft>+<agent_draft>{"name":"","description":"","instructions":"","starter_prompts":[],"model":"","skill_ids":[],"permission_scope":"private","member_ids":[]}</agent_draft>Rules:- The JSON must be valid, compact JSON on one physical line. Do not wrap it in Markdown fences.@@ -30,6 +30,7 @@ Rules:- name is concise and suitable for a workspace list.- description is one sentence, at most 200 characters.- instructions are a complete Markdown system prompt describing role, workflow, output, and constraints.+- starter_prompts contains up to three objects with a concise label and a complete prompt. Each should demonstrate a useful first task for this specific agent; never include generic filler.- model must be empty, preserve current_draft.model, or exactly match an id explicitly listed in AVAILABLE RUNTIME MODELS. Never use a model label as the id.- When AVAILABLE RUNTIME MODELS is null or empty, preserve current_draft.model and never invent a model id.- skill_ids may only contain IDs explicitly listed in AVAILABLE WORKSPACE SKILLS.diff --git a/server/internal/handler/agent_starter_prompts_test.go b/server/internal/handler/agent_starter_prompts_test.gonew file mode 100644index 0000000000..0b2fea2c47--- /dev/null+++ b/server/internal/handler/agent_starter_prompts_test.go@@ -0,0 +1,92 @@+package handler++import (+ "fmt"+ "net/http"+ "strings"+ "testing"+ "time"++ "github.com/multica-ai/multica/server/internal/testutil"+)++func TestNormaliseAgentStarterPrompts(t *testing.T) {+ t.Run("trims complete prompts", func(t *testing.T) {+ got, err := normaliseAgentStarterPrompts([]AgentStarterPrompt{{+ Label: " Review a PR ",+ Prompt: " Review the open pull request. ",+ }})+ if err != nil {+ t.Fatalf("normaliseAgentStarterPrompts() error = %v", err)+ }+ want := []AgentStarterPrompt{{Label: "Review a PR", Prompt: "Review the open pull request."}}+ if len(got) != 1 || got[0] != want[0] {+ t.Fatalf("normaliseAgentStarterPrompts() = %#v, want %#v", got, want)+ }+ })++ for name, prompts := range map[string][]AgentStarterPrompt{+ "too many": {+ {Label: "One", Prompt: "One"},+ {Label: "Two", Prompt: "Two"},+ {Label: "Three", Prompt: "Three"},+ {Label: "Four", Prompt: "Four"},+ },+ "blank label": {{Label: " ", Prompt: "Prompt"}},+ "blank prompt": {{Label: "Label", Prompt: " "}},+ "long label": {{Label: strings.Repeat("a", maxAgentStarterPromptLabel+1), Prompt: "Prompt"}},+ "long prompt": {{Label: "Label", Prompt: strings.Repeat("a", maxAgentStarterPromptLength+1)}},+ } {+ t.Run(name, func(t *testing.T) {+ if _, err := normaliseAgentStarterPrompts(prompts); err == nil {+ t.Fatal("normaliseAgentStarterPrompts() error = nil, want validation error")+ }+ })+ }+}++func TestAgentStarterPromptsRoundTrip(t *testing.T) {+ if testHandler == nil || testPool == nil {+ t.Skip("database not available")+ }++ var created AgentResponse+ testutil.Call(t, testHandler.CreateAgent, newRequest(http.MethodPost, "/api/agents", map[string]any{+ "name": fmt.Sprintf("starter-prompts-%d", time.Now().UnixNano()),+ "runtime_id": handlerTestRuntimeID(t),+ "starter_prompts": []map[string]string{{+ "label": " Review a PR ",+ "prompt": " Review the most relevant open pull request. ",+ }},+ })).Want(http.StatusCreated).JSON(&created)+ dbfx.Cleanup(t, `DELETE FROM agent WHERE id = $1`, created.ID)+ if len(created.StarterPrompts) != 1 ||+ created.StarterPrompts[0].Label != "Review a PR" ||+ created.StarterPrompts[0].Prompt != "Review the most relevant open pull request." {+ t.Fatalf("created starter_prompts = %#v", created.StarterPrompts)+ }++ var preserved AgentResponse+ testutil.Call(t, testHandler.UpdateAgent, withURLParam(+ newRequest(http.MethodPut, "/api/agents/"+created.ID, map[string]any{+ "description": "starter prompts unchanged",+ }),+ "id",+ created.ID,+ )).Want(http.StatusOK).JSON(&preserved)+ if len(preserved.StarterPrompts) != 1 {+ t.Fatalf("omitted update starter_prompts = %#v, want preserved prompt", preserved.StarterPrompts)+ }++ var clearedAgent AgentResponse+ testutil.Call(t, testHandler.UpdateAgent, withURLParam(+ newRequest(http.MethodPut, "/api/agents/"+created.ID, map[string]any{+ "starter_prompts": []AgentStarterPrompt{},+ }),+ "id",+ created.ID,+ )).Want(http.StatusOK).JSON(&clearedAgent)+ if len(clearedAgent.StarterPrompts) != 0 {+ t.Fatalf("cleared starter_prompts = %#v, want empty", clearedAgent.StarterPrompts)+ }+}diff --git a/server/internal/handler/config.go b/server/internal/handler/config.goindex d45b84622e..e6e5feb7e2 100644--- a/server/internal/handler/config.go+++ b/server/internal/handler/config.go@@ -75,6 +75,12 @@ type AppConfig struct {// them, and only one of the two guesses is safe.LocalWorktreeSupported bool `json:"local_worktree_supported"`+ // AgentStarterPromptsSupported tells independently deployed clients that+ // agent create/update persists starter_prompts. Older handlers ignored the+ // unknown JSON field and still returned success, so clients must fail closed+ // when this declaration is absent.+ AgentStarterPromptsSupported bool `json:"agent_starter_prompts_supported"`+// ServerVersion is the running API build version, so self-hosted// operators can confirm what's deployed and include it in bug reports.// Only emitted on self-hosted deployments — omitted on the managed cloud,@@ -91,10 +97,11 @@ func (h *Handler) GetConfig(w http.ResponseWriter, r *http.Request) {config := AppConfig{// A property of this build, not of the deployment: if this code is// running, the save gate is running with it.- LocalWorktreeSupported: true,- AllowSignup: os.Getenv("ALLOW_SIGNUP") != "false",- GoogleClientID: os.Getenv("GOOGLE_CLIENT_ID"),- WorkspaceCreationDisabled: os.Getenv("DISABLE_WORKSPACE_CREATION") == "true",+ LocalWorktreeSupported: true,+ AgentStarterPromptsSupported: true,+ AllowSignup: os.Getenv("ALLOW_SIGNUP") != "false",+ GoogleClientID: os.Getenv("GOOGLE_CLIENT_ID"),+ WorkspaceCreationDisabled: os.Getenv("DISABLE_WORKSPACE_CREATION") == "true",}if h.Storage != nil {config.CdnDomain = h.Storage.CdnDomain()diff --git a/server/internal/handler/config_test.go b/server/internal/handler/config_test.goindex 665d5ce221..c4efc65e43 100644--- a/server/internal/handler/config_test.go+++ b/server/internal/handler/config_test.go@@ -520,3 +520,30 @@ func TestGetConfigDeclaresLocalWorktreeSupport(t *testing.T) {t.Fatal("local_worktree_supported missing from the JSON body")}}++// Web/Desktop can run ahead of a manually deployed backend. Handlers that+// predate starter_prompts ignore the unknown JSON field and still answer 200,+// so clients must see an explicit declaration before sending either create or+// update writes that contain it.+func TestGetConfigDeclaresAgentStarterPromptsSupport(t *testing.T) {+ req := httptest.NewRequest(http.MethodGet, "/api/config", nil)+ w := httptest.NewRecorder()+ testHandler.GetConfig(w, req)+ if w.Code != http.StatusOK {+ t.Fatalf("GetConfig: expected 200, got %d: %s", w.Code, w.Body.String())+ }+ var cfg AppConfig+ if err := json.Unmarshal(w.Body.Bytes(), &cfg); err != nil {+ t.Fatalf("decode config: %v", err)+ }+ if !cfg.AgentStarterPromptsSupported {+ t.Fatal("this build persists starter_prompts but does not advertise the contract")+ }+ var raw map[string]any+ if err := json.Unmarshal(w.Body.Bytes(), &raw); err != nil {+ t.Fatalf("decode raw config: %v", err)+ }+ if _, ok := raw["agent_starter_prompts_supported"]; !ok {+ t.Fatal("agent_starter_prompts_supported missing from the JSON body")+ }+}diff --git a/server/internal/service/builtin_skills/multica-creating-agents/SKILL.md b/server/internal/service/builtin_skills/multica-creating-agents/SKILL.mdindex 2ebf2817c4..97a0b29457 100644--- a/server/internal/service/builtin_skills/multica-creating-agents/SKILL.md+++ b/server/internal/service/builtin_skills/multica-creating-agents/SKILL.md@@ -71,7 +71,7 @@ strings. `--max-concurrent-tasks` is validated as 1–50 before the request issent.The HTTP body (`CreateAgentRequest`) accepts: `name`, `description`,-`instructions`, `avatar_url`, `runtime_id`, `runtime_config`, `custom_env`,+`instructions`, `starter_prompts`, `avatar_url`, `runtime_id`, `runtime_config`, `custom_env`,`custom_args`, `model`, `thinking_level`, `service_tier`, `visibility`,`max_concurrent_tasks`, `mcp_config`, `skill_ids`.@@ -90,6 +90,7 @@ multica agent copy <source-agent-id> --name "My Agent (copy)" # same runtimemultica agent copy <source-agent-id> --runtime-id <target> --model <model> # cross-runtime fork```+- Copied by default without a dedicated override flag: `starter_prompts`.- Copied by default, each overridable with the matching flag: `name` (suffixed`" (copy)"`), `description`, `instructions`, avatar, `custom_args`,`max_concurrent_tasks`, invocation permission (`permission_mode` +@@ -116,6 +117,7 @@ multica agent copy <source-agent-id> --runtime-id <target> --model <model> # cr| `name` | `agent.name` | required, 400 if empty | listings, runtime payload || `description` | `agent.description` | 400 if > 255 code points | catalog/listing only — NOT the runtime prompt || `instructions` | `agent.instructions` | none | daemon → provider at claim time |+| `starter_prompts` | `agent.starter_prompts` (JSON array) | at most 3 items; each requires a label (≤80 code points) and prompt (≤4000 code points) | human-facing Chat empty state only; selecting one prefills the composer and does not start a run || `avatar_url` | `agent.avatar_url` | none; an explicit non-empty value is preserved, while omitted/empty creates a random `emoji:<glyph>` avatar | catalog/listing UI only — NOT the runtime prompt || `runtime_id` | `agent.runtime_id` (nullable) | required at create (400) + must resolve to a runtime in this workspace | selects runtime/provider; `NULL` means unbound — see below || `model` | `agent.model` (nullable) | none beyond runtime support | daemon reads; empty = runtime default |diff --git a/server/internal/service/builtin_skills/multica-creating-agents/references/creating-agents-source-map.md b/server/internal/service/builtin_skills/multica-creating-agents/references/creating-agents-source-map.mdindex 60821f3bbe..fa1d7bfaac 100644--- a/server/internal/service/builtin_skills/multica-creating-agents/references/creating-agents-source-map.md+++ b/server/internal/service/builtin_skills/multica-creating-agents/references/creating-agents-source-map.md@@ -40,6 +40,7 @@ go test ./internal/service -run TestBuiltinSkillsConformToTemplate|---|---|---|---|| `agentCopyCmd` (`copy <source-agent-id>`) + flag registrar | 21, 47, 54 | Own file with its own `init()` so `cmd_agent.go` line refs stay stable; `registerAgentCopyFlags` is shared with the tests | `multica agent copy --help` || Reads source via `GET /api/agents/<id>` | 95 | Composes over existing endpoints — no dedicated copy API | read `runAgentCopy` |+| Starter prompts copied without an override flag | `runAgentCopy` starter-prompt body assembly | Copies `starter_prompts` when the source response contains an array; `registerAgentCopyFlags` intentionally exposes no starter-prompt override | `multica agent copy --help` || Same-runtime vs cross-runtime rule | 114, 187 | `sameRuntime` copies `model`/`thinking_level`/`service_tier`; a different `--runtime-id` drops them and requires `--model` (empty allowed) | `multica agent copy --help` || Concurrency copy compatibility | `runAgentCopy`, `copiedAgentMaxConcurrentTasks` | Explicit `--max-concurrent-tasks` is validated before any request; valid source values are copied, while historical values outside 1–50 are omitted so create defaults to 6 | read the concurrency body assembly || Skills copied in the create transaction | 239 | Source skill ids sent as `skill_ids`, bound in the same `POST /api/agents` tx (267); `--no-skills` opts out | read `runAgentCopy` |@@ -52,6 +53,7 @@ go test ./internal/service -run TestBuiltinSkillsConformToTemplate| `maxAgentDescriptionLength = 255` | 31 | Cap is 255 **Unicode code points** (comment: counted via `utf8.RuneCountInString`, matches Postgres `char_length`) || `AgentResponse` omits plaintext `custom_env` | 33–53 | Exposes only `has_custom_env` (52) and `custom_env_key_count` (53); comment cites MUL-2600 || `CreateAgentRequest` fields | 930–970 | Includes `model`, `thinking_level`, and Codex `service_tier` alongside the profile/runtime/permission inputs |+| Starter-prompt request and validation | `AgentStarterPrompt`, `normaliseAgentStarterPrompts`, create/update paths | `starter_prompts` is trimmed and validated as at most three complete label/prompt pairs before JSONB persistence; omission defaults to `[]`, update omission preserves, and `[]` clears || `name` required | 623–625 | 400 "name is required" || `description` ≤ 255 code points | 627–629 | `utf8.RuneCountInString(req.Description) > maxAgentDescriptionLength` → 400 || `runtime_id` required | 631–633 | `if req.RuntimeID == ""` → 400 "runtime_id is required" |@@ -70,7 +72,7 @@ go test ./internal/service -run TestBuiltinSkillsConformToTemplate| Workspace MCP library + assignment API | `internal/handler/workspace_mcp_api.go` | `GET /api/workspaces/{id}/mcp-servers` returns name / transport only, never the entry, for any role; `POST`/`PUT`/`DELETE` on the library are owner/admin; `GET`/`POST`/`PUT .../enabled`/`DELETE /api/agents/{id}/mcp-servers` manage one agent's assignments and admit the agent owner or a workspace owner/admin. Every write refuses agent actors. Deleting a library entry sweeps its bindings in the same transaction (no FK) || Effective-set regression guard | `internal/daemon/runtime_mcp_workspace_test.go` | Runs resolve -> `mergeRuntimeAndAgentMcpConfig` for OpenCode; catches a resolver that emits a container the daemon merge would not read || Random emoji avatar default | `agent_avatar.go` 11–32; `agent.go` 1127–1133 | Omitted, empty, or whitespace-only `avatar_url` becomes a cryptographically selected `emoji:<glyph>` sentinel; explicit values are preserved. |-| `CreateAgent` insert params | `agent.go` create path | Persists avatar_url, runtime_config, instructions, custom_env, custom_args, model, thinking_level, service_tier, mcp_config, visibility, max_concurrent_tasks |+| `CreateAgent` insert params | `agent.go` create path | Persists avatar_url, runtime_config, instructions, starter_prompts, custom_env, custom_args, model, thinking_level, service_tier, mcp_config, visibility, max_concurrent_tasks || `UpdateAgent` rejects `custom_env` | 910–913 | if `custom_env` present in body → 400 "use PUT /api/agents/{id}/env (or `multica agent env set`)" || `UpdateAgent` persists / clears `mcp_config` | 944–948, 1060–1061 | Tri-state from the raw body: key omitted → no change; literal `null` → `ClearAgentMcpConfig`; object → replace. No 400 like `custom_env` — `mcp_config` IS updatable here || `description` ≤ 255 on update too | 921–924 | same cap re-checked on update |@@ -140,7 +142,7 @@ go test ./internal/service -run TestBuiltinSkillsConformToTemplate| Contract | Line | Behavior ||---|---|---|-| `CreateAgent` INSERT | generated from `queries/agent.sql` | columns include `runtime_config, runtime_id, instructions, custom_env, custom_args, mcp_config, model, thinking_level, service_tier` |+| `CreateAgent` INSERT | generated from `queries/agent.sql` | columns include `runtime_config, runtime_id, instructions, starter_prompts, custom_env, custom_args, mcp_config, model, thinking_level, service_tier` || `CreateAgentParams` | generated from `queries/agent.sql` | typed params include nullable `Model`, `ThinkingLevel`, and `ServiceTier` || `UpdateAgent` SET | generated from `queries/agent.sql` | COALESCE updates include model/thinking/service tier; dedicated clear queries restore each nullable override || `UpdateAgentCustomEnv` (called by the `UpdateAgentEnv` handler) | 2652 | `SET custom_env = $2` — the only write path for env values |diff --git a/server/internal/service/builtin_skills_test.go b/server/internal/service/builtin_skills_test.goindex 6e10a7c095..3b303fa140 100644--- a/server/internal/service/builtin_skills_test.go+++ b/server/internal/service/builtin_skills_test.go@@ -373,6 +373,7 @@ func TestCreatingAgentsSkillCoversAgentCreationContracts(t *testing.T) {"not a parameter manual","`description` is a catalog summary","`instructions` is the runtime behavior contract",+ "`starter_prompts`","`avatar_url` → a random `emoji:<glyph>`","multica agent create --name <name> --runtime-id <runtime-id>","`model` is a first-class persisted column",diff --git a/server/migrations/404_agent_starter_prompts.down.sql b/server/migrations/404_agent_starter_prompts.down.sqlnew file mode 100644index 0000000000..482e68552d--- /dev/null+++ b/server/migrations/404_agent_starter_prompts.down.sql@@ -0,0 +1,2 @@+ALTER TABLE agent+DROP COLUMN starter_prompts;diff --git a/server/migrations/404_agent_starter_prompts.up.sql b/server/migrations/404_agent_starter_prompts.up.sqlnew file mode 100644index 0000000000..c282a36dd5--- /dev/null+++ b/server/migrations/404_agent_starter_prompts.up.sql@@ -0,0 +1,6 @@+ALTER TABLE agent+ADD COLUMN starter_prompts JSONB NOT NULL DEFAULT '[]'::jsonb+CHECK (+ jsonb_typeof(starter_prompts) = 'array'+ AND jsonb_array_length(starter_prompts) <= 3+);diff --git a/server/pkg/db/generated/agent.sql.go b/server/pkg/db/generated/agent.sql.goindex cd990a4031..17e541cf83 100644--- a/server/pkg/db/generated/agent.sql.go+++ b/server/pkg/db/generated/agent.sql.go@@ -110,7 +110,7 @@ func (q *Queries) AcknowledgeExhaustedDelegatedFailureRecovery(ctx context.Conteconst archiveAgent = `-- name: ArchiveAgent :oneUPDATE agent SET archived_at = now(), archived_by = $2, updated_at = now()WHERE id = $1-RETURNING id, workspace_id, name, avatar_url, runtime_mode, runtime_config, visibility, status, max_concurrent_tasks, owner_id, created_at, updated_at, description, runtime_id, instructions, archived_at, archived_by, custom_env, custom_args, mcp_config, model, thinking_level, composio_toolkit_allowlist, permission_mode, kind, system_key, disabled_runtime_skills, service_tier+RETURNING id, workspace_id, name, avatar_url, runtime_mode, runtime_config, visibility, status, max_concurrent_tasks, owner_id, created_at, updated_at, description, runtime_id, instructions, archived_at, archived_by, custom_env, custom_args, mcp_config, model, thinking_level, composio_toolkit_allowlist, permission_mode, kind, system_key, disabled_runtime_skills, service_tier, starter_prompts`type ArchiveAgentParams struct {@@ -150,6 +150,7 @@ func (q *Queries) ArchiveAgent(ctx context.Context, arg ArchiveAgentParams) (Age&i.SystemKey,&i.DisabledRuntimeSkills,&i.ServiceTier,+ &i.StarterPrompts,)return i, err}@@ -158,7 +159,7 @@ const archiveAgentsByIDs = `-- name: ArchiveAgentsByIDs :manyUPDATE agentSET archived_at = now(), archived_by = $1, updated_at = now()WHERE id = ANY($2::uuid[]) AND archived_at IS NULL-RETURNING id, workspace_id, name, avatar_url, runtime_mode, runtime_config, visibility, status, max_concurrent_tasks, owner_id, created_at, updated_at, description, runtime_id, instructions, archived_at, archived_by, custom_env, custom_args, mcp_config, model, thinking_level, composio_toolkit_allowlist, permission_mode, kind, system_key, disabled_runtime_skills, service_tier+RETURNING id, workspace_id, name, avatar_url, runtime_mode, runtime_config, visibility, status, max_concurrent_tasks, owner_id, created_at, updated_at, description, runtime_id, instructions, archived_at, archived_by, custom_env, custom_args, mcp_config, model, thinking_level, composio_toolkit_allowlist, permission_mode, kind, system_key, disabled_runtime_skills, service_tier, starter_prompts`type ArchiveAgentsByIDsParams struct {@@ -212,6 +213,7 @@ func (q *Queries) ArchiveAgentsByIDs(ctx context.Context, arg ArchiveAgentsByIDs&i.SystemKey,&i.DisabledRuntimeSkills,&i.ServiceTier,+ &i.StarterPrompts,); err != nil {return nil, err}@@ -228,7 +230,7 @@ UPDATE agentSET archived_at = now(), archived_by = $1, updated_at = now()WHERE runtime_id = ANY($2::uuid[]) AND archived_at IS NULLAND (system_key IS NULL OR system_key = '')-RETURNING id, workspace_id, name, avatar_url, runtime_mode, runtime_config, visibility, status, max_concurrent_tasks, owner_id, created_at, updated_at, description, runtime_id, instructions, archived_at, archived_by, custom_env, custom_args, mcp_config, model, thinking_level, composio_toolkit_allowlist, permission_mode, kind, system_key, disabled_runtime_skills, service_tier+RETURNING id, workspace_id, name, avatar_url, runtime_mode, runtime_config, visibility, status, max_concurrent_tasks, owner_id, created_at, updated_at, description, runtime_id, instructions, archived_at, archived_by, custom_env, custom_args, mcp_config, model, thinking_level, composio_toolkit_allowlist, permission_mode, kind, system_key, disabled_runtime_skills, service_tier, starter_prompts`type ArchiveAgentsByRuntimeParams struct {@@ -285,6 +287,7 @@ func (q *Queries) ArchiveAgentsByRuntime(ctx context.Context, arg ArchiveAgentsB&i.SystemKey,&i.DisabledRuntimeSkills,&i.ServiceTier,+ &i.StarterPrompts,); err != nil {return nil, err}@@ -1762,7 +1765,7 @@ func (q *Queries) ClaimChatFinalizeDeferred(ctx context.Context, id pgtype.UUID)const clearAgentComposioToolkitAllowlist = `-- name: ClearAgentComposioToolkitAllowlist :oneUPDATE agent SET composio_toolkit_allowlist = NULL, updated_at = now()WHERE id = $1-RETURNING id, workspace_id, name, avatar_url, runtime_mode, runtime_config, visibility, status, max_concurrent_tasks, owner_id, created_at, updated_at, description, runtime_id, instructions, archived_at, archived_by, custom_env, custom_args, mcp_config, model, thinking_level, composio_toolkit_allowlist, permission_mode, kind, system_key, disabled_runtime_skills, service_tier+RETURNING id, workspace_id, name, avatar_url, runtime_mode, runtime_config, visibility, status, max_concurrent_tasks, owner_id, created_at, updated_at, description, runtime_id, instructions, archived_at, archived_by, custom_env, custom_args, mcp_config, model, thinking_level, composio_toolkit_allowlist, permission_mode, kind, system_key, disabled_runtime_skills, service_tier, starter_prompts`// Explicit NULL-clear for composio_toolkit_allowlist. The COALESCE-based@@ -1803,6 +1806,7 @@ func (q *Queries) ClearAgentComposioToolkitAllowlist(ctx context.Context, id pgt&i.SystemKey,&i.DisabledRuntimeSkills,&i.ServiceTier,+ &i.StarterPrompts,)return i, err}@@ -1810,7 +1814,7 @@ func (q *Queries) ClearAgentComposioToolkitAllowlist(ctx context.Context, id pgtconst clearAgentMcpConfig = `-- name: ClearAgentMcpConfig :oneUPDATE agent SET mcp_config = NULL, updated_at = now()WHERE id = $1-RETURNING id, workspace_id, name, avatar_url, runtime_mode, runtime_config, visibility, status, max_concurrent_tasks, owner_id, created_at, updated_at, description, runtime_id, instructions, archived_at, archived_by, custom_env, custom_args, mcp_config, model, thinking_level, composio_toolkit_allowlist, permission_mode, kind, system_key, disabled_runtime_skills, service_tier+RETURNING id, workspace_id, name, avatar_url, runtime_mode, runtime_config, visibility, status, max_concurrent_tasks, owner_id, created_at, updated_at, description, runtime_id, instructions, archived_at, archived_by, custom_env, custom_args, mcp_config, model, thinking_level, composio_toolkit_allowlist, permission_mode, kind, system_key, disabled_runtime_skills, service_tier, starter_prompts`func (q *Queries) ClearAgentMcpConfig(ctx context.Context, id pgtype.UUID) (Agent, error) {@@ -1845,6 +1849,7 @@ func (q *Queries) ClearAgentMcpConfig(ctx context.Context, id pgtype.UUID) (Agen&i.SystemKey,&i.DisabledRuntimeSkills,&i.ServiceTier,+ &i.StarterPrompts,)return i, err}@@ -1852,7 +1857,7 @@ func (q *Queries) ClearAgentMcpConfig(ctx context.Context, id pgtype.UUID) (Agenconst clearAgentServiceTier = `-- name: ClearAgentServiceTier :oneUPDATE agent SET service_tier = NULL, updated_at = now()WHERE id = $1-RETURNING id, workspace_id, name, avatar_url, runtime_mode, runtime_config, visibility, status, max_concurrent_tasks, owner_id, created_at, updated_at, description, runtime_id, instructions, archived_at, archived_by, custom_env, custom_args, mcp_config, model, thinking_level, composio_toolkit_allowlist, permission_mode, kind, system_key, disabled_runtime_skills, service_tier+RETURNING id, workspace_id, name, avatar_url, runtime_mode, runtime_config, visibility, status, max_concurrent_tasks, owner_id, created_at, updated_at, description, runtime_id, instructions, archived_at, archived_by, custom_env, custom_args, mcp_config, model, thinking_level, composio_toolkit_allowlist, permission_mode, kind, system_key, disabled_runtime_skills, service_tier, starter_prompts`// Explicit NULL-clear for service_tier. COALESCE-based UpdateAgent cannot@@ -1889,6 +1894,7 @@ func (q *Queries) ClearAgentServiceTier(ctx context.Context, id pgtype.UUID) (Ag&i.SystemKey,&i.DisabledRuntimeSkills,&i.ServiceTier,+ &i.StarterPrompts,)return i, err}@@ -1896,7 +1902,7 @@ func (q *Queries) ClearAgentServiceTier(ctx context.Context, id pgtype.UUID) (Agconst clearAgentThinkingLevel = `-- name: ClearAgentThinkingLevel :oneUPDATE agent SET thinking_level = NULL, updated_at = now()WHERE id = $1-RETURNING id, workspace_id, name, avatar_url, runtime_mode, runtime_config, visibility, status, max_concurrent_tasks, owner_id, created_at, updated_at, description, runtime_id, instructions, archived_at, archived_by, custom_env, custom_args, mcp_config, model, thinking_level, composio_toolkit_allowlist, permission_mode, kind, system_key, disabled_runtime_skills, service_tier+RETURNING id, workspace_id, name, avatar_url, runtime_mode, runtime_config, visibility, status, max_concurrent_tasks, owner_id, created_at, updated_at, description, runtime_id, instructions, archived_at, archived_by, custom_env, custom_args, mcp_config, model, thinking_level, composio_toolkit_allowlist, permission_mode, kind, system_key, disabled_runtime_skills, service_tier, starter_prompts`// Explicit NULL-clear for thinking_level. COALESCE-based UpdateAgent cannot@@ -1934,6 +1940,7 @@ func (q *Queries) ClearAgentThinkingLevel(ctx context.Context, id pgtype.UUID) (&i.SystemKey,&i.DisabledRuntimeSkills,&i.ServiceTier,+ &i.StarterPrompts,)return i, err}@@ -2083,17 +2090,17 @@ INSERT INTO agent (workspace_id, name, description, avatar_url, runtime_mode,runtime_config, runtime_id, visibility, max_concurrent_tasks, owner_id,instructions, custom_env, custom_args, mcp_config, model, thinking_level,- service_tier,+ service_tier, starter_prompts,composio_toolkit_allowlist, permission_mode) VALUES ($1, $2, $3, $4, $5,$6, $7, $8, $9, $10,$11, $12, $13, $14, $15, $16,- $17,- $18::text[],- COALESCE($19, 'private')+ $17, COALESCE($18::jsonb, '[]'::jsonb),+ $19::text[],+ COALESCE($20, 'private'))-RETURNING id, workspace_id, name, avatar_url, runtime_mode, runtime_config, visibility, status, max_concurrent_tasks, owner_id, created_at, updated_at, description, runtime_id, instructions, archived_at, archived_by, custom_env, custom_args, mcp_config, model, thinking_level, composio_toolkit_allowlist, permission_mode, kind, system_key, disabled_runtime_skills, service_tier+RETURNING id, workspace_id, name, avatar_url, runtime_mode, runtime_config, visibility, status, max_concurrent_tasks, owner_id, created_at, updated_at, description, runtime_id, instructions, archived_at, archived_by, custom_env, custom_args, mcp_config, model, thinking_level, composio_toolkit_allowlist, permission_mode, kind, system_key, disabled_runtime_skills, service_tier, starter_prompts`type CreateAgentParams struct {@@ -2114,6 +2121,7 @@ type CreateAgentParams struct {Model pgtype.Text `json:"model"`ThinkingLevel pgtype.Text `json:"thinking_level"`ServiceTier pgtype.Text `json:"service_tier"`+ StarterPrompts []byte `json:"starter_prompts"`ComposioToolkitAllowlist []string `json:"composio_toolkit_allowlist"`PermissionMode interface{} `json:"permission_mode"`}@@ -2137,6 +2145,7 @@ func (q *Queries) CreateAgent(ctx context.Context, arg CreateAgentParams) (Agentarg.Model,arg.ThinkingLevel,arg.ServiceTier,+ arg.StarterPrompts,arg.ComposioToolkitAllowlist,arg.PermissionMode,)@@ -2170,6 +2179,7 @@ func (q *Queries) CreateAgent(ctx context.Context, arg CreateAgentParams) (Agent&i.SystemKey,&i.DisabledRuntimeSkills,&i.ServiceTier,+ &i.StarterPrompts,)return i, err}@@ -2184,7 +2194,7 @@ INSERT INTO agent ('private', 'private', 1, $5, $6,'{}'::jsonb, '[]'::jsonb, $7, 'system', $8)-RETURNING id, workspace_id, name, avatar_url, runtime_mode, runtime_config, visibility, status, max_concurrent_tasks, owner_id, created_at, updated_at, description, runtime_id, instructions, archived_at, archived_by, custom_env, custom_args, mcp_config, model, thinking_level, composio_toolkit_allowlist, permission_mode, kind, system_key, disabled_runtime_skills, service_tier+RETURNING id, workspace_id, name, avatar_url, runtime_mode, runtime_config, visibility, status, max_concurrent_tasks, owner_id, created_at, updated_at, description, runtime_id, instructions, archived_at, archived_by, custom_env, custom_args, mcp_config, model, thinking_level, composio_toolkit_allowlist, permission_mode, kind, system_key, disabled_runtime_skills, service_tier, starter_prompts`type CreateAgentBuilderParams struct {@@ -2243,6 +2253,7 @@ func (q *Queries) CreateAgentBuilder(ctx context.Context, arg CreateAgentBuilder&i.SystemKey,&i.DisabledRuntimeSkills,&i.ServiceTier,+ &i.StarterPrompts,)return i, err}@@ -3148,7 +3159,7 @@ INSERT INTO agent ($6, $7, $8, $9, $10,$11, '', '{}'::jsonb, '[]'::jsonb, 'user', $12)-RETURNING id, workspace_id, name, avatar_url, runtime_mode, runtime_config, visibility, status, max_concurrent_tasks, owner_id, created_at, updated_at, description, runtime_id, instructions, archived_at, archived_by, custom_env, custom_args, mcp_config, model, thinking_level, composio_toolkit_allowlist, permission_mode, kind, system_key, disabled_runtime_skills, service_tier+RETURNING id, workspace_id, name, avatar_url, runtime_mode, runtime_config, visibility, status, max_concurrent_tasks, owner_id, created_at, updated_at, description, runtime_id, instructions, archived_at, archived_by, custom_env, custom_args, mcp_config, model, thinking_level, composio_toolkit_allowlist, permission_mode, kind, system_key, disabled_runtime_skills, service_tier, starter_prompts`type CreateSystemUserAgentParams struct {@@ -3223,6 +3234,7 @@ func (q *Queries) CreateSystemUserAgent(ctx context.Context, arg CreateSystemUse&i.SystemKey,&i.DisabledRuntimeSkills,&i.ServiceTier,+ &i.StarterPrompts,)return i, err}@@ -3896,7 +3908,7 @@ func (q *Queries) FailStaleTasks(ctx context.Context, arg FailStaleTasksParams)}const getAgent = `-- name: GetAgent :one-SELECT id, workspace_id, name, avatar_url, runtime_mode, runtime_config, visibility, status, max_concurrent_tasks, owner_id, created_at, updated_at, description, runtime_id, instructions, archived_at, archived_by, custom_env, custom_args, mcp_config, model, thinking_level, composio_toolkit_allowlist, permission_mode, kind, system_key, disabled_runtime_skills, service_tier FROM agent+SELECT id, workspace_id, name, avatar_url, runtime_mode, runtime_config, visibility, status, max_concurrent_tasks, owner_id, created_at, updated_at, description, runtime_id, instructions, archived_at, archived_by, custom_env, custom_args, mcp_config, model, thinking_level, composio_toolkit_allowlist, permission_mode, kind, system_key, disabled_runtime_skills, service_tier, starter_prompts FROM agentWHERE id = $1`@@ -3932,12 +3944,13 @@ func (q *Queries) GetAgent(ctx context.Context, id pgtype.UUID) (Agent, error) {&i.SystemKey,&i.DisabledRuntimeSkills,&i.ServiceTier,+ &i.StarterPrompts,)return i, err}const getAgentBySystemKey = `-- name: GetAgentBySystemKey :one-SELECT id, workspace_id, name, avatar_url, runtime_mode, runtime_config, visibility, status, max_concurrent_tasks, owner_id, created_at, updated_at, description, runtime_id, instructions, archived_at, archived_by, custom_env, custom_args, mcp_config, model, thinking_level, composio_toolkit_allowlist, permission_mode, kind, system_key, disabled_runtime_skills, service_tier FROM agent+SELECT id, workspace_id, name, avatar_url, runtime_mode, runtime_config, visibility, status, max_concurrent_tasks, owner_id, created_at, updated_at, description, runtime_id, instructions, archived_at, archived_by, custom_env, custom_args, mcp_config, model, thinking_level, composio_toolkit_allowlist, permission_mode, kind, system_key, disabled_runtime_skills, service_tier, starter_prompts FROM agentWHERE workspace_id = $1 AND system_key = $2 AND archived_at IS NULLORDER BY created_at ASC, id ASCLIMIT 1@@ -3983,12 +3996,13 @@ func (q *Queries) GetAgentBySystemKey(ctx context.Context, arg GetAgentBySystemK&i.SystemKey,&i.DisabledRuntimeSkills,&i.ServiceTier,+ &i.StarterPrompts,)return i, err}const getAgentForClaimUpdate = `-- name: GetAgentForClaimUpdate :one-SELECT id, workspace_id, name, avatar_url, runtime_mode, runtime_config, visibility, status, max_concurrent_tasks, owner_id, created_at, updated_at, description, runtime_id, instructions, archived_at, archived_by, custom_env, custom_args, mcp_config, model, thinking_level, composio_toolkit_allowlist, permission_mode, kind, system_key, disabled_runtime_skills, service_tier FROM agent+SELECT id, workspace_id, name, avatar_url, runtime_mode, runtime_config, visibility, status, max_concurrent_tasks, owner_id, created_at, updated_at, description, runtime_id, instructions, archived_at, archived_by, custom_env, custom_args, mcp_config, model, thinking_level, composio_toolkit_allowlist, permission_mode, kind, system_key, disabled_runtime_skills, service_tier, starter_prompts FROM agentWHERE id = $1FOR UPDATE`@@ -4025,12 +4039,13 @@ func (q *Queries) GetAgentForClaimUpdate(ctx context.Context, id pgtype.UUID) (A&i.SystemKey,&i.DisabledRuntimeSkills,&i.ServiceTier,+ &i.StarterPrompts,)return i, err}const getAgentForUpdate = `-- name: GetAgentForUpdate :one-SELECT id, workspace_id, name, avatar_url, runtime_mode, runtime_config, visibility, status, max_concurrent_tasks, owner_id, created_at, updated_at, description, runtime_id, instructions, archived_at, archived_by, custom_env, custom_args, mcp_config, model, thinking_level, composio_toolkit_allowlist, permission_mode, kind, system_key, disabled_runtime_skills, service_tier FROM agent+SELECT id, workspace_id, name, avatar_url, runtime_mode, runtime_config, visibility, status, max_concurrent_tasks, owner_id, created_at, updated_at, description, runtime_id, instructions, archived_at, archived_by, custom_env, custom_args, mcp_config, model, thinking_level, composio_toolkit_allowlist, permission_mode, kind, system_key, disabled_runtime_skills, service_tier, starter_prompts FROM agentWHERE id = $1FOR UPDATE`@@ -4069,12 +4084,13 @@ func (q *Queries) GetAgentForUpdate(ctx context.Context, id pgtype.UUID) (Agent,&i.SystemKey,&i.DisabledRuntimeSkills,&i.ServiceTier,+ &i.StarterPrompts,)return i, err}const getAgentInWorkspace = `-- name: GetAgentInWorkspace :one-SELECT id, workspace_id, name, avatar_url, runtime_mode, runtime_config, visibility, status, max_concurrent_tasks, owner_id, created_at, updated_at, description, runtime_id, instructions, archived_at, archived_by, custom_env, custom_args, mcp_config, model, thinking_level, composio_toolkit_allowlist, permission_mode, kind, system_key, disabled_runtime_skills, service_tier FROM agent+SELECT id, workspace_id, name, avatar_url, runtime_mode, runtime_config, visibility, status, max_concurrent_tasks, owner_id, created_at, updated_at, description, runtime_id, instructions, archived_at, archived_by, custom_env, custom_args, mcp_config, model, thinking_level, composio_toolkit_allowlist, permission_mode, kind, system_key, disabled_runtime_skills, service_tier, starter_prompts FROM agentWHERE id = $1 AND workspace_id = $2 AND kind = 'user'`@@ -4115,6 +4131,7 @@ func (q *Queries) GetAgentInWorkspace(ctx context.Context, arg GetAgentInWorkspa&i.SystemKey,&i.DisabledRuntimeSkills,&i.ServiceTier,+ &i.StarterPrompts,)return i, err}@@ -4953,7 +4970,7 @@ func (q *Queries) LinkTaskToIssue(ctx context.Context, arg LinkTaskToIssueParams}const listActiveAgentsByRuntime = `-- name: ListActiveAgentsByRuntime :many-SELECT id, workspace_id, name, avatar_url, runtime_mode, runtime_config, visibility, status, max_concurrent_tasks, owner_id, created_at, updated_at, description, runtime_id, instructions, archived_at, archived_by, custom_env, custom_args, mcp_config, model, thinking_level, composio_toolkit_allowlist, permission_mode, kind, system_key, disabled_runtime_skills, service_tier FROM agent+SELECT id, workspace_id, name, avatar_url, runtime_mode, runtime_config, visibility, status, max_concurrent_tasks, owner_id, created_at, updated_at, description, runtime_id, instructions, archived_at, archived_by, custom_env, custom_args, mcp_config, model, thinking_level, composio_toolkit_allowlist, permission_mode, kind, system_key, disabled_runtime_skills, service_tier, starter_prompts FROM agentWHERE runtime_id = $1 AND archived_at IS NULL AND kind = 'user'ORDER BY name ASC`@@ -5002,6 +5019,7 @@ func (q *Queries) ListActiveAgentsByRuntime(ctx context.Context, runtimeID pgtyp&i.SystemKey,&i.DisabledRuntimeSkills,&i.ServiceTier,+ &i.StarterPrompts,); err != nil {return nil, err}@@ -5014,7 +5032,7 @@ func (q *Queries) ListActiveAgentsByRuntime(ctx context.Context, runtimeID pgtyp}const listActiveAgentsByRuntimeForUpdate = `-- name: ListActiveAgentsByRuntimeForUpdate :many-SELECT id, workspace_id, name, avatar_url, runtime_mode, runtime_config, visibility, status, max_concurrent_tasks, owner_id, created_at, updated_at, description, runtime_id, instructions, archived_at, archived_by, custom_env, custom_args, mcp_config, model, thinking_level, composio_toolkit_allowlist, permission_mode, kind, system_key, disabled_runtime_skills, service_tier FROM agent+SELECT id, workspace_id, name, avatar_url, runtime_mode, runtime_config, visibility, status, max_concurrent_tasks, owner_id, created_at, updated_at, description, runtime_id, instructions, archived_at, archived_by, custom_env, custom_args, mcp_config, model, thinking_level, composio_toolkit_allowlist, permission_mode, kind, system_key, disabled_runtime_skills, service_tier, starter_prompts FROM agentWHERE runtime_id = $1 AND archived_at IS NULL AND kind = 'user'ORDER BY name ASCFOR UPDATE@@ -5065,6 +5083,7 @@ func (q *Queries) ListActiveAgentsByRuntimeForUpdate(ctx context.Context, runtim&i.SystemKey,&i.DisabledRuntimeSkills,&i.ServiceTier,+ &i.StarterPrompts,); err != nil {return nil, err}@@ -5322,7 +5341,7 @@ func (q *Queries) ListAgentTasks(ctx context.Context, agentID pgtype.UUID) ([]Ag}const listAgents = `-- name: ListAgents :many-SELECT id, workspace_id, name, avatar_url, runtime_mode, runtime_config, visibility, status, max_concurrent_tasks, owner_id, created_at, updated_at, description, runtime_id, instructions, archived_at, archived_by, custom_env, custom_args, mcp_config, model, thinking_level, composio_toolkit_allowlist, permission_mode, kind, system_key, disabled_runtime_skills, service_tier FROM agent+SELECT id, workspace_id, name, avatar_url, runtime_mode, runtime_config, visibility, status, max_concurrent_tasks, owner_id, created_at, updated_at, description, runtime_id, instructions, archived_at, archived_by, custom_env, custom_args, mcp_config, model, thinking_level, composio_toolkit_allowlist, permission_mode, kind, system_key, disabled_runtime_skills, service_tier, starter_prompts FROM agentWHERE workspace_id = $1 AND archived_at IS NULL AND kind = 'user'ORDER BY created_at ASC`@@ -5365,6 +5384,7 @@ func (q *Queries) ListAgents(ctx context.Context, workspaceID pgtype.UUID) ([]Ag&i.SystemKey,&i.DisabledRuntimeSkills,&i.ServiceTier,+ &i.StarterPrompts,); err != nil {return nil, err}@@ -5377,7 +5397,7 @@ func (q *Queries) ListAgents(ctx context.Context, workspaceID pgtype.UUID) ([]Ag}const listAllAgents = `-- name: ListAllAgents :many-SELECT id, workspace_id, name, avatar_url, runtime_mode, runtime_config, visibility, status, max_concurrent_tasks, owner_id, created_at, updated_at, description, runtime_id, instructions, archived_at, archived_by, custom_env, custom_args, mcp_config, model, thinking_level, composio_toolkit_allowlist, permission_mode, kind, system_key, disabled_runtime_skills, service_tier FROM agent+SELECT id, workspace_id, name, avatar_url, runtime_mode, runtime_config, visibility, status, max_concurrent_tasks, owner_id, created_at, updated_at, description, runtime_id, instructions, archived_at, archived_by, custom_env, custom_args, mcp_config, model, thinking_level, composio_toolkit_allowlist, permission_mode, kind, system_key, disabled_runtime_skills, service_tier, starter_prompts FROM agentWHERE workspace_id = $1 AND kind = 'user'ORDER BY created_at ASC`@@ -5420,6 +5440,7 @@ func (q *Queries) ListAllAgents(ctx context.Context, workspaceID pgtype.UUID) ([&i.SystemKey,&i.DisabledRuntimeSkills,&i.ServiceTier,+ &i.StarterPrompts,); err != nil {return nil, err}@@ -5432,7 +5453,7 @@ func (q *Queries) ListAllAgents(ctx context.Context, workspaceID pgtype.UUID) ([}const listAllAgentsAnyKind = `-- name: ListAllAgentsAnyKind :many-SELECT id, workspace_id, name, avatar_url, runtime_mode, runtime_config, visibility, status, max_concurrent_tasks, owner_id, created_at, updated_at, description, runtime_id, instructions, archived_at, archived_by, custom_env, custom_args, mcp_config, model, thinking_level, composio_toolkit_allowlist, permission_mode, kind, system_key, disabled_runtime_skills, service_tier FROM agent+SELECT id, workspace_id, name, avatar_url, runtime_mode, runtime_config, visibility, status, max_concurrent_tasks, owner_id, created_at, updated_at, description, runtime_id, instructions, archived_at, archived_by, custom_env, custom_args, mcp_config, model, thinking_level, composio_toolkit_allowlist, permission_mode, kind, system_key, disabled_runtime_skills, service_tier, starter_prompts FROM agentWHERE workspace_id = $1ORDER BY created_at ASC`@@ -5485,6 +5506,7 @@ func (q *Queries) ListAllAgentsAnyKind(ctx context.Context, workspaceID pgtype.U&i.SystemKey,&i.DisabledRuntimeSkills,&i.ServiceTier,+ &i.StarterPrompts,); err != nil {return nil, err}@@ -6028,7 +6050,7 @@ func (q *Queries) ListTasksByIssue(ctx context.Context, issueID pgtype.UUID) ([]}const listUserAgentsByRuntimeForUpdate = `-- name: ListUserAgentsByRuntimeForUpdate :many-SELECT id, workspace_id, name, avatar_url, runtime_mode, runtime_config, visibility, status, max_concurrent_tasks, owner_id, created_at, updated_at, description, runtime_id, instructions, archived_at, archived_by, custom_env, custom_args, mcp_config, model, thinking_level, composio_toolkit_allowlist, permission_mode, kind, system_key, disabled_runtime_skills, service_tier FROM agent+SELECT id, workspace_id, name, avatar_url, runtime_mode, runtime_config, visibility, status, max_concurrent_tasks, owner_id, created_at, updated_at, description, runtime_id, instructions, archived_at, archived_by, custom_env, custom_args, mcp_config, model, thinking_level, composio_toolkit_allowlist, permission_mode, kind, system_key, disabled_runtime_skills, service_tier, starter_prompts FROM agentWHERE runtime_id = $1 AND kind = 'user'ORDER BY idFOR UPDATE@@ -6077,6 +6099,7 @@ func (q *Queries) ListUserAgentsByRuntimeForUpdate(ctx context.Context, runtimeI&i.SystemKey,&i.DisabledRuntimeSkills,&i.ServiceTier,+ &i.StarterPrompts,); err != nil {return nil, err}@@ -6385,7 +6408,7 @@ func (q *Queries) ListWorkspaceWorkingAgents(ctx context.Context, arg ListWorksp}const lockAgentForAutopilotAssignment = `-- name: LockAgentForAutopilotAssignment :one-SELECT id, workspace_id, name, avatar_url, runtime_mode, runtime_config, visibility, status, max_concurrent_tasks, owner_id, created_at, updated_at, description, runtime_id, instructions, archived_at, archived_by, custom_env, custom_args, mcp_config, model, thinking_level, composio_toolkit_allowlist, permission_mode, kind, system_key, disabled_runtime_skills, service_tier FROM agent+SELECT id, workspace_id, name, avatar_url, runtime_mode, runtime_config, visibility, status, max_concurrent_tasks, owner_id, created_at, updated_at, description, runtime_id, instructions, archived_at, archived_by, custom_env, custom_args, mcp_config, model, thinking_level, composio_toolkit_allowlist, permission_mode, kind, system_key, disabled_runtime_skills, service_tier, starter_prompts FROM agentWHERE id = $1 AND workspace_id = $2 AND kind = 'user'FOR SHARE`@@ -6436,6 +6459,7 @@ func (q *Queries) LockAgentForAutopilotAssignment(ctx context.Context, arg LockA&i.SystemKey,&i.DisabledRuntimeSkills,&i.ServiceTier,+ &i.StarterPrompts,)return i, err}@@ -7164,7 +7188,7 @@ SET runtime_id = $1,model = $3,updated_at = now()WHERE id = $4 AND kind = 'system' AND system_key LIKE 'agent_builder:%'-RETURNING id, workspace_id, name, avatar_url, runtime_mode, runtime_config, visibility, status, max_concurrent_tasks, owner_id, created_at, updated_at, description, runtime_id, instructions, archived_at, archived_by, custom_env, custom_args, mcp_config, model, thinking_level, composio_toolkit_allowlist, permission_mode, kind, system_key, disabled_runtime_skills, service_tier+RETURNING id, workspace_id, name, avatar_url, runtime_mode, runtime_config, visibility, status, max_concurrent_tasks, owner_id, created_at, updated_at, description, runtime_id, instructions, archived_at, archived_by, custom_env, custom_args, mcp_config, model, thinking_level, composio_toolkit_allowlist, permission_mode, kind, system_key, disabled_runtime_skills, service_tier, starter_prompts`type RebindAgentBuilderRuntimeParams struct {@@ -7227,6 +7251,7 @@ func (q *Queries) RebindAgentBuilderRuntime(ctx context.Context, arg RebindAgent&i.SystemKey,&i.DisabledRuntimeSkills,&i.ServiceTier,+ &i.StarterPrompts,)return i, err}@@ -7561,7 +7586,7 @@ SET status = desired.status,updated_at = now()FROM desiredWHERE a.id = $1 AND a.status IS DISTINCT FROM desired.status-RETURNING a.id, a.workspace_id, a.name, a.avatar_url, a.runtime_mode, a.runtime_config, a.visibility, a.status, a.max_concurrent_tasks, a.owner_id, a.created_at, a.updated_at, a.description, a.runtime_id, a.instructions, a.archived_at, a.archived_by, a.custom_env, a.custom_args, a.mcp_config, a.model, a.thinking_level, a.composio_toolkit_allowlist, a.permission_mode, a.kind, a.system_key, a.disabled_runtime_skills, a.service_tier+RETURNING a.id, a.workspace_id, a.name, a.avatar_url, a.runtime_mode, a.runtime_config, a.visibility, a.status, a.max_concurrent_tasks, a.owner_id, a.created_at, a.updated_at, a.description, a.runtime_id, a.instructions, a.archived_at, a.archived_by, a.custom_env, a.custom_args, a.mcp_config, a.model, a.thinking_level, a.composio_toolkit_allowlist, a.permission_mode, a.kind, a.system_key, a.disabled_runtime_skills, a.service_tier, a.starter_prompts`// Persisted agent.status has no queued/resource-wait bucket. Keep dispatched@@ -7601,6 +7626,7 @@ func (q *Queries) RefreshAgentStatusFromTasks(ctx context.Context, id pgtype.UUI&i.SystemKey,&i.DisabledRuntimeSkills,&i.ServiceTier,+ &i.StarterPrompts,)return i, err}@@ -7764,7 +7790,7 @@ func (q *Queries) RequeueAgentTaskAfterClaimFailure(ctx context.Context, arg Reqconst restoreAgent = `-- name: RestoreAgent :oneUPDATE agent SET archived_at = NULL, archived_by = NULL, updated_at = now()WHERE id = $1-RETURNING id, workspace_id, name, avatar_url, runtime_mode, runtime_config, visibility, status, max_concurrent_tasks, owner_id, created_at, updated_at, description, runtime_id, instructions, archived_at, archived_by, custom_env, custom_args, mcp_config, model, thinking_level, composio_toolkit_allowlist, permission_mode, kind, system_key, disabled_runtime_skills, service_tier+RETURNING id, workspace_id, name, avatar_url, runtime_mode, runtime_config, visibility, status, max_concurrent_tasks, owner_id, created_at, updated_at, description, runtime_id, instructions, archived_at, archived_by, custom_env, custom_args, mcp_config, model, thinking_level, composio_toolkit_allowlist, permission_mode, kind, system_key, disabled_runtime_skills, service_tier, starter_prompts`func (q *Queries) RestoreAgent(ctx context.Context, id pgtype.UUID) (Agent, error) {@@ -7799,6 +7825,7 @@ func (q *Queries) RestoreAgent(ctx context.Context, id pgtype.UUID) (Agent, erro&i.SystemKey,&i.DisabledRuntimeSkills,&i.ServiceTier,+ &i.StarterPrompts,)return i, err}@@ -8055,10 +8082,11 @@ UPDATE agent SETmodel = COALESCE($16, model),thinking_level = COALESCE($17, thinking_level),service_tier = COALESCE($18, service_tier),- composio_toolkit_allowlist = COALESCE($19::text[], composio_toolkit_allowlist),+ starter_prompts = COALESCE($19, starter_prompts),+ composio_toolkit_allowlist = COALESCE($20::text[], composio_toolkit_allowlist),updated_at = now()WHERE id = $1-RETURNING id, workspace_id, name, avatar_url, runtime_mode, runtime_config, visibility, status, max_concurrent_tasks, owner_id, created_at, updated_at, description, runtime_id, instructions, archived_at, archived_by, custom_env, custom_args, mcp_config, model, thinking_level, composio_toolkit_allowlist, permission_mode, kind, system_key, disabled_runtime_skills, service_tier+RETURNING id, workspace_id, name, avatar_url, runtime_mode, runtime_config, visibility, status, max_concurrent_tasks, owner_id, created_at, updated_at, description, runtime_id, instructions, archived_at, archived_by, custom_env, custom_args, mcp_config, model, thinking_level, composio_toolkit_allowlist, permission_mode, kind, system_key, disabled_runtime_skills, service_tier, starter_prompts`type UpdateAgentParams struct {@@ -8080,6 +8108,7 @@ type UpdateAgentParams struct {Model pgtype.Text `json:"model"`ThinkingLevel pgtype.Text `json:"thinking_level"`ServiceTier pgtype.Text `json:"service_tier"`+ StarterPrompts []byte `json:"starter_prompts"`ComposioToolkitAllowlist []string `json:"composio_toolkit_allowlist"`}@@ -8109,6 +8138,7 @@ func (q *Queries) UpdateAgent(ctx context.Context, arg UpdateAgentParams) (Agentarg.Model,arg.ThinkingLevel,arg.ServiceTier,+ arg.StarterPrompts,arg.ComposioToolkitAllowlist,)var i Agent@@ -8141,6 +8171,7 @@ func (q *Queries) UpdateAgent(ctx context.Context, arg UpdateAgentParams) (Agent&i.SystemKey,&i.DisabledRuntimeSkills,&i.ServiceTier,+ &i.StarterPrompts,)return i, err}@@ -8149,7 +8180,7 @@ const updateAgentCustomEnv = `-- name: UpdateAgentCustomEnv :oneUPDATE agentSET custom_env = $2, updated_at = now()WHERE id = $1-RETURNING id, workspace_id, name, avatar_url, runtime_mode, runtime_config, visibility, status, max_concurrent_tasks, owner_id, created_at, updated_at, description, runtime_id, instructions, archived_at, archived_by, custom_env, custom_args, mcp_config, model, thinking_level, composio_toolkit_allowlist, permission_mode, kind, system_key, disabled_runtime_skills, service_tier+RETURNING id, workspace_id, name, avatar_url, runtime_mode, runtime_config, visibility, status, max_concurrent_tasks, owner_id, created_at, updated_at, description, runtime_id, instructions, archived_at, archived_by, custom_env, custom_args, mcp_config, model, thinking_level, composio_toolkit_allowlist, permission_mode, kind, system_key, disabled_runtime_skills, service_tier, starter_prompts`type UpdateAgentCustomEnvParams struct {@@ -8194,6 +8225,7 @@ func (q *Queries) UpdateAgentCustomEnv(ctx context.Context, arg UpdateAgentCusto&i.SystemKey,&i.DisabledRuntimeSkills,&i.ServiceTier,+ &i.StarterPrompts,)return i, err}@@ -8202,7 +8234,7 @@ const updateAgentDisabledRuntimeSkills = `-- name: UpdateAgentDisabledRuntimeSkiUPDATE agentSET disabled_runtime_skills = $2, updated_at = now()WHERE id = $1-RETURNING id, workspace_id, name, avatar_url, runtime_mode, runtime_config, visibility, status, max_concurrent_tasks, owner_id, created_at, updated_at, description, runtime_id, instructions, archived_at, archived_by, custom_env, custom_args, mcp_config, model, thinking_level, composio_toolkit_allowlist, permission_mode, kind, system_key, disabled_runtime_skills, service_tier+RETURNING id, workspace_id, name, avatar_url, runtime_mode, runtime_config, visibility, status, max_concurrent_tasks, owner_id, created_at, updated_at, description, runtime_id, instructions, archived_at, archived_by, custom_env, custom_args, mcp_config, model, thinking_level, composio_toolkit_allowlist, permission_mode, kind, system_key, disabled_runtime_skills, service_tier, starter_prompts`type UpdateAgentDisabledRuntimeSkillsParams struct {@@ -8242,6 +8274,7 @@ func (q *Queries) UpdateAgentDisabledRuntimeSkills(ctx context.Context, arg Upda&i.SystemKey,&i.DisabledRuntimeSkills,&i.ServiceTier,+ &i.StarterPrompts,)return i, err}@@ -8249,7 +8282,7 @@ func (q *Queries) UpdateAgentDisabledRuntimeSkills(ctx context.Context, arg Updaconst updateAgentStatus = `-- name: UpdateAgentStatus :oneUPDATE agent SET status = $2, updated_at = now()WHERE id = $1-RETURNING id, workspace_id, name, avatar_url, runtime_mode, runtime_config, visibility, status, max_concurrent_tasks, owner_id, created_at, updated_at, description, runtime_id, instructions, archived_at, archived_by, custom_env, custom_args, mcp_config, model, thinking_level, composio_toolkit_allowlist, permission_mode, kind, system_key, disabled_runtime_skills, service_tier+RETURNING id, workspace_id, name, avatar_url, runtime_mode, runtime_config, visibility, status, max_concurrent_tasks, owner_id, created_at, updated_at, description, runtime_id, instructions, archived_at, archived_by, custom_env, custom_args, mcp_config, model, thinking_level, composio_toolkit_allowlist, permission_mode, kind, system_key, disabled_runtime_skills, service_tier, starter_prompts`type UpdateAgentStatusParams struct {@@ -8289,6 +8322,7 @@ func (q *Queries) UpdateAgentStatus(ctx context.Context, arg UpdateAgentStatusPa&i.SystemKey,&i.DisabledRuntimeSkills,&i.ServiceTier,+ &i.StarterPrompts,)return i, err}diff --git a/server/pkg/db/generated/models.go b/server/pkg/db/generated/models.goindex 31d8613579..570d11ff8e 100644--- a/server/pkg/db/generated/models.go+++ b/server/pkg/db/generated/models.go@@ -52,6 +52,7 @@ type Agent struct {SystemKey pgtype.Text `json:"system_key"`DisabledRuntimeSkills []byte `json:"disabled_runtime_skills"`ServiceTier pgtype.Text `json:"service_tier"`+ StarterPrompts []byte `json:"starter_prompts"`}type AgentBuilderDraft struct {diff --git a/server/pkg/db/generated/runtime.sql.go b/server/pkg/db/generated/runtime.sql.goindex 004789f85a..f206386af0 100644--- a/server/pkg/db/generated/runtime.sql.go+++ b/server/pkg/db/generated/runtime.sql.go@@ -1224,7 +1224,7 @@ const unbindUserAgentsFromRuntime = `-- name: UnbindUserAgentsFromRuntime :manyUPDATE agentSET runtime_id = NULL, updated_at = now()WHERE runtime_id = $1 AND kind = 'user'-RETURNING id, workspace_id, name, avatar_url, runtime_mode, runtime_config, visibility, status, max_concurrent_tasks, owner_id, created_at, updated_at, description, runtime_id, instructions, archived_at, archived_by, custom_env, custom_args, mcp_config, model, thinking_level, composio_toolkit_allowlist, permission_mode, kind, system_key, disabled_runtime_skills, service_tier+RETURNING id, workspace_id, name, avatar_url, runtime_mode, runtime_config, visibility, status, max_concurrent_tasks, owner_id, created_at, updated_at, description, runtime_id, instructions, archived_at, archived_by, custom_env, custom_args, mcp_config, model, thinking_level, composio_toolkit_allowlist, permission_mode, kind, system_key, disabled_runtime_skills, service_tier, starter_prompts`// MUL-5559: the runtime-delete replacement for archive-then-hard-delete. Every@@ -1275,6 +1275,7 @@ func (q *Queries) UnbindUserAgentsFromRuntime(ctx context.Context, runtimeID pgt&i.SystemKey,&i.DisabledRuntimeSkills,&i.ServiceTier,+ &i.StarterPrompts,); err != nil {return nil, err}diff --git a/server/pkg/db/queries/agent.sql b/server/pkg/db/queries/agent.sqlindex 8ba2f5a642..560ce97fc7 100644--- a/server/pkg/db/queries/agent.sql+++ b/server/pkg/db/queries/agent.sql@@ -57,13 +57,13 @@ INSERT INTO agent (workspace_id, name, description, avatar_url, runtime_mode,runtime_config, runtime_id, visibility, max_concurrent_tasks, owner_id,instructions, custom_env, custom_args, mcp_config, model, thinking_level,- service_tier,+ service_tier, starter_prompts,composio_toolkit_allowlist, permission_mode) VALUES ($1, $2, $3, $4, $5,$6, $7, $8, $9, $10,$11, $12, $13, $14, $15, $16,- $17,+ $17, COALESCE(sqlc.narg('starter_prompts')::jsonb, '[]'::jsonb),sqlc.narg('composio_toolkit_allowlist')::text[],COALESCE(sqlc.narg('permission_mode'), 'private'))@@ -142,6 +142,7 @@ UPDATE agent SETmodel = COALESCE(sqlc.narg('model'), model),thinking_level = COALESCE(sqlc.narg('thinking_level'), thinking_level),service_tier = COALESCE(sqlc.narg('service_tier'), service_tier),+ starter_prompts = COALESCE(sqlc.narg('starter_prompts'), starter_prompts),composio_toolkit_allowlist = COALESCE(sqlc.narg('composio_toolkit_allowlist')::text[], composio_toolkit_allowlist),updated_at = now()WHERE id = $1