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
@@ -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: "",