Update MCP create_agent test to match async branch auto-name

7c85341a moved first-agent branch auto-naming out of the worktree
service (sync slugify) into the workflow layer (async LLM call).
The MCP test stubs createPaseoWorktree, bypassing the workflow,
so the placeholder mnemonic branch is never renamed at this layer.
Replace the obsolete sync-slugify outcome assertion with a
placeholder-presence check; the auto-name logic itself is covered
in worktree-branch-name-generator.test.ts.
This commit is contained in:
Mohamed Boudra
2026-05-04 00:31:33 +07:00
parent bc0886ad7c
commit cf1f849b68

View File

@@ -683,7 +683,7 @@ describe("create_agent MCP tool", () => {
}
});
it("auto-names a create_agent branch-off worktree from the initial prompt without metadata branch rename", async () => {
it("creates a create_agent branch-off worktree without invoking the legacy metadata branch rename", async () => {
const { agentManager, agentStorage, spies } = createTestDeps();
const tempDir = await mkdtemp(join(tmpdir(), "paseo-mcp-agent-worktree-name-context-"));
const repoDir = join(tempDir, "repo");
@@ -737,9 +737,11 @@ describe("create_agent MCP tool", () => {
});
const agentCwd = spies.agentManager.createAgent.mock.calls[0]?.[0].cwd as string;
expect(
execSync("git branch --show-current", { cwd: agentCwd, stdio: "pipe" }).toString().trim(),
).toBe("fix-workspace-creation-naming");
const initialBranch = execSync("git branch --show-current", { cwd: agentCwd, stdio: "pipe" })
.toString()
.trim();
expect(initialBranch).not.toBe("");
expect(initialBranch).not.toBe("main");
await new Promise((resolve) => setTimeout(resolve, 0));
expect(workspaceGitService.getSnapshot).not.toHaveBeenCalled();
expect(broadcasts).toHaveLength(1);