Name agents by their first prompt line instead of an LLM summary (#1563)

* Name agents by their first prompt line instead of an LLM summary

The workspace title already captures the task; the LLM-generated agent
title just restated the same prompt. Drop the generator and keep the
provisional title (first prompt line), so the agent label stays
deterministic and explicit titles still win.

* Remove the no-op agent-title setting and leftover generator plumbing

Deleting the agent-title generator left its whole surface dangling: a
configurable "Agent titles" project setting that no longer did anything,
dead create-path plumbing, generator-only import/MCP deps, and the mock
provider's agent-title parser. Remove all of it, plus a dead test mock
and timing sleeps that guarded the deleted background job. Replace them
with a no-mock lifecycle test asserting the title stays the first prompt
line across create and settle.

Old paseo.json files with metadataGeneration.agentTitle still parse via
schema passthrough — see COMPAT(projectMetadataAgentTitle).
This commit is contained in:
Mohamed Boudra
2026-06-17 01:12:23 +08:00
committed by GitHub
parent e202ca5036
commit fcb7f8e215
31 changed files with 141 additions and 1035 deletions
-2
View File
@@ -1846,8 +1846,6 @@ export const ar: TranslationResources = {
metadata: {
title: "توليد البيانات الوصفية",
info: "تعليمات خاصة بالمشروع يتم إدخالها في الذكاء الاصطناعي الذي يستخدمه Paseo لإنشاء بيانات التعريف - استخدمها لفرض اصطلاحات فريقك مثل تسمية الفرع أو نمط الالتزام أو تنسيق PR",
agentTitle: "عناوين Agent",
agentTitlePlaceholder: "اجعل العناوين ضرورية وأقل من 40 حرفًا",
branchName: "اسماء الفروع",
branchNamePlaceholder: "بادئة الفروع بـ fet/ أو Fix/, mb/ للفروع الشخصية",
commitMessage: "ارتكاب الرسائل",
-2
View File
@@ -1854,8 +1854,6 @@ export const en = {
metadata: {
title: "Metadata generation",
info: "Project-specific instructions injected into the AI prompts Paseo uses to generate metadata - use them to enforce your team's conventions like branch naming, commit style, or PR format",
agentTitle: "Agent titles",
agentTitlePlaceholder: "Keep titles imperative and under 40 characters",
branchName: "Branch names",
branchNamePlaceholder: "Prefix branches with feat/ or fix/, mb/ for personal branches",
commitMessage: "Commit messages",
-2
View File
@@ -1887,8 +1887,6 @@ export const es: TranslationResources = {
metadata: {
title: "Generación de metadatos",
info: "Instrucciones específicas del proyecto inyectadas en los mensajes de IA quePaseoutiliza para generar metadatos; úselas para hacer cumplir las convenciones de su equipo, como la denominación de ramas, el estilo de confirmación o el formatoPR.",
agentTitle: "TítulosAgent",
agentTitlePlaceholder: "Mantenga los títulos imperativos y de menos de 40 caracteres",
branchName: "Nombres de sucursales",
branchNamePlaceholder: "Prefijo ramas con feat/ o fix/, mb/ para ramas personales",
commitMessage: "Confirmar mensajes",
-2
View File
@@ -1893,8 +1893,6 @@ export const fr: TranslationResources = {
metadata: {
title: "Génération de métadonnées",
info: "Instructions spécifiques au projet injectées dans les invites de l'IA quePaseoutilise pour générer des métadonnées: utilisez-les pour appliquer les conventions de votre équipe telles que la dénomination des branches, le style de validation ou le formatPR.",
agentTitle: "TitresAgent",
agentTitlePlaceholder: "Gardez les titres impératifs et inférieurs à 40 caractères",
branchName: "Noms des succursales",
branchNamePlaceholder:
"Préfixez les branches avec feat/ ou fix/, mb/ pour les branches personnelles",
-2
View File
@@ -1879,8 +1879,6 @@ export const ru: TranslationResources = {
metadata: {
title: "Генерация метаданных",
info: "Инструкции для конкретного проекта, внедренные в подсказки ИИ, которые Paseo использует для генерации метаданных. Используйте их для обеспечения соблюдения соглашений вашей команды, таких как наименование ветвей, стиль фиксации или формат PR.",
agentTitle: "Agent заголовки",
agentTitlePlaceholder: "Сохраняйте заголовки обязательными и длиной не более 40 символов.",
branchName: "Названия ветвей",
branchNamePlaceholder: "Префиксные ветки с feat/ или fix/, mb/ для личных веток",
commitMessage: "Фиксировать сообщения",
-2
View File
@@ -1823,8 +1823,6 @@ export const zhCN: TranslationResources = {
metadata: {
title: "元数据生成",
info: "注入到 Paseo 用来生成元数据的 AI prompts 中的 Project 专属指令,可用于强制执行团队约定,例如分支命名、提交风格或 PR 格式",
agentTitle: "Agent 标题",
agentTitlePlaceholder: "标题保持祈使句且不超过 40 个字符",
branchName: "分支名称",
branchNamePlaceholder: "分支以 feat/ 或 fix/ 开头,个人分支使用 mb/",
commitMessage: "提交消息",
@@ -58,12 +58,6 @@ interface MetadataPromptField {
}
const METADATA_PROMPT_FIELDS: Record<MetadataPromptKey, MetadataPromptField> = {
agentTitle: {
titleKey: "settings.project.metadata.agentTitle",
placeholderKey: "settings.project.metadata.agentTitlePlaceholder",
sectionTestID: "metadata-prompt-agent-title-section",
inputTestID: "metadata-prompt-agent-title-input",
},
branchName: {
titleKey: "settings.project.metadata.branchName",
placeholderKey: "settings.project.metadata.branchNamePlaceholder",
@@ -11,7 +11,6 @@ function emptyDraft(): ProjectConfigDraft {
teardownOriginalKind: "missing",
scripts: [],
metadataPrompts: {
agentTitle: "",
branchName: "",
commitMessage: "",
pullRequest: "",
@@ -217,17 +216,15 @@ describe("applyDraftToConfig", () => {
expect(tunnel.port).toBe("auto");
});
it("reads metadata prompt instructions for all four keys", () => {
it("reads metadata prompt instructions for visible keys", () => {
const draft = configToDraft({
metadataGeneration: {
agentTitle: { instructions: "Use mb/." },
branchName: { instructions: "feat/<slug>" },
commitMessage: { instructions: "Conventional commits." },
pullRequest: { instructions: "Include risk notes." },
},
});
expect(draft.metadataPrompts).toEqual({
agentTitle: "Use mb/.",
branchName: "feat/<slug>",
commitMessage: "Conventional commits.",
pullRequest: "Include risk notes.",
@@ -236,11 +233,27 @@ describe("applyDraftToConfig", () => {
it("defaults metadata prompts to empty strings when not present", () => {
const draft = configToDraft({
metadataGeneration: { agentTitle: { instructions: "Use mb/." } },
metadataGeneration: { branchName: { instructions: "feat/<slug>" } },
});
expect(draft.metadataPrompts).toEqual({
agentTitle: "Use mb/.",
branchName: "",
branchName: "feat/<slug>",
commitMessage: "",
pullRequest: "",
});
});
it("does not expose legacy agentTitle as a metadata prompt", () => {
const draft = configToDraft(
PaseoConfigRawSchema.parse({
metadataGeneration: {
agentTitle: { instructions: "Use mb/." },
branchName: { instructions: "feat/<slug>" },
},
}),
);
expect(draft.metadataPrompts).toEqual({
branchName: "feat/<slug>",
commitMessage: "",
pullRequest: "",
});
@@ -249,11 +262,11 @@ describe("applyDraftToConfig", () => {
it("writes only metadata prompt entries with non-empty text", () => {
const base: PaseoConfigRaw = {};
const draft = configToDraft(base);
draft.metadataPrompts.agentTitle = "Use mb/.";
draft.metadataPrompts.branchName = "Use mb/.";
draft.metadataPrompts.commitMessage = "Conventional commits.";
const next = applyDraftToConfig({ draft, base });
expect(next.metadataGeneration).toEqual({
agentTitle: { instructions: "Use mb/." },
branchName: { instructions: "Use mb/." },
commitMessage: { instructions: "Conventional commits." },
});
});
@@ -261,16 +274,16 @@ describe("applyDraftToConfig", () => {
it("drops the metadataGeneration field when all prompts are empty", () => {
const base = PaseoConfigRawSchema.parse({
metadataGeneration: {
agentTitle: { instructions: "Use mb/." },
branchName: { instructions: "Use mb/." },
},
});
const draft = configToDraft(base);
draft.metadataPrompts.agentTitle = "";
draft.metadataPrompts.branchName = "";
const next = applyDraftToConfig({ draft, base });
expect(next.metadataGeneration).toBeUndefined();
});
it("preserves unknown sibling fields inside metadataGeneration on round-trip", () => {
it("preserves legacy and unknown sibling fields inside metadataGeneration on round-trip", () => {
const base = PaseoConfigRawSchema.parse({
metadataGeneration: {
agentTitle: { instructions: "Use mb/." },
@@ -278,37 +291,38 @@ describe("applyDraftToConfig", () => {
},
});
const draft = configToDraft(base);
draft.metadataPrompts.agentTitle = "Use prefix mb/ on titles.";
draft.metadataPrompts.branchName = "Use prefix mb/ on branches.";
const next = applyDraftToConfig({ draft, base });
const metadata = next.metadataGeneration as Record<string, unknown>;
expect(metadata.agentTitle).toEqual({ instructions: "Use prefix mb/ on titles." });
expect(metadata.agentTitle).toEqual({ instructions: "Use mb/." });
expect(metadata.branchName).toEqual({ instructions: "Use prefix mb/ on branches." });
expect(metadata.futureField).toBe(42);
});
it("preserves unknown fields inside a metadata prompt entry on round-trip", () => {
const base = PaseoConfigRawSchema.parse({
metadataGeneration: {
agentTitle: { instructions: "Use mb/.", model: "haiku" },
branchName: { instructions: "Use mb/.", model: "haiku" },
},
});
const draft = configToDraft(base);
draft.metadataPrompts.agentTitle = "Updated.";
draft.metadataPrompts.branchName = "Updated.";
const next = applyDraftToConfig({ draft, base });
const metadata = next.metadataGeneration as Record<string, unknown>;
expect(metadata.agentTitle).toEqual({ instructions: "Updated.", model: "haiku" });
expect(metadata.branchName).toEqual({ instructions: "Updated.", model: "haiku" });
});
it("clears instructions but preserves unknown sibling fields when text becomes empty", () => {
const base = PaseoConfigRawSchema.parse({
metadataGeneration: {
agentTitle: { instructions: "Use mb/.", model: "haiku" },
branchName: { instructions: "Use mb/.", model: "haiku" },
},
});
const draft = configToDraft(base);
draft.metadataPrompts.agentTitle = "";
draft.metadataPrompts.branchName = "";
const next = applyDraftToConfig({ draft, base });
const metadata = next.metadataGeneration as Record<string, unknown>;
expect(metadata.agentTitle).toEqual({ model: "haiku" });
expect(metadata.branchName).toEqual({ model: "haiku" });
});
it("drops scripts with an empty name and removes scripts no longer present in the draft", () => {
@@ -7,12 +7,7 @@ import type {
export type LifecycleOriginalKind = "string" | "array" | "missing";
export const METADATA_PROMPT_KEYS = [
"agentTitle",
"branchName",
"commitMessage",
"pullRequest",
] as const;
export const METADATA_PROMPT_KEYS = ["branchName", "commitMessage", "pullRequest"] as const;
export type MetadataPromptKey = (typeof METADATA_PROMPT_KEYS)[number];
export interface ProjectScriptDraft {
@@ -105,7 +100,6 @@ function nextScriptDraftId(): string {
function emptyMetadataPrompts(): Record<MetadataPromptKey, string> {
return {
agentTitle: "",
branchName: "",
commitMessage: "",
pullRequest: "",